Skip to content

feat(compliance): add case management with rest - #281

Merged
tiana-code merged 1 commit into
mainfrom
feat/E-04-case-management
Jun 19, 2026
Merged

feat(compliance): add case management with rest#281
tiana-code merged 1 commit into
mainfrom
feat/E-04-case-management

Conversation

@tiana-code

Copy link
Copy Markdown
Owner

E-04 Compliance #268 - the case-management vertical, mirroring the KYC vertical.

What

  • ComplianceCaseService (interface+impl, @transactional in impl only): open (OPEN), get, claim (OPEN->CLAIMED), resolve (->RESOLVED), escalate (->ESCALATED), list(status) - all through the domain transitionTo guard; repository + a pure ComplianceCasePersistenceAdapter (value-class id<->UUID), same shape as KycServiceImpl.
  • CaseController (/v1/compliance/cases): POST open (compliance:write, 201+Location), GET ?status= (read, bounded - status required), GET /{id}, POST /{id}/claim|resolve|escalate (write). Thin; String path -> ComplianceCaseId.fromString; hand CaseApiMapper.
  • SecurityConfig: adds GET /v1/compliance/** = compliance:read, mutating = compliance:write (after the KYC rules, before anyRequest - fails closed).
  • ProblemType / GlobalExceptionHandler: KYC_CONFLICT -> COMPLIANCE_CONFLICT (the domain exception is shared by KYC + cases; same 409), added CASE_NOT_FOUND (404) and a MethodArgumentTypeMismatchException handler so a bad ?status= returns 400 (was 500).

Decisions (umbrella drift documented)

Domain CaseStatus (CLAIMED) wins over the OpenAPI IN_REVIEW; cursor pagination, decision/reason capture and alert/payment/kyc links are deferred follow-ups. Idempotency-Key on open is deferred (consistent with KYC #277).

Gate chain

  • critic: GO-WITH-CHANGES (atomic ProblemType rename keeping KYC_NOT_FOUND; CaseControllerTest scope-order assertions - applied).
  • security-auditor (opus): PASS - authz fails-closed (401/403 asserted, no fall-through), §5.3 clean, rename keeps 409, list bounded.
  • code-reviewer: the bad-status 500->400 fix + value-class test robustness adopted; the adapter-as-port HIGH declined with evidence (mirrors merged KycServiceImpl/PaymentServiceImpl; store-port rejected in F-04.5 KYC orchestration service + REST #265).
  • evaluator: PASS (0.86).
    All local gates green (@WebMvcTest + @DataJpaTest slice-scoped; the KYC F-04.5b KYC REST + security + OpenAPI #275 tests stayed green after the rename).

Closes #268

Add the compliance case lifecycle: open a case, list by status, read
one, and the guarded claim, resolve and escalate transitions, exposed
under /v1/compliance/cases with compliance read and write scopes and
RFC 7807 errors. The service mirrors the KYC vertical (repository plus a
hand mapper, transitions in one transaction through the domain guard).
The shared conflict problem type is generalised since the domain
exception is raised by both KYC and cases, and a bad status filter now
returns 400 rather than 500.

Closes #268
@tiana-code tiana-code added this to the v0.3.0 milestone Jun 19, 2026
@tiana-code
tiana-code merged commit 5060907 into main Jun 19, 2026
8 checks passed
@tiana-code
tiana-code deleted the feat/E-04-case-management branch June 19, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

F-04.8 Compliance case management + REST

1 participant