53 lines
1.4 KiB
Python
53 lines
1.4 KiB
Python
|
|
"""Bootstrap seed data applied by the initial migration.
|
||
|
|
|
||
|
|
The :data:`RETENTION_CLASS_SEEDS` entries match the five v1 retention classes
|
||
|
|
listed in ``docs/ARCHITECTURE-BLUEPRINT.md``. Default durations are intended
|
||
|
|
to be overridable by an operator configuration file (WP-0003); the seed
|
||
|
|
values only ensure the registry has sensible defaults on a fresh DB.
|
||
|
|
"""
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from typing import TypedDict
|
||
|
|
|
||
|
|
|
||
|
|
class RetentionClassSeed(TypedDict):
|
||
|
|
class_id: str
|
||
|
|
default_duration_seconds: int | None
|
||
|
|
deletion_strategy: str
|
||
|
|
|
||
|
|
|
||
|
|
_ONE_DAY = 86_400
|
||
|
|
_NINETY_DAYS = 90 * _ONE_DAY
|
||
|
|
_ONE_YEAR = 365 * _ONE_DAY
|
||
|
|
_SEVEN_YEARS = 7 * _ONE_YEAR
|
||
|
|
|
||
|
|
|
||
|
|
RETENTION_CLASS_SEEDS: tuple[RetentionClassSeed, ...] = (
|
||
|
|
{
|
||
|
|
"class_id": "transient",
|
||
|
|
"default_duration_seconds": _ONE_DAY,
|
||
|
|
"deletion_strategy": "mark_eligible",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"class_id": "raw-evidence",
|
||
|
|
"default_duration_seconds": _NINETY_DAYS,
|
||
|
|
"deletion_strategy": "mark_eligible",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"class_id": "summary-evidence",
|
||
|
|
"default_duration_seconds": _ONE_YEAR,
|
||
|
|
"deletion_strategy": "mark_eligible",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"class_id": "release-evidence",
|
||
|
|
"default_duration_seconds": _SEVEN_YEARS,
|
||
|
|
"deletion_strategy": "mark_eligible",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"class_id": "permanent-record",
|
||
|
|
"default_duration_seconds": None,
|
||
|
|
"deletion_strategy": "mark_eligible",
|
||
|
|
},
|
||
|
|
)
|