Skip to content

Corrections, readiness and validation - Extraction Layer #631

Description

@chetanr25

Corrections, readiness and validation

Parent issue: #551
Blocker issue: #627, #628, #629

The review-screen paths. A responder corrects fields, and the screen needs to know which templates are ready to generate and what blocks the rest. All of these read or write the incident document, no new storage.

Scope

  • PATCH /api/v1/extract/{extract_id}: a JSON merge patch shaped like the contract. Apply it to the incident document (a null value deletes a field), validate the result, write it back, append the change to the corrections audit trail, and rerun promote. Return the full completed extraction. Handle not-found, a locked extraction after submission, and an invalid value.
  • GET /api/v1/extract/{extract_id}/readiness: for every active template, compare its fields against the contract and report which templates are ready and which fields block the rest. Pure lookup, no model call.
  • POST /api/v1/extract/{extract_id}/validate: the single-template version of readiness, plus human-readable warnings.
  • Tests for a correction, a delete, a lock and an invalid value, and for readiness and validate with a ready and a blocked template.

Contract reference

  • contracts/path/extraction.yaml (edit and validate)
  • contracts/schemas/extraction-record.yaml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions