feat(auth): migrate the notifications hub to TenantId (PMS-139 sweep batch 7) #169
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/pms-139-sweep-notifications"
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?
What
Batch 7 of the PMS-139 typed-tenant sweep: the second cross-module hub - the notifications module.
How
dispatchand the rest ofNotificationsServicenow taketenant_id: TenantId; notifications routes derive scope viau.tenant(). Transparent newtype -> query bodies unchanged. No audit-hub calls in this module, so nothing to unwrap.NotificationDispatcherWorker) stays aUuid-internal struct: it reads pending rows off thenotificationstable and itsdeliver/lookup_user_emailhelpers never cross the public service boundary, like the calendar/sla workers.dispatchbridges viaTenantId::from_trusted(..): the not-yet-sweptauth(password-reset + welcome) andtickets(note-added + automation) modules, plus the cross-tenantcalendarreminder andslasweep workers (which dispatch off DB-projected row tenants). The auth/tickets bridges clear when those modules are swept; the worker bridges are the standing cross-tenant pattern.tenant_id.get()count unchanged at 5 (dispatch callers passed rawUuids, not.get()unwraps): thePaymentResponse/TenantUsageDTO fields and thetenantsupdateentity_idare plainUuid,AuditCtx::systemis aUuidcontext bag, and the one transitional survivor is rmm'sTicketServicecall (clears when tickets is swept).Verification
cargo check --all-targets,cargo clippy --all-targets: clean.notifications(2),notifications_backfill(1),sla_notify(1),calendar_reminders(1),tickets(2),auth(14).cargo test --doc:compile_failnewtype guard holds.authMFA test flaked once on sqlx test-db provisioning and passed on rerun - unrelated to this change.)Progress: 15 of ~17 modules migrated. One hub remains -
tickets(theTicketServicehub). Sweeping it clears the last transitional.get()(rmm's call) and letsauth/ticketsshed theirfrom_trustedaudit/dispatch bridges, completing PMS-139.🤖 Generated with Claude Code