Aman-Mittal opened a new issue, #773:
URL: https://github.com/apache/fineract-backoffice-ui/issues/773
## Summary
The transactions tab of a Working Capital loan is a read-only table. A
mistaken repayment cannot be reversed, and a transaction's details (allocation,
GL postings, external id) cannot be viewed.
## Evidence (`main` @ `8da1086f`)
`src/app/core/adapters/api/api-surface.json` lists
`getWorkingCapitalLoansLoanIdTransactions` and
`postWorkingCapitalLoansLoanIdTransactions` only. It has no single-transaction
`GET` and no `POST …/transactions/{transactionId}` command call.
## Platform support
- `GET /v1/working-capital-loans/{loanId}/transactions/{transactionId}` (and
the external-id variants) returns one transaction with its allocation.
- `POST
/v1/working-capital-loans/{loanId}/transactions/{transactionId}?command=undo`
reverses a transaction.
- `command=adjust` exists on newer Fineract builds (`develop`).
Feature-detect it, or hide it when the backend answers
`error.msg.query.parameter.value.unsupported`.
## Proposed implementation
- Make transaction rows clickable. They should open a transaction detail
view showing amount, date, type, allocation (principal / fee / penalty),
external id and reversal state.
- Add **Undo** on the detail view. It should be destructive-confirmed and
offered only for non-reversed, reversible types.
- Add **Adjust** (edit amount and date) only where the backend supports it.
- Render reversed transactions struck through **and** with a text marker for
screen readers, matching regular loans.
## RBAC
| Action | Permission code | Typically granted to |
|---|---|---|
| View transaction | `READ_WORKINGCAPITALLOAN` | all lending roles, auditors
|
| Undo transaction | `UNDO_WORKINGCAPITALLOANTRANSACTION` | branch manager /
operations supervisor |
| Approve queued undo | `UNDO_WORKINGCAPITALLOANTRANSACTION_CHECKER` | a
second supervisor (maker-checker) |
| Adjust transaction | the adjust code shipped with the backend version that
supports it | operations supervisor |
Reversals change customer balances after the fact. The UI must not let a
teller who holds only `REPAYMENT_WORKINGCAPITALLOAN` reverse their own entries.
### How Fineract evaluates these permissions
- A write passes with the exact code **or** `ALL_FUNCTIONS`. Reads pass with
`ALL_FUNCTIONS_READ`.
- Maker-checker queues the undo for a `_CHECKER` holder.
- Codes are in `scripts/permission-codes.json`.
### UI expectations
- Guard the detail route with `READ_WORKINGCAPITALLOAN`.
- Gate the Undo / Adjust buttons with `[appRequiresPermission]`.
- A read-only user can open the detail view but sees no enabled Undo.
## Acceptance criteria
- [ ] A transaction row opens a detail view.
- [ ] Undo reverses the transaction, the row is marked reversed, and the
balances refresh.
- [ ] Adjust is only shown when supported.
- [ ] Undo is gated on `UNDO_WORKINGCAPITALLOANTRANSACTION`, and a
maker-checker response is surfaced.
- [ ] Unit tests cover the detail fetch, the undo payload and the gating.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]