PAR-22
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 notes — business-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.
Resources
- commit8d9588b Expose firm total balance in the public BusinessApi (PAR-22)MCCitiesNetwork/Business
- PR · merged#6 Release: develop → mainMCCitiesNetwork/Business
Comments
tesks · Jun 4, 2026, 9:56 AM
Code context — business-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)
- ParadauxIO changed status to Status → Done
- ParadauxIO linked a pull request — PR #6 merged — Release: develop → main
- ParadauxIO linked a pull request — PR #6 open — Release: develop → main
- ParadauxIO linked a pull request — PR #6 open — Release: develop → main
- ParadauxIO linked a pull request — PR #6 open — Release: develop → main
- ParadauxIO linked a pull request — PR #6 open — Release: develop → main
- ParadauxIO linked a pull request — PR #6 open — Release: develop → main
- ParadauxIO linked a pull request — PR #6 open — Release: develop → main
- tesks commented
- tesks changed status to Status → Pending Release
- ParadauxIO linked a commit — Commit 8d9588b — Expose firm total balance in the public BusinessApi (PAR-22)
- tesks description: Description updated
- tesks commented
- tesks assigned Assigned to rian