feat(tenants): tenant own-company for general time logging (PMS-413) #309
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-413-tenant-own-company"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Establishes the tenant's own company as a first-class
internalcompany so general / overhead time entries have a stable realcompany_id(unblocks MAPPS-243). AddsCompanyType::Internaland extends thecompanies.company_typeCHECK; addstenants.own_company_id(nullable FK). An idempotentTenantService::ensure_own_companycreates one internal company per tenant named after the tenant and links it, wired into all provisioning paths; migration 062 does the same as a one-time, re-runnable backfill. Internal companies are hidden from the defaultGET /contacts/companiescustomer list (an explicitcompany_type=internalfilter and id lookup still resolve them).own_company_idis exposed on the user payload (CurrentUser/User/UserResponse) via a correlated subquery so/auth/meand the login response carry it. Integration tests cover provisioning, idempotent backfill, the list exclusion, and creating a general entry againstown_company_id.#PMS-413