Skip to main content

Tenant

One customer company.

Tabletenant
Tenant-scopedNo — global table
Columns15
Relationships0
Sourcebackend/src/main/java/com/motorph/payroll/model/Tenant.java
Not tenant-scoped

This entity does not extend TenantOwned, so its rows are shared across every tenant. TenantCoverageTest allows that only for tables deliberately declared global.

Columns​

FieldTypeColumnNullNotes
tenantIdIntegertenant_id—primary key, generated
slugStringslug—unique; DNS-safe identifier: public careers URLs today, subdomain routing later.
nameStringname——
statusStringstatus——
timezoneStringtimezone——
adminEmailStringadmin_emailYes—
trialEndsAtLocalDateTimetrial_ends_atYesWhen a self-serve workspace stops being served.
suspensionReasonSuspensionReasonsuspension_reasonYesenum; Why the tenant is SUSPENDED; null otherwise (V167 enforces both directions).
accessModeAccessModeaccess_mode—enum; How module access is decided (V172).
managedPlanCodeStringmanaged_plan_codeYesPlan assigned by the platform operator when there is no provider subscription; may be null.
entitlementVersionLongentitlement_versionYesBumped by EntitlementService.bumpVersion (a SQL update) whenever entitlements change, so every app instance reloads on its next request.
createdAtLocalDateTimecreated_at——
createdByStringcreated_byYes—
updatedAtLocalDateTimeupdated_atYes—
updatedByStringupdated_byYes—

Repository​

TenantRepository​

Declared over Tenant with id type Integer, with JpaSpecificationExecutor for dynamic filtering. Source: backend/src/main/java/com/motorph/payroll/repository/TenantRepository.java

MethodReturnsNotes
findBySlugIgnoreCase(String slug)Optional<Tenant>derived
existsBySlugIgnoreCase(String slug)booleanderived
findByStatusOrderByTenantIdAsc(String status)List<Tenant>derived
findByStatusInOrderByTenantIdAsc(Collection<String> statuses)List<Tenant>derived
findByStatusAndTrialEndsAtBefore(String status, LocalDateTime cutoff)List<Tenant>derived
bumpEntitlementVersion(@org.springframework.data.repository.query.Param("tenantId") Integer tenantId)intexplicit @Query, modifying
currentEntitlementVersion(@org.springframework.data.repository.query.Param("tenantId") Integer tenantId)Longexplicit @Query

Reached by​

These controllers hold — directly or through a service they depend on — a repository over Tenant.

ControllerBase pathEndpointsModule
BillingController/api/billing6Billing & Platform
BillingWebhookController/api/webhooks1Billing & Platform
PublicBillingController/api/public/billing1Billing & Platform
PublicSignupController/api/public/signup2Billing & Platform
SubscriptionStatusController/api/billing1Billing & Platform
TenantAdminController/api/admin/tenants13Billing & Platform

Generated page

This page is rebuilt from the source on every docs build by docs-site/scripts/gen-code-wiki.mjs. Editing it has no effect — change the code, or, if what you want to say is prose, write it in docs/.