KRYSTALM7 commented on code in PR #174: URL: https://github.com/apache/fineract-loan-origination/pull/174#discussion_r4404175770
########## src/main/java/org/apache/fineract/los/domain/LoanApplication.java: ########## @@ -55,7 +56,12 @@ * writer — preventing silent data corruption. */ @Entity -@Table(name = "loan_application") +@Table( + name = "loan_application", + uniqueConstraints = + @UniqueConstraint( + name = "uk_loan_application_tenant_fineract_loan_id", Review Comment: @priyam99 The unique constraint is a useful safeguard, but please handle the failure path in `DisbursementBridgeService.createLoan()`. The external Fineract loan may already have been created when saving the application fails due to a duplicate ID. A retry must not create another external loan or leave the first loan orphaned. Please add appropriate failure/reconciliation handling and a regression test verifying that a retry does not invoke loan creation again. -- 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]
