...
The result is mapped into the Bright-facing BrightInvoice model.
SonWin is a BALANCE-FORWARD ledger: payments are not matched per-invoice.
The "remaining amount" and the payment status are both derived from the running account balance (løbende saldo) as of each invoice line, computed in SQL.
DEV info
When DEV info when running on local machine bypassing the Swagger UI:
...