Implement daily political salary management: Introduced a new function run_daily_political_salary to calculate and distribute daily salaries for players with active political offices, utilizing configured values or fallback based on office rank. Updated SQL queries to support this functionality, including checks for the readiness of the necessary database column. Enhanced the PoliticsWorker to trigger daily salary processing, ensuring timely updates for users. Improved documentation for clarity on the new salary management features and their integration into the existing political benefits system.
All checks were successful
Deploy yourpart (blue-green) / deploy (push) Successful in 2m51s
All checks were successful
Deploy yourpart (blue-green) / deploy (push) Successful in 2m51s
This commit is contained in:
6
migrations/013_falukant_political_daily_salary.sql
Normal file
6
migrations/013_falukant_political_daily_salary.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
-- Tägliches politisches Gehalt (Daemon): Idempotenz pro Kalendertag (UTC)
|
||||
ALTER TABLE falukant_data.falukant_user
|
||||
ADD COLUMN IF NOT EXISTS last_political_daily_salary_on DATE;
|
||||
|
||||
COMMENT ON COLUMN falukant_data.falukant_user.last_political_daily_salary_on IS
|
||||
'Letzter Tag, an dem political daily salary gutgeschrieben wurde (YpDaemon political_benefits::run_daily_political_salary).';
|
||||
@@ -29,3 +29,7 @@ Tabellen **`political_benefit_last_tick`** und optional **`political_appointment
|
||||
- **Ernennungen**: Daemon setzt nur `pending` → `expired`, wenn `expires_at` überschritten (Anlage durch Backend-API).
|
||||
|
||||
Die Join-Spalte auf `political_office_benefit` heißt im Repo **`political_office_type_id`** — falls das Sequelize-Modell abweicht, SQL in `src/worker/sql.rs` anpassen.
|
||||
|
||||
## `013_falukant_political_daily_salary.sql`
|
||||
|
||||
Spalte **`falukant_data.falukant_user.last_political_daily_salary_on`** (Datum): Idempotenz für **`political_benefits::run_daily_political_salary`** — einmal pro Tag Gutschrift; Beträge aus JSON-Feld **`daily_salary`** (`tr`/`benefitType` = `daily_salary`) oder gestufter Daemon-Fallback nach Amts-Rang.
|
||||
|
||||
Reference in New Issue
Block a user