feat(auth): migrate the tickets hub to TenantId, completing PMS-139 (sweep batch 8) #171
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/pms-139-sweep-tickets"
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 8 of the PMS-139 typed-tenant sweep - the finale. The last cross-module hub,
tickets(theTicketService), now takesTenantId, completing the migration.How
TicketService(service + automation) takestenant_id: TenantId; tickets routes derive scope viauser.tenant(). Transparent newtype -> query bodies unchanged. FromRow projections keep theirUuidfields.audit_writecalls and theticket.note_added/ticket.automation.notifydispatches drop theTenantId::from_trusted(..)wrappers added in batches 6-7 and hand the scope straight through.tenant_id.get()it passed tocreate_ticket- this was the last transitional unwrap in the codebase.from_trusted, like the KB/invoice feeds. seed: itscreate_ticketbridges the trusted seeder's id.tenant_id.get(), all genuineUuidboundaries, none transitional):PaymentResponse/TenantUsageDTO fields, thetenantsupdateentity_id,AuditCtx::system(aUuidcontext bag), and the ticket-automation webhook payload (serialised asUuid).tenant_id: Uuid" architecture notes corrected.Verification
cargo check --all-targets,cargo clippy --all-targets: clean.cargo testsuite passes except the two pre-existingtests/settings.rsbilling-404 failures (disabled_module_returns_404_on_route_access,enabled_module_response_unchanged), which reproduce identically on cleanmain(verified in batch 4) and are unrelated to this change. Spot-run green:tickets(2),rmm(3),seed_demo(2),audit(4),audit_hooks(3), plus the full integration sweep.cargo test --doc:compile_failnewtype guard holds.PMS-139 complete
All request-scoped modules and all three hubs (audit, notifications, tickets) take
TenantId. A handler that forgets to pass the authenticated scope no longer compiles. The remainingfrom_trustedsites are the deliberate ones (machine HMAC webhook, portal contact sessions, trusted seeders, cross-tenant workers, the auth login path), each noted in-code.🤖 Generated with Claude Code