feat(kyc): add review workflow and liveness webhook support (V2)
Summary This MR introduces the next KYC backend increment (V2) by adding a complete review workflow and liveness flow integration while keeping existing APIs backward-compatible.
What was added
1) Review workflow
- Investor endpoint to submit a KYC dossier for review with required confirmations.
- Admin endpoint to submit review decisions with checklist payload.
- Admin endpoint to retrieve review details by
kycId. - Transactional finalization of review data (status/reviewer/reviewedAt consistency).
2) Liveness workflow
- Investor endpoint to start liveness for a KYC dossier.
- Webhook endpoint to apply provider callbacks:
POST /api/v1/webhooks/kyc/liveness/{provider}
- Basic idempotence guard to safely handle duplicate callbacks.
- Validation to reject provider/session inconsistencies.
3) Persistence and service layer
- Added repositories:
KycReviewRepositoryLivenessCheckRepository
- Added service contracts and implementations:
-
KycReviewService,KycReviewServiceImpl -
KycLivenessService,KycLivenessServiceImpl
-
4) Tests
- Added unit tests for core business logic:
KycReviewServiceImplTestKycLivenessServiceImplTest
- Updated controller web-slice test wiring to include newly introduced services.
5) Documentation
- Updated
CHANGELOG.mdwith the new V2 scope and validation scenarios.
Validation
- Local build and test run completed successfully (
mvn test). - Manual API scenarios can be executed in Postman for:
- review submission
- review decision
- liveness start
- webhook callback + duplicate callback behavior
Backward compatibility
- Existing endpoints remain unchanged.
- New capabilities are additive (non-breaking).