-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Objective
Replace remaining Map/ad-hoc response shapes in web controllers with domain response records, keeping domain framework-free and contracts explicit.
Inventory (current Map/ad-hoc usage)
- BaseController: handleServiceException/handleValidationException/createSuccessResponse use Map
- ExceptionResponseBuilder: buildErrorResponse/buildSuccessResponse return Map
- IngestionController: /api/ingest and /api/ingest/local return Map
- CustomErrorController: handleApiError returns Map
Tasks
- Create domain package for ingestion responses (e.g.,
domain/ingestion)- Add
IngestionRunOutcome(fields:status,message) - Add
IngestionLocalOutcome(fields:status,processed,dir) - Add
IngestionErrorResponse(fields:status,message,detailsnullable) - Add sealed interfaces
IngestionResponseandIngestionLocalResponsewith permitted types - Javadoc all public records per JD1–JD8
- Add
- Create domain error response(s) for API errors (e.g.,
domain/errors)- Add
ApiErrorResponse(fields:status,message,detailsnullable) - Add sealed interface
ApiResponseif reused beyond CustomErrorController/BaseController - Ensure no Spring/HTTP imports in domain
- Add
- Refactor ExceptionResponseBuilder to return domain responses
- Replace Map returns with domain response records
- Remove HashMap/Map usage
- Refactor BaseController to use domain responses
- Update method signatures to ResponseEntity of domain response interface
- Refactor IngestionController to return domain responses
- /api/ingest ->
IngestionRunOutcomeon success - /api/ingest/local ->
IngestionLocalOutcomeon success - Validation + IO/runtime errors ->
IngestionErrorResponse - Update method Javadocs to remove Map references
- /api/ingest ->
- Refactor CustomErrorController API path to return domain error response
- Replace
handleApiErrorMap response withApiErrorResponse
- Replace
- Update any tests asserting old Map shapes
- WebMvc/MockMvc tests (if present) should assert new JSON fields
- Verify policy compliance
- No Map<String,Object> in controllers for these paths
- Domain types free of framework imports
- No generic identifiers (ND rules)
Validation
- Run
./gradlew test - If failures, update tests or domain contracts accordingly
Metadata
Metadata
Assignees
Labels
No labels