Add a field catalog and finish the template PDF flow#622
Open
chetanr25 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a field catalog and finish the template PDF flow
Why
Setting up a template meant mapping its fields to the incident contract, but there was no way to search the contract for the right field, and the PDF upload flow had no step to review a detection draft or get the source file back. The template schema file also needed room for a few new concepts: per-field sources, layout, and the mapping suggestions.
What changed
GET /schema/fields, a search endpoint over the flattened incident contract (path, type, section, aliases, PII flag), generated from the contract itself so it never drifts out of sync. This backs the mapping picker in the template editor and the auto-suggestions shown after field detection.GET /templates/{template_id}/pdfto fetch a template's original source PDF.GET /templates/pdf/{upload_id}to review a field-detection draft before registering it as a template.template_field_detectionjob type to the shared job schemas.template.yamlin place, keeping its filename so the existing references from the template paths stay valid, to carryFieldSourceper field, the field layout, and the mapping suggestions the field catalog produces.Reference
Discussion: #609.
Related issue: #621