Skip to content

feat(retention): port data-retention settings + purge (Phoenix)#88

Merged
mpge merged 1 commit into
masterfrom
feat/data-retention
Jun 24, 2026
Merged

feat(retention): port data-retention settings + purge (Phoenix)#88
mpge merged 1 commit into
masterfrom
feat/data-retention

Conversation

@mpge

@mpge mpge commented Jun 24, 2026

Copy link
Copy Markdown
Member

Brings escalated-phoenix toward parity with the laravel reference for the data-retention domain (previously absent). Ships the safe subset; the closed-ticket purge is intentionally deferred.

What

  • Escalated.Support.Retention — shared retention-value → days map + cutoff helper
  • mix escalated.purge_expired (--dry-run) — deletes attachments and audit logs older than configured retention (laravel hard-deletes these too — no divergence). Closed-ticket purge is reported only, not enforced: laravel soft-deletes tickets with a grace period, which needs a deleted_at column the Phoenix ticket schema lacks. Deferred so a destructive cron isn't shipped without that safety net.
  • Admin DataRetentionController — settings + read-only purge preview; router wired under admin settings

Verified (Docker, elixir:1.15-otp-26)

  • mix format ✓ · mix credo --strict ✓ · full suite 501 tests, 0 failures

Part of the backend parity program (escalated-laravel baseline).

Brings escalated-phoenix toward parity with the laravel reference for the
data-retention domain (previously absent). Ships the safe subset; the
closed-ticket purge is intentionally deferred (see below).

- Escalated.Support.Retention: shared retention-value -> days map +
  cutoff helper (mirrors the laravel map).
- mix escalated.purge_expired (--dry-run): deletes attachments and audit
  logs older than their configured retention (laravel hard-deletes these
  too — no divergence). Closed-ticket purge is reported only, not
  enforced: the laravel command soft-deletes tickets with a grace period,
  which needs a deleted_at column the Phoenix ticket schema lacks. Left as
  a follow-up so a destructive cron isn't shipped without that safety net.
- Admin DataRetentionController: retention settings + read-only purge
  preview. Router wired under admin settings.

Verified in Docker: mix format, mix credo --strict, full suite
(501 tests, 0 failures).
@mpge
mpge merged commit a8cf73e into master Jun 24, 2026
1 check passed
@mpge
mpge deleted the feat/data-retention branch June 24, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant