PAR-175
[Epic] In-game firm sales commands (/firm sales …) over Treasury chestshop_sale — replace PlayerBusinesses sales feature
Goal
Reproduce — and improve on — the legacy PlayerBusinesses (playerbusinesses-dbrecode) in-game sales command family, reading Treasury's authoritative chestshop_sale table instead of the legacy plugin's thin SaleEntry store. business-rian has no sales commands today.
What the legacy plugin does (parity target)
/pb sales <firm> [page](playerbusinesses.sales.use) — paginated in-game sales list:%time% %player% sold/bought %amount%x %item% for %price% at %firm%; marks entries "viewed" (strikethrough once seen). Owner/staff/admin only./pb sales toggle <firm>(playerbusinesses.sales.toggle) — toggle real-time sale notifications to firm staff (chestshop-(buy|sale)-notify); persisted astransactions_toggled_sales. Owner only./pb sales export <firm> <days>(playerbusinesses.sales.export) — export N days of sales to a Hastebin URL; capmax-sales-export-days: 30;sales-expire: 60prunes old rows.
Legacy SaleEntry stores only: material string, price, amount, bought/sold flag, viewed flag, time, player name.
Why "better" is mostly already in the data
Treasury's chestshop_sale (V6) already captures everything legacy did plus: direction (BUY/SELL), customer_uuid, unit_price + total_price, tax_amount, custom-item-aware item_key/item_name/item_data, world+sign_x/y/z, post-trade shop_stock, and a ledger txn_id link. It's indexed by firm/owner/time/item/customer. So the new commands surface richer rows, real aggregates, and proper custom items — no new capture work, just a read path + commands.
Sub-issues
- PAR-176 — Sales-query read API over
chestshop_sale(Treasury API) — the enabler - PAR-177 —
/firm sales <firm> [page]— paginated list (Business) - PAR-178 —
/firm sales summary <firm> [days]— aggregate report, new (Business) - PAR-179 —
/firm sales toggle <firm>+ real-time notifications on PAR-94 (Business) - PAR-180 —
/firm sales export <firm> <days>— explorer deep link / signed CSV, not Hastebin (Business) - PAR-181 — personal
/salesfor a player's own chestshops — scope extension, optional (Treasury)
Build order
- PAR-176 read API first (everything depends on it).
- PAR-177 list + PAR-178 summary (the core value).
- PAR-179 notifications (on the done
FirmNotificationService, PAR-94) + PAR-180 export. - PAR-181 personal sales last.
Data substrate shared with PAR-166 (chestshop market spin-out) / PAR-116 (public market REST). Notifications build on PAR-94 (done).
Resources
- commit493cf60 Add sales-query read API over chestshop_sale (PAR-176)ParadauxIO/hibernia-economy
Comments
No comments yet.
Activity
- ParadauxIO linked a commit — Commit 493cf60 — Add sales-query read API over chestshop_sale (PAR-176)
- tesks changed status to Status → Planned
- tesks description: Description updated
- tesks created the issue