-
Notifications
You must be signed in to change notification settings - Fork 0
Add Jakarta Bean Validation to request DTOs #38
Copy link
Copy link
Closed
Labels
P0Critical — blocks release or productionCritical — blocks release or productionarea:ledgerLedger service (accounts, transactions, balances)Ledger service (accounts, transactions, balances)effort:S1-4 hours1-4 hourstype:featureNew capability or enhancementNew capability or enhancement
Milestone
Description
Metadata
Metadata
Assignees
Labels
P0Critical — blocks release or productionCritical — blocks release or productionarea:ledgerLedger service (accounts, transactions, balances)Ledger service (accounts, transactions, balances)effort:S1-4 hours1-4 hourstype:featureNew capability or enhancementNew capability or enhancement
Projects
StatusShow more project fields
Done
Context
Request DTOs must carry Jakarta Bean Validation annotations so that Spring's
@Validmechanism rejects structurally invalid input before it reaches the service layer. Common annotations:@NotNull,@NotBlank,@Size,@Patternfor strings;@Positivefor amounts;@NotEmptyfor entry lists. Validation errors are mapped to RFC 7807 400 responses byGlobalExceptionHandler.Acceptance criteria
currencyfields are validated against ISO 4217 pattern (3 uppercase letters).entrieslist has@NotEmptyand@Size(min=2)to enforce the two-entry minimum before hitting the service.amountfields are validated with@Positiveor@DecimalMin(value=0, inclusive=false).@WebMvcTestslice test asserts a missing required field returns 400 with a populatederrors[]array.References
Epic E-01 Ledger Foundation. Wiki: API-Ledger, Code-Rules.
Definition of Done
Tests green; ktlint and detekt clean; coverage target met; reviewed; SPDX header on new files; no maritime or real-provider names.