Wallet
This Merge Request focuses on hardening the wallet management logic, aligning infrastructure configurations, and ensuring seamless CI/CD deployment. It transitions the service to an event-driven wallet creation model and standardizes deployment settings.
Key Changes
- Wallet Management & Business Logic Event-Driven Creation: Wallets are no longer created lazily on access. They are now strictly provisioned upon KYC approval via Kafka events, ensuring data consistency.
Currency Standardization: Enforced MAD as the mandatory default currency across all controllers and service layers.
Resilience: Added a GlobalExceptionHandler for standardized JSON error responses and improved KycValidatedKafkaListener with robust logging and validation.
Kafka Fix: Removed hardcoded StringDeserializer to allow the ErrorHandlingDeserializer to correctly process JSON payloads.
- Infrastructure & Port Alignment Service Port Transition: Standardized the service to port 3004 across the entire stack:
Updated application.yml, Dockerfile (EXPOSE), and docker-compose.yml.
Updated Postman collections to reflect the new baseUrl.
CI/CD Build Fixes: Optimized Dockerfile for Kaniko/GitLab CI by fixing context paths (copying directly from root) and ensuring the JAR is correctly retrieved from the target directory.
- API Documentation & Testing Admin Workflow: Provided a new Postman collection (wallet-ledger-service-admin-workflow) covering the full 4-eyes withdrawal process, including Keycloak integration and admin approvals.
Testing Performed Integration: Verified the end-to-end flow from KYC Kafka event to Wallet creation.
Docker/CI: Confirmed that the Docker image builds correctly with the new paths and that the service is reachable on port 3004.
Validation: Tested the GlobalExceptionHandler to ensure clean error mapping for invalid requests.