fix/pms-210-fmt-sweep-batch3 #162

Closed
David wants to merge 0 commits from david/fix/pms-210-fmt-sweep-batch3 into main AGit
Owner
feat(auth): migrate calendar + sla + contracts to TenantId (PMS-139 sweep batch 3)
Sweep batch 3 of the typed-tenant rollout. Handlers in calendar/sla/contracts now derive the scope via u.tenant() (the TenantScoped trait), and every public service method plus module-local helper takes tenant_id: TenantId instead of a bare Uuid, so a wrong-tenant id is a compile error rather than a silent cross-tenant read.

The transparent newtype encodes/decodes/Displays as its inner Uuid, so .bind(tenant_id) and %tenant_id tracing are unchanged. The only unwraps are at the not-yet-swept audit_write hub in contracts (nine call sites use tenant_id.get() transitionally) - those vanish when the audit hub is swept last.

Cross-tenant workers (calendar reminder, sla sweep, contract lifecycle) are untouched: they read tenant ids off DB-projected rows as Uuid and fan out through the notifications/audit hubs, never calling a migrated method. The calendar ReminderCandidate/ReminderRow projections keep their Uuid fields for the same reason.

Direct-construction tests (tests/contracts.rs, tests/sla.rs) wrap their literal tenant ids with TenantId::from_trusted(...), matching the batch-1 tests/rmm precedent.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

style: cargo fmt on PMS-139 sweep batch 3 (calendar/sla/contracts)
The check.yml run on PR #161 (refs/pull/161/head, commit b77e6718) failed at the cargo fmt --check step: rustfmt flagged import ordering and multi-line argument wrapping in the calendar/contracts/sla services and the contracts/sla tests introduced by the TenantId migration. Running cargo fmt over the workspace resolves every diff with no functional change. just check (cargo check --all-targets, clippy --all-targets, fmt --all --check) is green.

#PMS-210

feat(auth): migrate calendar + sla + contracts to TenantId (PMS-139 sweep batch 3) : Sweep batch 3 of the typed-tenant rollout. Handlers in calendar/sla/contracts now derive the scope via `u.tenant()` (the `TenantScoped` trait), and every public service method plus module-local helper takes `tenant_id: TenantId` instead of a bare `Uuid`, so a wrong-tenant id is a compile error rather than a silent cross-tenant read. The transparent newtype encodes/decodes/Displays as its inner `Uuid`, so `.bind(tenant_id)` and `%tenant_id` tracing are unchanged. The only unwraps are at the not-yet-swept `audit_write` hub in contracts (nine call sites use `tenant_id.get()` transitionally) - those vanish when the audit hub is swept last. Cross-tenant workers (calendar reminder, sla sweep, contract lifecycle) are untouched: they read tenant ids off DB-projected rows as `Uuid` and fan out through the notifications/audit hubs, never calling a migrated method. The calendar `ReminderCandidate`/`ReminderRow` projections keep their `Uuid` fields for the same reason. Direct-construction tests (`tests/contracts.rs`, `tests/sla.rs`) wrap their literal tenant ids with `TenantId::from_trusted(...)`, matching the batch-1 `tests/rmm` precedent. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> style: cargo fmt on PMS-139 sweep batch 3 (calendar/sla/contracts) : The check.yml run on PR #161 (refs/pull/161/head, commit b77e6718) failed at the cargo fmt --check step: rustfmt flagged import ordering and multi-line argument wrapping in the calendar/contracts/sla services and the contracts/sla tests introduced by the TenantId migration. Running cargo fmt over the workspace resolves every diff with no functional change. just check (cargo check --all-targets, clippy --all-targets, fmt --all --check) is green. #PMS-210
feat(auth): migrate calendar + sla + contracts to TenantId (PMS-139 sweep batch 3)
Some checks failed
Check / fmt + clippy + compile + tests (pull_request) Failing after 12s
E2E (staging) / Playwright against staging (pull_request) Successful in 39s
Build OCI container / Build and push mokosh-api image (push) Successful in 3m16s
Create release / Create release from merged PR (pull_request) Has been skipped
b77e6718e0
Sweep batch 3 of the typed-tenant rollout. Handlers in calendar/sla/contracts now derive the scope via `u.tenant()` (the `TenantScoped` trait), and every public service method plus module-local helper takes `tenant_id: TenantId` instead of a bare `Uuid`, so a wrong-tenant id is a compile error rather than a silent cross-tenant read.

The transparent newtype encodes/decodes/Displays as its inner `Uuid`, so `.bind(tenant_id)` and `%tenant_id` tracing are unchanged. The only unwraps are at the not-yet-swept `audit_write` hub in contracts (nine call sites use `tenant_id.get()` transitionally) - those vanish when the audit hub is swept last.

Cross-tenant workers (calendar reminder, sla sweep, contract lifecycle) are untouched: they read tenant ids off DB-projected rows as `Uuid` and fan out through the notifications/audit hubs, never calling a migrated method. The calendar `ReminderCandidate`/`ReminderRow` projections keep their `Uuid` fields for the same reason.

Direct-construction tests (`tests/contracts.rs`, `tests/sla.rs`) wrap their literal tenant ids with `TenantId::from_trusted(...)`, matching the batch-1 `tests/rmm` precedent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
style: cargo fmt on PMS-139 sweep batch 3 (calendar/sla/contracts)
Some checks failed
E2E (staging) / Playwright against staging (pull_request) Failing after 26s
Check / fmt + clippy + compile + tests (pull_request) Successful in 2m16s
Create release / Create release from merged PR (pull_request) Has been skipped
cc46e95577
The check.yml run on PR #161 (refs/pull/161/head, commit b77e6718) failed at the cargo fmt --check step: rustfmt flagged import ordering and multi-line argument wrapping in the calendar/contracts/sla services and the contracts/sla tests introduced by the TenantId migration. Running cargo fmt over the workspace resolves every diff with no functional change. just check (cargo check --all-targets, clippy --all-targets, fmt --all --check) is green.

#PMS-210
Author
Owner

Closing as redundant. This PR's only commit was the narrow cargo fmt fixup on calendar/sla/contracts (PMS-210). That formatting is already in main: the PMS-139 TenantId sweep continued through batches 5-8, then PR #173 (chore: cargo fmt --all after the PMS-139 TenantId sweep, commit c441b1c) reformatted the whole workspace including those files, superseding this fixup. Rebasing this PR's head onto current main drops the commit ("patch contents already upstream"), leaving nothing to merge.

Closing as redundant. This PR's only commit was the narrow `cargo fmt` fixup on calendar/sla/contracts (PMS-210). That formatting is already in `main`: the PMS-139 TenantId sweep continued through batches 5-8, then PR #173 (`chore: cargo fmt --all after the PMS-139 TenantId sweep`, commit `c441b1c`) reformatted the whole workspace including those files, superseding this fixup. Rebasing this PR's head onto current `main` drops the commit ("patch contents already upstream"), leaving nothing to merge.
David closed this pull request 2026-06-13 12:37:03 +02:00
Some checks are pending
E2E (staging) / Playwright against staging (pull_request) Failing after 26s
Check / fmt + clippy + compile + tests (pull_request) Successful in 2m16s
Required
Details
Create release / Create release from merged PR (pull_request) Has been skipped
E2E / * (pull_request)
Required

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!162
No description provided.