🚨 Sanitization and Global Error Handling
To keep the controller code clean fromtry-catch blocks, the application uses a centralized design pattern via @ControllerAdvice.
The GlobalExceptionHandler automatically intercepts any HTTP validation failure or business exception (IllegalArgumentException, IllegalStateException), and transforms them into a standardized JSON response with language support (EN).
📑 Data Validation Contracts (DTO Records)
To ensure that business constraints are met from the very moment data enters the API, the HTTP perimeter uses Javarecords enriched with Jakarta Validation annotations (@NotNull, @Positive).
This acts as a shield that prevents null, empty, or negative financial amounts from reaching the service layer or the database.