Add FalukantFamilyWorker and related SQL queries: Introduced the FalukantFamilyWorker to manage family-related logic, including marriage satisfaction and relationship states. Added new SQL queries for handling lover relationships and marriage updates, enhancing the overall functionality of family dynamics in the application.

This commit is contained in:
Torsten Schulz (local)
2026-03-20 10:26:15 +01:00
parent f9c80bbd6b
commit 6a5ff4557e
8 changed files with 1164 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
# Falukant: Daemon-Handoff (YpDaemon)
Technische Abstimmung mit dem Übergabedokument im Backend-Projekt (`FALUKANT_LOVERS_DAEMON_SPEC.md` / `FALUKANT_LOVERS_TECHNICAL_CONCEPT.md`).
## Abweichungen / Zuordnung
| Handoff / Backend | YpDaemon |
|-------------------|----------|
| `relationship_state.marriage_satisfaction` (Ehe) | **`relationship.marriage_satisfaction`** für Zeilen mit `relationship_type``married`, `engaged`, `wooing` |
| `months_underfunded` | Spalte `months_underfunded` (Migration 001; Legacy: `002` benennt `consecutive_underpayment_months` um) |
| Idempotenz `last_daily_processed_at` / `last_monthly_processed_at` | Gesetzt von `FalukantFamilyWorker` pro Liebschaft |
## Ticks
- **Daily:** nur Zeilen mit `(last_daily_processed_at IS NULL OR last_daily_processed_at::date < CURRENT_DATE)`; danach `last_daily_processed_at = NOW()`.
- **Monthly:** nur Zeilen mit `(last_monthly_processed_at IS NULL OR date_trunc('month', last_monthly_processed_at) < date_trunc('month', CURRENT_TIMESTAMP))`; nach Kosten/Unterversorgung `last_monthly_processed_at = NOW()`.
**Hinweis:** Der Worker nutzt weiterhin **Wandzeit** (24 h / 30 Tage) als Intervall; die Idempotenz über die Zeitstempel verhindert Doppelverarbeitung bei Neustarts am selben Tag/Monat.
## Migrationen
1. `migrations/001_falukant_family_lovers.sql`
2. Optional: `migrations/002_falukant_family_rename_legacy_columns.sql` bei Altbestand