feat(earnings): integrate native reward sources

This commit is contained in:
simoleo89
2026-06-15 21:14:35 +02:00
parent bd9657cf63
commit 766d8d67d3
6 changed files with 302 additions and 17 deletions
+5
View File
@@ -78,6 +78,11 @@ This document is the emulator-side contract for the "Guadagni" UI.
For `points`, `pointsType` carries the currency type. For `badge`, `data` carries the badge code. For `item`, `data` carries the `items_base.id`. Other reward types keep `data` empty.
`marketplace` and `hc_payday` can be native rows. In native mode the amounts come from existing server state:
- `marketplace`: sold marketplace offers waiting for payout
- `hc_payday`: unclaimed rows in `logs_hc_payday`
## Result Status
- `success`
@@ -63,8 +63,10 @@ Add emulator settings with safe defaults:
- `earnings.<category>.item_id=0`
- `earnings.<category>.item.quantity=1`
- `earnings.<category>.hc.days=0`
- `earnings.<category>.native.enabled=0/1`
The feature defaults off so existing hotels do not receive surprise economy changes after deploying the jar.
Marketplace and HC payday default to native integrations once the feature is enabled, because both already have server-side claim ledgers.
## Packet Contract
@@ -90,6 +92,8 @@ Composer format is intentionally simple and renderer-friendly: category key, ena
- Roll back the claim record if a DB-backed reward grant fails.
- Use the database unique key to prevent concurrent double claims.
- `claim all` processes only claimable rows and returns per-category results.
- Marketplace claims use the existing marketplace sold-offer payout path.
- HC payday claims use existing unclaimed `logs_hc_payday` rows.
## Tests