Skip to content

IAV-1206/feat(faq): Strengthen FAQ Validation and Add Logging on Create/Update

salaheddine zidani a demandé de fusionner feature/IAV-1206 vers develop

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 @NotBlank constraint on faqCategoryUid field to ensure a category is always provided on create and update requests

FaqController

  • Added @Valid annotation on the FaqRequestDto parameter of updateFaq() to enforce validation on update requests (was already present on create)

FaqServiceImpl

  • Added log.info() in createFaq() to trace incoming question and category
  • Added log.info() in updateFaq() to trace incoming question and category

Type of Change

  • Enhancement / improvement (non-breaking change that improves existing functionality)

How to Test

  1. Call PUT /faqs/{faqUid} with a missing faqCategoryUid → expect 400 Bad Request
  2. Call POST /faqs with a missing faqCategoryUid → expect 400 Bad Request
  3. Call POST /faqs with valid payload → check logs for create trace
  4. 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

Rapports de requête de fusion