Paradaux

PAR-177

0

/firm sales <firm> [page] — paginated in-game sales list

PlannedNormalUnassignedBusinessFeature

Part of PAR-175 (firm sales commands). Parity with legacy /pb sales <firm> [page], richer.

In-game paginated list of a firm's ChestShop sales, newest first, reading chestshop_sale via the sales-query API (PAR-176). business-rian has no sales command today.

Command mechanism (verified): add to a command class (FirmCommands or a new SalesCommands) using the hibernia-framework pattern — @Command on the class, @Route("sales <firm> [page]") + @Permission(...) + @Async on the method, @Sender Player, @Arg("firm") FirmName (resolved by FirmNameResolver). Resolve the firm via FirmService.getFirmByNameOrId(...) (returns active firms only; null → "firm not found"). Keep the entrypoint thin → call a service → the PAR-176 read API (don't touch a mapper from the command, per CLAUDE.md layering).

Row (better than legacy's time/player/sold|bought/amount×item/price): time, direction, customer name, qty, item name (custom-aware item_name), unit + total price, tax, optionally location. Page length ~10 (config).

Access (verified): the firm role-permission enum is net.democracycraft.business.model.RolePermission with values ADMIN, FINANCIAL, CHESTSHOP, DEFAULT — there is no dedicated "view sales" perm, so gate on FINANCIAL (or ADMIN) via StaffApi.hasPermissionForAccount(...), plus business.admin. Tab-complete firm names the sender can view.

Drop legacy quirks: the "viewed/strikethrough" state, the per-sender command lock, and the 35-tick "still loading" warning were workarounds for the slow Olzie DB; the indexed chestshop_sale query doesn't need them.

Depends on: PAR-176 read API.

Resources

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 970f294 — Add /firm sales list + summary commands (PAR-177, PAR-178)
  • ParadauxIO linked a commit — Commit 493cf60 — Add sales-query read API over chestshop_sale (PAR-176)
  • tesks description: Description updated
  • tesks changed status to Status → Planned
  • tesks created the issue