Templates contract update: field layout and PDF upload#598
Merged
marcvergees merged 2 commits intoJul 1, 2026
Conversation
…h with PDF registry
…ore template registry
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.
Templates contract update: field layout and PDF upload
What changed
layoutblock: page, x, y, width, height, and text settings (font, size, color, align).POST /api/v1/templates/pdfto upload the blank PDF before a template is created.canonicaltoincident_mappingto match naming used elsewhere.static_textfor fixed labels that do not come from incident data.Why layout is nested in the field
The old contract described a field's meaning but not where its value prints on the form. The website editor is visual: the user draws a box on the PDF and it records the box corners. That position data had nowhere to live.
Nesting
layoutkeeps a field's meaning and its position in one record, so the two never have to be matched back up after fields are added, removed, or reordered.Why upload is a separate step
Box coordinates only make sense against a real PDF, so the PDF has to exist first. The flow is: upload PDF, editor renders pages, user draws boxes, then create the template with those coordinates. The upload returns a file reference and each page size in PDF points, which the editor needs to align its canvas.
Keeping upload out of template creation lets create stay plain JSON and lets file storage change later without touching it.
NOTE: This PR is consisting of only the api contracts for review and building the service is out of this PR's scope
Part of: #549 and #541