IAV-691/Enhance exception handling with centralized error codes
Summary
This MR introduces a centralized business error code system for the iavia-agent-service-customer-care microservice, improving traceability, consistency, and maintainability of exception handling.
Changes
New Components
| Component | Description |
|---|---|
BusinessErrorCode enum |
Centralized error codes following CUSTOMER-CARE-SERVICE-NNN pattern |
BusinessErrorCodeTest |
Unit tests ensuring code uniqueness, range compliance, and message quality |
Refactored Layers
-
Helpers:
AgentCreationHelper,AgentValidationHelper,UserHelper,WebhookHelper -
Inter-service communication:
FileManagerServiceImpl,N8nServiceImpl,UserServiceImpl - Business services: All service implementations updated
Alignment
This implementation aligns with the exception management improvements made in mc-starter.
Testing
-
✅ All error codes validated for uniqueness -
✅ Code format validated against patternCUSTOMER-CARE-SERVICE-\d{3}$ -
✅ Code numbers validated within assigned category ranges -
✅ Messages validated for quality (uniqueness, formatting, minimum length)
Related
Closes IAV-691