Skip to content

data-retention

Resolves the effective retention policy for any entity using a 3-layer stack: entity-level default → tenant preset (dsgvo-basic, dsgvo-hgb, swiss-dsg) → per-tenant override stored in tenantRetentionOverride. Other features query the resolved policy via the retention.policyFor cross-feature API — most notably user-data-rights, which uses it to decide whether to anonymize instead of hard-delete a record that is still within a mandatory retention window.

What this feature needs to run (Requires, top) and the write commands it provides (Provides, bottom).

flowchart TB
  n_data_retention["data-retention"]
  subgraph how_provides["Provides"]
    n_cmd_retention_policyFor(["retention.policyFor"])
  end
  n_data_retention --> n_cmd_retention_policyFor

Provides — write commands this feature registers (dispatch them through the command bus):

  • retention.policyFor
  • Requires: none
  • Activation: always on (not toggleable)
  • Exposes API: retention.policyFor