PAR-179
0
/firm sales toggle <firm> + real-time sale notifications (on FirmNotificationService)
PlannedNormalUnassignedBusinessFeature
Part of PAR-175 (firm sales commands). Parity with legacy /pb sales toggle <firm> + the chestshop-(buy|sale)-notify broadcasts.
When a ChestShop sale completes for a firm-owned shop, notify the firm's online staff in-game (e.g. "Steve bought 64x Cobblestone for $128 at Costco"), toggleable per firm.
Build on existing infra (verified):
- Recipients/sending:
net.democracycraft.business.services.FirmNotificationService(PAR-94, shipped) —notifyFirm(int firmId, String messageKey, Object... placeholders)/notifyFirmExcept(int firmId, UUID excluded, …), backed byFirmStaffService.getOnlineEmployees(...). Add abusiness.notify.sale.*message block. - Trigger (the one real prerequisite): there is currently no Bukkit event or callback business-rian can subscribe to for a sale — ChestShop-3's
MarketListener.onTransactioncallsMarketApi.recordSalebut re-publishes nothing. This issue must first add a sale hook: either a new Bukkit event fired fromMarketListener(carrying firmId/item/qty/price/customer) or a Treasury sale-feed callback. Resolveshop_firm_id→ firm for routing. Do not poll the DB like the legacy plugin. - Toggle state: persist a per-firm flag. Preferred home is the existing
firm_propertieskey-value table (firm_id, key, value, type, deleted_at) via a small service wrapper — avoids afirmtable migration +Firmmodel/mapper change. Owner-gated toggle command (hibernia@Route("sales toggle <firm>")).
Spam control (better than legacy): batch/rate-limit bursts (a busy shop can sell many times/min) — coalesce into a periodic digest or throttle per shop; cadence configurable.
Access: owner/admin for the toggle. Depends on: PAR-94 (done) + the new sale hook above.
Resources
- PR#2 Last major release ParadauxIO/hibernia-economy
- commita2d99ae Harden new sales/chat surfaces (post-port audit fixes)ParadauxIO/hibernia-economy
- commitba92f76 Real-time firm sale notifications with digest throttle (PAR-179)ParadauxIO/hibernia-economy
Comments
No comments yet.
Activity
- ParadauxIO linked a pull request — PR #2 open — Last major release
- ParadauxIO linked a pull request — PR #2 open — Last major release
- ParadauxIO linked a pull request — PR #2 open — Last major release
- ParadauxIO linked a pull request — PR #2 open — Last major release
- ParadauxIO linked a pull request — PR #2 open — Last major release
- ParadauxIO linked a pull request — PR #2 open — Last major release
- ParadauxIO linked a pull request — PR #2 open — Last major release
- ParadauxIO linked a commit — Commit a2d99ae — Harden new sales/chat surfaces (post-port audit fixes)
- ParadauxIO linked a commit — Commit ba92f76 — Real-time firm sale notifications with digest throttle (PAR-179)
- tesks description: Description updated
- tesks changed status to Status → Planned
- tesks created the issue