feat(rewards): ledger, earning rules and nightly settle

New module rewards tracks Pile Points in an append-only ledger. A settle
derives rows from the status log, playtime days and achievements, once per
user, kind and game. The balance is the sum of all rows. Settle runs on
every wallet read and nightly at 02:30. The unique key (user_id, kind, ref)
makes every run idempotent. V26 also pays a one-time starter grant for
finishes from before the status log.
This commit is contained in:
lobo committed 2026-10-01 13:15:04 +02:00
1 parent 732970697d
commit 837dad8a6f
28 files changed
+1470 -3

No files matched your search

+3
View File
@@ -67,6 +67,9 @@ app:
image-repair-batch: 200
image-repair-max-attempts: 3
image-repair-retry-days: 30
rewards:
# Pile Points of every user, after the nightly sync (23:55) and the image repair (01:30).
settle-cron: "0 30 2 * * *"
account-cleanup:
# Log only, delete nothing. Auth's nightly cleanup drives this; see the Deployment README before flipping it.
dry-run: ${APP_ACCOUNT_CLEANUP_DRY_RUN:true}