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.
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.
Code context —
business-api'sFirmApi/StaffApiexpose no balance accessor; the logic already exists internally asFirmTransactionService.getAggregateBalance(firmId)(sum overFirmAccountsMapper.listAccountsByFirmviatreasury.getBalanceByAccountId).Approach: add
BigDecimal getTotalBalance(int firmId)(+ a formatted variant) toFirmApi, implement inFirmApiDelegateby delegating toFirmTransactionService(inject it intoBusinessApiImpl). Prerequisite for PAR-57 (the PAPI placeholder consumes this).