Tenant
One customer company.
| Table | tenant |
| Tenant-scoped | No — global table |
| Columns | 15 |
| Relationships | 0 |
| Source | backend/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
| Field | Type | Column | Null | Notes |
|---|---|---|---|---|
tenantId | Integer | tenant_id | — | primary key, generated |
slug | String | slug | — | unique; DNS-safe identifier: public careers URLs today, subdomain routing later. |
name | String | name | — | — |
status | String | status | — | — |
timezone | String | timezone | — | — |
adminEmail | String | admin_email | Yes | — |
trialEndsAt | LocalDateTime | trial_ends_at | Yes | When a self-serve workspace stops being served. |
suspensionReason | SuspensionReason | suspension_reason | Yes | enum; Why the tenant is SUSPENDED; null otherwise (V167 enforces both directions). |
accessMode | AccessMode | access_mode | — | enum; How module access is decided (V172). |
managedPlanCode | String | managed_plan_code | Yes | Plan assigned by the platform operator when there is no provider subscription; may be null. |
entitlementVersion | Long | entitlement_version | Yes | Bumped by EntitlementService.bumpVersion (a SQL update) whenever entitlements change, so every app instance reloads on its next request. |
createdAt | LocalDateTime | created_at | — | — |
createdBy | String | created_by | Yes | — |
updatedAt | LocalDateTime | updated_at | Yes | — |
updatedBy | String | updated_by | Yes | — |
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
| Method | Returns | Notes |
|---|---|---|
findBySlugIgnoreCase(String slug) | Optional<Tenant> | derived |
existsBySlugIgnoreCase(String slug) | boolean | derived |
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) | int | explicit @Query, modifying |
currentEntitlementVersion(@org.springframework.data.repository.query.Param("tenantId") Integer tenantId) | Long | explicit @Query |
Reached by
These controllers hold — directly or through a service they depend on — a repository over Tenant.
| Controller | Base path | Endpoints | Module |
|---|---|---|---|
| BillingController | /api/billing | 6 | Billing & Platform |
| BillingWebhookController | /api/webhooks | 1 | Billing & Platform |
| PublicBillingController | /api/public/billing | 1 | Billing & Platform |
| PublicSignupController | /api/public/signup | 2 | Billing & Platform |
| SubscriptionStatusController | /api/billing | 1 | Billing & Platform |
| TenantAdminController | /api/admin/tenants | 13 | Billing & 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/.