ayushcodes27 opened a new pull request, #233:
URL: https://github.com/apache/fineract-consumer-facing/pull/233

   ### What and why
   Validates that `fromAccountId` and `toAccountId` are distinct when 
transferring between savings accounts.
   
   Fixes #232
   
   Currently, `TransfersCommandServiceImpl` allows self-account transfers to 
pass initiate and confirm stages without validation. This PR adds an early 
`requireDistinctAccounts` guard to fail fast during both `initiate` and 
`confirm` with a `TransferSameAccountException` (`400 Bad Request`), preventing 
unnecessary OTP generation and avoiding duplicate debit/credit ledger 
transactions upstream.
   
   - Added `TransferSameAccountException` with code 
`error.msg.consumer.transfers.command.account.same`
   - Added localized translations in `frontend/public/i18n/en.json` and 
`hi.json`
   - Added unit tests in `TransfersCommandServiceImplTest` covering early 
rejection for both `initiate` and `confirm`
   
   ### Verification
   - `./gradlew test --tests 
org.apache.fineract.consumer.transfers.command.service.TransfersCommandServiceImplTest`
 (31/31 passed)
   - `./gradlew test --tests 
org.apache.fineract.consumer.LayeringArchitectureTest` (ArchUnit passed)
   - `./gradlew spotbugsMain modernizer` (passed)
   - `npm run i18n:check` in `frontend/` (passed)
   
   ### Checklist
   - [x] I did not hand-edit generated files under 
`frontend/src/openapi-client/` or `consumer/build/`.
   - [x] Backend code follows the feature and CQRS layout in `AGENTS.md`.
   - [x] I did not add entries to a lint or architecture baseline 
(suppressions, frozen violations).
   - [x] User-facing strings use translation keys.
   - [x] I added or updated tests appropriate to this change.
   - [x] Commits are signed — see [Signing your 
commits](CONTRIBUTING.md#signing-your-commits) in CONTRIBUTING.md.


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