feat(p9): thread purpose + persist consent receipt through OutboundService

Task S2.2: OutboundService.send gains an optional purpose, passes it to the broker,
and persists the returned consentReceiptRef on IiosOutboundCommand (new nullable
column, migration outbound-consent). RouteService.execute passes 'route_forward';
calendar reminders pass 'meeting_reminder'. CMP-DENY → command BLOCKED, no send.
2 tests: receipt recorded on allow, purpose-DENY blocks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-02 21:26:01 +05:30
parent 2223d7a891
commit cdc59be481
6 changed files with 35 additions and 6 deletions
+5 -4
View File
@@ -706,10 +706,11 @@ model IiosOutboundCommand {
channelType String
target String
payload Json
status String @default("PENDING") // PENDING | SENT | FAILED | RATE_LIMITED
idempotencyKey String @unique
providerRef String?
createdAt DateTime @default(now())
status String @default("PENDING") // PENDING | SENT | FAILED | RATE_LIMITED | BLOCKED
idempotencyKey String @unique
providerRef String?
consentReceiptRef String? // CMP consent receipt this send went out under (P9)
createdAt DateTime @default(now())
attempts IiosDeliveryAttempt[]