IAV-1206/feat(faq): Strengthen FAQ Validation and Add Logging on Create/Update
Summary
Improved the FAQ feature by adding input validation, enforcing @Valid
on the update endpoint, and adding structured logging to the service layer.
Changes
FaqRequestDto
- Added
@NotBlankconstraint onfaqCategoryUidfield to ensure a category is always provided on create and update requests
FaqController
- Added
@Validannotation on theFaqRequestDtoparameter ofupdateFaq()to enforce validation on update requests (was already present on create)
FaqServiceImpl
- Added
log.info()increateFaq()to trace incoming question and category - Added
log.info()inupdateFaq()to trace incoming question and category
Type of Change
-
Enhancement / improvement (non-breaking change that improves existing functionality)
How to Test
- Call
PUT /faqs/{faqUid}with a missingfaqCategoryUid→ expect400 Bad Request - Call
POST /faqswith a missingfaqCategoryUid→ expect400 Bad Request - Call
POST /faqswith valid payload → check logs for create trace - Call
PUT /faqs/{faqUid}with valid payload → check logs for update trace
Notes
- No breaking changes to existing API contracts
- Validation is now consistent between create and update endpoints
Related Issues
Closes IAV-1206