Paradaux
0

Expose a firm's total balance in the business plugin API

Expose a firm's total balance (summed across its accounts) in the public business plugin API.

Technical notesbusiness-api's FirmApi/StaffApi expose no balance accessor; the logic already exists internally as FirmTransactionService.getAggregateBalance(firmId) (sum over FirmAccountsMapper.listAccountsByFirm via treasury.getBalanceByAccountId). Add BigDecimal getTotalBalance(int firmId) (+ formatted variant) to FirmApi, implement in FirmApiDelegate by delegating to FirmTransactionService (inject it into BusinessApiImpl). Prerequisite for PAR-57.

Comments

tesks · Jun 4, 2026, 9:56 AM

Code contextbusiness-api's FirmApi/StaffApi expose no balance accessor; the logic already exists internally as FirmTransactionService.getAggregateBalance(firmId) (sum over FirmAccountsMapper.listAccountsByFirm via treasury.getBalanceByAccountId).

Approach: add BigDecimal getTotalBalance(int firmId) (+ a formatted variant) to FirmApi, implement in FirmApiDelegate by delegating to FirmTransactionService (inject it into BusinessApiImpl). Prerequisite for PAR-57 (the PAPI placeholder consumes this).

tesks · Jun 5, 2026, 11:17 AM

Shipped on develop (commit 8d9588b).

Added to FirmApi (the business-api public surface):

  • BigDecimal getTotalBalance(int firmId)
  • String getFormattedTotalBalance(int firmId) (Treasury-formatted)

Both sum across all of a firm's treasury accounts, delegating to the existing FirmTransactionService.getAggregateBalance / getFormattedAggregateBalance (now injected into the FirmApiDelegate). Throws IllegalStateException if the firm has no accounts, documented on the interface.

This unblocks the PAPI expansion in PAR-57. Delegate tests added; coverage gate green.

Activity

  • ParadauxIO linked a commit — Commit 8d9588b — Expose firm total balance in the public BusinessApi (PAR-22)Jun 7, 2026, 2:49 PM
  • ParadauxIO changed status to Status → DoneJun 7, 2026, 2:49 PM
  • ParadauxIO linked a pull request — PR #6 merged — Release: develop → mainJun 7, 2026, 2:49 PM
  • ParadauxIO linked a pull request — PR #6 open — Release: develop → mainJun 7, 2026, 12:36 AM
  • ParadauxIO linked a pull request — PR #6 open — Release: develop → mainJun 6, 2026, 11:49 PM
  • ParadauxIO linked a pull request — PR #6 open — Release: develop → mainJun 6, 2026, 12:44 PM
  • ParadauxIO linked a pull request — PR #6 open — Release: develop → mainJun 6, 2026, 11:17 AM
  • ParadauxIO linked a pull request — PR #6 open — Release: develop → mainJun 6, 2026, 11:11 AM
  • ParadauxIO linked a pull request — PR #6 open — Release: develop → mainJun 5, 2026, 12:35 PM
  • tesks commentedJun 5, 2026, 11:17 AM
  • tesks changed status to Status → Pending ReleaseJun 5, 2026, 11:16 AM
  • ParadauxIO linked a commit — Commit 8d9588b — Expose firm total balance in the public BusinessApi (PAR-22)Jun 5, 2026, 11:16 AM
  • tesks description: Description updatedJun 4, 2026, 10:01 AM
  • tesks commentedJun 4, 2026, 9:56 AM
  • tesks assigned Assigned to rianJun 4, 2026, 9:27 AM