Aman-Mittal opened a new issue, #503:
URL: https://github.com/apache/fineract-backoffice-ui/issues/503

   ## What is missing
   
   Fineract accepts `chargeback` against an individual loan transaction. It 
reverses a repayment and, where that repayment had closed the loan, reopens it 
— the correction path for a payment applied in error or later dishonoured. This 
app offers no way to invoke it.
   
   Confirmed against a running `apache/fineract`, using the discriminator 
established in #268 — an unrecognised command answers 
`error.msg.query.parameter.value.unsupported` on the `command` parameter, 
exactly as an invented name does:
   
   | Probe | Result |
   |---|---|
   | `POST /loans/{id}/transactions?command=totallyNotACommand` | 
`error.msg.query.parameter.value.unsupported` — **unrecognised** (control) |
   | `POST /loans/{id}/transactions?command=writeoff` | 
`validation.msg.loan.transaction.transactionDate.cannot.be.blank` — 
**recognised** (control, and the app wires this one) |
   | `POST /loans/{id}/transactions?command=chargeback` | 
`error.msg.query.parameter.value.unsupported` — **unrecognised at this level** |
   | `POST /loans/{id}/transactions/{transactionId}?command=chargeback` | 
`validation.msg.loan.transaction.transactionAmount.cannot.be.blank` — 
**recognised** |
   
   That last pair is the important detail: **chargeback is only accepted 
against a specific transaction**, not at loan level. So it does not belong on 
the loan's Actions menu with the other commands — it belongs as a row-level 
action on the Transactions tab, next to the repayment being reversed, which is 
also how a user would think about it.
   
   ## What the UI offers today
   
   Against a real Active loan seeded into a local Fineract stack, the 
Transactions tab's only affordances are the shared Repayment / Actions / Back 
controls — there is no per-row action at all:
   
   ![The Transactions tab of a real Active loan, with no row-level action 
available](https://raw.githubusercontent.com/Aman-Mittal/fineract-backoffice-ui/assets/issue-screenshots/loan-transactions-tab.png)
   
   `grep -rli chargeback src/app` returns nothing outside the generated API 
client. The client method already exists:
   
   ```ts
   loanTransactionsService.postLoansLoanIdTransactionsTransactionId(loanId, 
transactionId, request, 'chargeback')
   ```
   
   The platform permission is `CHARGEBACK_LOAN` (confirmed present in `GET 
/permissions`), so the action can be gated with `appRequiresPermission` like 
every other command on this screen.
   
   ## Suggested scope
   
   A row-level action on the Transactions tab, offered only on rows that can 
actually be charged back (a repayment-type transaction that has not already 
been reversed), collecting `transactionAmount` and a payment type. The request 
body is:
   
   ```ts
   { transactionAmount: number, locale: string, paymentTypeId?: number }
   ```
   
   Fineract ships "Repayment Adjustment: Chargeback" and "Repayment Adjustment: 
Refund" payment types for exactly this.
   
   ## Why it is worth doing
   
   A repayment recorded against the wrong loan, or one whose cheque later 
bounces, has no correction path in this app once it has closed the loan. The 
alternative is editing the platform outside the UI, which leaves the back 
office unable to complete a routine correction on its own.
   
   ## Environment
   
   `main` at `7c51d90b`. Probes against `apache/fineract` running locally via 
`deploy/docker-compose-e2e.yml`; screenshot from a loan seeded with the 
repository's own `e2e/utils/seed-api.ts` helpers.
   


-- 
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]

Reply via email to