MokuLakshithReddy opened a new pull request, #155: URL: https://github.com/apache/fineract-consumer-facing/pull/155
## Summary Addresses [apache/fineract-consumer-facing#144](https://github.com/apache/fineract-consumer-facing/issues/144) by introducing the command-side BFF capabilities for Savings Account Applications, matching the CQRS architecture implemented for loans (LoansCommandController / LoansCommandServiceImpl). ### Changes 1. **CQRS Command API (org.apache.fineract.consumer.savings.command)**: - POST /api/v1/savings: Submit a new savings account application with required idempotency key, product ID, and submission date. - PUT /api/v1/savings/{savingsId}: Modify a pending savings application with idempotency and ABAC account ownership verification. - POST /api/v1/savings/{savingsId}?command=withdrawnByApplicant: Withdraw a pending savings application with reason note and date. 2. **Domain & DTOs**: - SavingsApplicationCommandData: standard response acknowledgement (savingsId, esourceId, clientId). - SubmitSavingsApplicationCommandRequest & SubmitSavingsApplicationCommand - ModifySavingsApplicationCommandRequest & ModifySavingsApplicationCommand - WithdrawSavingsApplicationCommandRequest & WithdrawSavingsApplicationCommand 3. **ABAC Security & Access Policies**: - Added SAVINGS_APPLICATION_SUBMIT, SAVINGS_APPLICATION_MODIFY, and SAVINGS_APPLICATION_WITHDRAW to ConsumerAction. - Registered corresponding unowned/owned policies in ActionPolicies. 4. **Fineract Feign Client Integration**: - Connected SavingsAccountApi (submitSavingsApplication, updateSavingsAccount, handleCommandsSavingsAccount). - Added schema sanitizers in consumer/build.gradle and ineract.json for withdrawal and modify request parameters. - Automated cache eviction of OwnedAccountsCache upon application submission. 5. **Testing**: - Unit tests in SavingsCommandControllerTest covering request validation, command mapping, and idempotency key enforcement. - Service unit tests in SavingsCommandServiceImplTest validating authorization, idempotency deriver lifecycle, in-progress retries, upstream error translation, and cache eviction. - Policy evaluation tests in AccessPolicyEvaluatorTest. Closes #144 -- 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]
