FINERACT-2455: Working Capital loan mark as fraud#6133
Conversation
993bd03 to
ddf3982
Compare
| @Produces({ MediaType.APPLICATION_JSON }) | ||
| @Operation(operationId = "markWorkingCapitalLoanAsFraud", summary = "Mark or unmark a Working Capital Loan as fraudulent", description = "Flags the loan as fraudulent. When the loan is later charged off, a fraudulent loan is routed to the charge-off fraud expense account instead of the regular charge-off expense account. Does not change the loan status.") | ||
| @RequestBody(required = true, content = @Content(schema = @Schema(implementation = MarkWorkingCapitalLoanAsFraudRequest.class))) | ||
| @ApiResponses({ |
There was a problem hiding this comment.
@ ApiResponses(
Use ApiResponse( only or use multiple ApiResponse annotation in case of multiple
| public List<GetWorkingCapitalLoansLoanIdOriginatorData> originators; | ||
| @Schema(description = "Fraud flag. Placeholder: null until the WCP fraud feature is implemented") | ||
| @Schema(description = "Fraud flag. True when the loan has been marked as fraudulent via the mark-as-fraud command; " | ||
| + "a charged-off fraudulent loan is routed to the charge-off fraud expense account", example = "false") |
ddf3982 to
69877ca
Compare
galovics
left a comment
There was a problem hiding this comment.
This routes a sensitive flag change through Fineract's brand-new typed command framework instead of the legacy command-source pipeline every other WC command uses.
WorkingCapitalLoanApiResource.java:
// Permission code = <action>_<entity>. The new command framework does not enforce per-command permissions,
// so the mark-as-fraud endpoint checks it explicitly to keep parity with the legacy authorization model.Auth is handled explicitly here so that's fine, but I checked the framework's own docs (fineract-doc/.../command/audit.adoc is literally TBD, and refactoring.adoc says maker-checker "will be part of a separate proposal") - this command gets no audit trail and no maker-checker, unlike every other WC command in this whole epic which goes through the legacy pipeline and gets both for free. Marking a loan fraudulent seems exactly like the kind of action you'd want an audit trail on. Is it worth waiting for command-audit to land before routing this one through the new framework, or is that an accepted tradeoff?
Minor: the PR also adds a full new charge-off.adoc doc chapter describing the general (non-WC) Loan Charge-Off feature. Reasonable context to set up the "Fraud Charge-Off" section, but it's documenting a whole pre-existing shared feature, not really "Working Capital loan mark as fraud" - could've been its own doc PR.
69877ca to
ae9cd13
Compare
PR updated to use legacy command handler |
0a53a14 to
db913e9
Compare
db913e9 to
64c692f
Compare
Description
Adds a mark-as-fraud command to the Working Capital Loan module, mirroring the Term Loan fraud flag. A loan can be flagged/unflagged as fraudulent
PUT /v1/working-capital-loans/{loanId}/mark-as-fraudwith body{"fraud": true}@Retry) and write serviceis_fraudcolumn +SETFRAUD_WORKINGCAPITALLOANpermissionfraud; feature documented infineract-docFINERACT-2455
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.