Integrate debt management features into Falukant daemon: Added falukant_debtors module for handling debtor logic, including daily processing and SQL queries for managing debtors' status and actions. Updated FalukantFamilyWorker to incorporate debtor checks and error handling, enhancing financial interactions and family dynamics.
This commit is contained in:
29
docs/FALUKANT_DEBTORS_DAEMON.md
Normal file
29
docs/FALUKANT_DEBTORS_DAEMON.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Falukant: Schuldturm & Pfändung (Daemon)
|
||||
|
||||
Der externe Daemon (`YpDaemon`) pflegt Verzugstage, Schuldturm-Eintritt, Pfändung und Freilassung. **Keine zusätzliche Migration** im Daemon nötig – Spalten in `falukant_data.debtors_prism` kommen vom Projekt.
|
||||
|
||||
## Wo im Code
|
||||
|
||||
| Komponente | Datei |
|
||||
|------------|--------|
|
||||
| SQL | `src/worker/sql.rs` (`QUERY_DEBTORS_*`) |
|
||||
| Tageslogik | `src/worker/falukant_debtors.rs` |
|
||||
| Stündliche Kreditrate + Verzug-Reset bei Zahlung | `src/worker/user_character.rs` |
|
||||
| Daily-Tick (24 h) | `src/worker/falukant_family.rs` → `falukant_debtors::run_daily` |
|
||||
|
||||
## Ablauf
|
||||
|
||||
1. **Stündlich**: `handle_credits` zieht Rate, wenn genug Geld. Bei Erfolg: `falukant_debtors::on_credit_payment_success` setzt `days_overdue` für `status = delinquent` zurück.
|
||||
2. **Täglich** (gleicher Rhythmus wie Falukant-Family-Daily): Nutzer mit offenem Kredit → Verzug erhöhen / Warnstufen / ab Tag 3 Eintritt `imprisoned` → Geld- und Fahrzeugverwertung → soziale Haftfolgen.
|
||||
|
||||
## Events (WebSocket)
|
||||
|
||||
Primär: `falukantUpdateDebt` mit `reason` (siehe Projektspezifikation). Begleitend: `falukantUpdateStatus`, `falukantUpdateFamily`, `falukantHouseUpdate`, `falukantBranchUpdate` je nach Schritt.
|
||||
|
||||
## Noch offen (größere Versionen)
|
||||
|
||||
- Waren/Lager, Hauspfändung, Niederlassungsschließung
|
||||
- `household_tension_reasons_json` um `debtorsPrison` ergänzen
|
||||
- Beziehungsabbruch nach Spec (Schwellen / Zufall)
|
||||
|
||||
Siehe die vollständige fachliche Spezifikation im Projektdokument „Schuldturm und Pfändung“.
|
||||
Reference in New Issue
Block a user