Skip to content

Ledger-export retention labels reflecting legal-hold status per period #753

Description

@thlpkee20-wq

Description

Some ledger periods are under legal hold and must not be purged even after retention. Add retention labels per period with legal-hold override and a purge worker that respects labels.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: src/services/auditPurgeService.ts
  • Legal-hold add/remove dual-controlled

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/ledger-legal-hold-labels
  • Implement changes
    • Add retention_labels table
    • Extend purge to skip held periods
    • Emit purge.skipped_hold counter
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • npm test
  • Cover edge cases
    • Hold removed re-enters purge on next cycle only
  • Include test output and notes

Example commit message

feat: retention labels with legal-hold override

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions