Persist 1y audit-log retention on Business plan

OpenMantavyamwants to merge 3 commits intomainfromfeat/audit-log

Running 1 check(s)

Almost there — see what’s left below.

2/2 approvals7/8 checksNo conflictsBranch up to date

Adds 1-year retention for audit log entries on the Business plan. Closes the compliance gap flagged in #3211 — the read-side already supports per-plan retention, this PR only persists it on writes.

  • New retentionFor(plan) helper
  • Migration adds retention_days with sensible defaults
  • Backfill script in scripts/backfill-retention.ts
8 filesAdded +142Removed −18
7 of 8 checks passed
1 running · 9m 14s elapsed
  • passed: buildweb
    2m 14s
  • passed: buildapi
    1m 48s
  • passed: testunit
    3m 02s
  • passed: teste2e
    9m 14s
  • passed: linttsc
    21s
  • passed: previewvercel
    1m 06s
  • passed: securitysnyk
    32s
  • running: perflighthouse
    running

Activity

  1. Maya Okaforpushed 3 commits ·
    • f3b9a21feat(audit): persist 1y retention on Business plan
    • 12cae71Merge branch 'feat/audit-log'
    • 8a204d3fix(table): respect filter in CSV export
  2. CI 7/8 checks passed in 9m 14s ·
  3. James Lin
    apps/api/src/audit/retention.tsline 42

    Could we extract the retention map so the api route doesn’t need to know about plan tiers? Otherwise this LGTM.

  4. James Linapproved this

    Resolved with the inline suggestion. Thanks!

  5. preview deploy ready in 1m 06s · audit-log-feat.preview.acme.dev
  6. Maya Okaforapproved this
  7. Mantavyam marked ready for review ·