feat: punkt 6 (backup) — ARQ cron job, backup config in settings, backup-now trigger, backup history, migration 0130
This commit is contained in:
@@ -38,6 +38,10 @@ def _settings_to_dict(s: SystemSettings) -> dict[str, Any]:
|
||||
"theme_accent_color": s.theme_accent_color,
|
||||
"theme_font_family": s.theme_font_family,
|
||||
"theme_border_radius": s.theme_border_radius,
|
||||
"backup_enabled": s.backup_enabled,
|
||||
"backup_interval": s.backup_interval,
|
||||
"backup_retention_days": s.backup_retention_days,
|
||||
"backup_destination": s.backup_destination,
|
||||
"created_at": s.created_at.isoformat() if s.created_at else None,
|
||||
"updated_at": s.updated_at.isoformat() if s.updated_at else None,
|
||||
}
|
||||
@@ -114,6 +118,10 @@ async def upsert_system_settings(
|
||||
theme_accent_color=data.get("theme_accent_color", "#d946ef"),
|
||||
theme_font_family=data.get("theme_font_family", "Inter"),
|
||||
theme_border_radius=data.get("theme_border_radius", "0.5rem"),
|
||||
backup_enabled=data.get("backup_enabled", False),
|
||||
backup_interval=data.get("backup_interval", "daily"),
|
||||
backup_retention_days=data.get("backup_retention_days", 7),
|
||||
backup_destination=data.get("backup_destination", "local"),
|
||||
)
|
||||
db.add(settings)
|
||||
await db.flush()
|
||||
@@ -131,6 +139,7 @@ async def upsert_system_settings(
|
||||
"bic", "bank_name", "ceo", "trade_register",
|
||||
"invoice_prefix", "quote_prefix", "payment_terms_days",
|
||||
"theme_primary_color", "theme_accent_color", "theme_font_family", "theme_border_radius",
|
||||
"backup_enabled", "backup_interval", "backup_retention_days", "backup_destination",
|
||||
)
|
||||
for field in all_fields:
|
||||
if field in data and data[field] is not None:
|
||||
|
||||
Reference in New Issue
Block a user