Difficulty: Advanced
Type: Feature
Summary
Add a scheduled reconciliation job that updates persisted membership states when memberships expire or when indexed data falls out of sync.
Current Behaviour
Access checks can derive effective expiry at read time, but persisted membership records may still show stale states until another write occurs.
Expected Behaviour
The system should periodically reconcile stored membership state, expiry timestamps, and role-derived access state.
Suggested Implementation
Create a worker that scans memberships with expired expiresAt, updates their persisted state where appropriate, and writes audit or outbox events for state changes.
Files or Areas Likely Affected
apps/access-api/src/workers/
apps/access-api/src/services/memberService.ts
apps/access-api/prisma/schema.prisma
apps/access-api/src/services/auditService.ts
.env.example
Acceptance Criteria
Additional Notes
Do not rely on reconciliation for correctness of access decisions. Read-time expiry checks should remain the first line of defence.
Difficulty: Advanced
Type: Feature
Summary
Add a scheduled reconciliation job that updates persisted membership states when memberships expire or when indexed data falls out of sync.
Current Behaviour
Access checks can derive effective expiry at read time, but persisted membership records may still show stale states until another write occurs.
Expected Behaviour
The system should periodically reconcile stored membership state, expiry timestamps, and role-derived access state.
Suggested Implementation
Create a worker that scans memberships with expired
expiresAt, updates their persisted state where appropriate, and writes audit or outbox events for state changes.Files or Areas Likely Affected
apps/access-api/src/workers/apps/access-api/src/services/memberService.tsapps/access-api/prisma/schema.prismaapps/access-api/src/services/auditService.ts.env.exampleAcceptance Criteria
Additional Notes
Do not rely on reconciliation for correctness of access decisions. Read-time expiry checks should remain the first line of defence.