Paradaux
0

Add tax exemption attribute for firms

Tax exemptions aren't visible under the treasury. Make firm tax-exemption a firm attribute that can be tagged rather than configured directly.

Technical notes — the mechanism already exists. A per-firm balance-tax.exempt flag is stored by FirmPropertyService, set via /business tax exempt <firm> <bool> (TaxCommands, perm business.tax.exempt), and honored by FirmBalanceTaxListener.buildFirmCollections (exempt firm → zero collections). The weekly tax cycle is wired and works end-to-end (Treasury fires TaxCycleEvent(WEEKLY), business registers the listener at Business.java:75, non-exempt firms charged via collectBatch).

Remaining gap vs this ask ("not visible under the treasury"): exemption status isn't surfaced in the explorer/treasury views. Recommend narrowing to "surface firm exemption status in the explorer," or verify/close. (Separate tiny follow-up: the listener never calls taxApi.registerCycleParticipant("Business", WEEKLY), so Business doesn't appear in /tax status — observability only.)

Comments

tesks · Jun 4, 2026, 9:24 AM

Code context — this is largely already implemented. A per-firm balance-tax.exempt flag exists: FirmPropertyService.setBoolean, settable via /business tax exempt <firm> <bool> (TaxCommands, perm business.tax.exempt), and FirmBalanceTaxListener.buildFirmCollections honors it (exempt firm → zero collections).

I traced the weekly tax cycle end-to-end and it works: Treasury schedules + fires TaxCycleEvent(WEEKLY) (enabled in config, Treasury.onEnable), business registers the listener (Business.java:75), and non-exempt firms are charged via collectBatch → ledger to DCGovernment.

Remaining gap vs the title ("not visible under the treasury… tag rather than configure"): exemption status isn't surfaced in the explorer/treasury views. Recommend narrowing this to "surface firm exemption status in the explorer," or verify/close. (Tiny separate follow-up spotted: the listener never calls taxApi.registerCycleParticipant("Business", WEEKLY), so Business doesn't appear in /tax status — observability only, collection is unaffected.)

tesks · Jun 4, 2026, 4:59 PM

Done — exemption is now surfaced in the explorer (economy-explorer @ ccaa70b, develop).

Findings on the existing mechanism (verified by code read): exemption is already a tagged firm attribute (firm_properties, key balance-tax.exempt), already honored by the weekly cycle (FirmBalanceTaxListener.buildFirmCollections → exempt firm returns no collections), and already shown in-game via /business tax info ("Exempt"/"Not Exempt"). The only gap was web visibility ("not visible under the treasury").

Change (explorer):

  • findFirmByDisplayName (lib/sql/firm.ts) now reads the flag via a correlated subquery on firm_properties, filtering type='BOOLEAN' and deleted_at IS NULL and parsing 'true' case-insensitively — exactly mirroring FirmPropertyServiceImpl.getBoolean.
  • Firm detail page shows a green "Tax exempt" badge next to the firm name (alongside the Archived badge).
  • Integration schema/seed gain firm_properties, an actively-exempt firm, and a soft-deleted flag on Acme to prove the deleted_at filter. getFirmStats expectations updated for the added firm.

Validated: typecheck + lint + 55 unit tests green. Integration test runs in CI (needs the MariaDB service container; couldn't run locally — no DB creds in this environment).

Deferred follow-up (not done — out of the chosen scope): the listener still never calls taxApi.registerCycleParticipant("Business", WEEKLY), so Business doesn't appear in Treasury's /tax status. Pure observability; worth a small separate ticket if wanted.

tesks · Jun 4, 2026, 9:14 PM

State corrected Pending Release → Done: the firm tax-exemption command/attribute (TaxCommands, FirmBalanceTaxListener, BalanceTaxConfiguration) is shipped — fix commit d260686 is on business main (released), not just develop.

Activity

  • ParadauxIO linked a pull request — PR #9 open — Release economy-explorer → main (perf fixes + 1.1.0 RBAC/RUM)Jun 7, 2026, 7:36 PM
  • ParadauxIO linked a commit — Commit 8c7f786 — Stop release PRs linking/transitioning changelog refs (PAR-132)Jun 7, 2026, 7:18 PM
  • ParadauxIO linked a pull request — PR #9 merged — Release economy-explorer → main (perf fixes + 1.1.0 RBAC/RUM)Jun 7, 2026, 7:14 PM
  • ParadauxIO linked a pull request — PR #9 open — Release economy-explorer → main (perf fixes + 1.1.0 RBAC/RUM)Jun 7, 2026, 7:10 PM
  • ParadauxIO linked a pull request — PR #9 open — Release economy-explorer → main (perf fixes + 1.1.0 RBAC/RUM)Jun 7, 2026, 7:06 PM
  • ParadauxIO linked a commit — Commit e4013c8 — Release economy-explorer 1.1.0 (group RBAC, PAR-46/85/100/106, Faro RUM)Jun 7, 2026, 4:16 PM
  • ParadauxIO linked a commit — Commit ccaa70b — Surface firm balance-tax exemption on the firm view (PAR-46)Jun 7, 2026, 4:16 PM
  • ParadauxIO linked a pull request — PR #8 merged — Release: economy-explorer 1.1.0 (HOLD — needs V10–V12 migrated)Jun 7, 2026, 4:16 PM
  • ParadauxIO linked a pull request — PR #8 open — Release: economy-explorer 1.1.0 (HOLD — needs V10–V12 migrated)Jun 7, 2026, 2:52 PM
  • ParadauxIO linked a pull request — PR #8 open — Release: develop → mainJun 7, 2026, 2:52 PM
  • ParadauxIO linked a commit — Commit e4013c8 — Release economy-explorer 1.1.0 (group RBAC, PAR-46/85/100/106, Faro RUM)Jun 7, 2026, 2:52 PM
  • ParadauxIO linked a pull request — PR #8 open — Release: develop → mainJun 7, 2026, 10:27 AM
  • ParadauxIO linked a pull request — PR #8 open — Release: develop → mainJun 7, 2026, 12:36 AM
  • ParadauxIO linked a pull request — PR #8 open — Release: develop → mainJun 6, 2026, 12:14 PM
  • ParadauxIO linked a pull request — PR #8 open — Release: develop → mainJun 6, 2026, 12:05 PM
  • ParadauxIO linked a pull request — PR #8 open — Release: develop → mainJun 5, 2026, 12:36 PM
  • tesks commentedJun 4, 2026, 9:14 PM
  • tesks changed status to Status → DoneJun 4, 2026, 9:14 PM
  • tesks changed status to Status → Pending ReleaseJun 4, 2026, 5:00 PM
  • tesks commentedJun 4, 2026, 4:59 PM
  • tesks description: Description updatedJun 4, 2026, 10:00 AM
  • tesks commentedJun 4, 2026, 9:24 AM