-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Description
π Description
Currently, FireForm requires users to upload a PDF via the API every session before they can fill any form. There is no persistent template storage β PDFs are saved to arbitrary paths and referenced by absolute path in the database.
This is a significant usability gap. In real operational use, a fire department uses the same 2β3 PDF templates repeatedly. Requiring re-upload every time creates unnecessary friction and is the root cause of the stale path bug.
π‘ Rationale
Introducing a structured directory convention solves multiple problems simultaneously:
- Eliminates repeated PDF uploads for known agency templates
- Enables batch multi-template filling β one transcript can fill Police, Fire, and Ambulance PDFs simultaneously
- Fixes stale absolute path bug β relative paths from project root are stable across machines
- Enables department profile system β profiles map departments to their pre-loaded templates
- Onboarding β gives new contributors a clear, documented place to add their own fillable PDFs
π οΈ Proposed Solution
Introduce the following directory structure:
src/
templates/ β pre-stored fillable PDF templates
fire_dept.pdf
ambulance.pdf
police.pdf
outputs/ β generated filled PDFs (gitignored)
fire_dept_john_smith_2026-03-12.pdf
ambulance_john_smith_2026-03-12.pdf
API changes:
POST /templates/registerβ registers a PDF already present insrc/templates/by filename, no upload requiredPOST /templates/uploadβ existing endpoint preserved for backwards compatibility- Template DB records store relative path:
src/templates/fire_dept.pdf
Documentation changes:
SETUP.mdβ new section: "Adding your own PDF templates"README.mdβ updated project structure diagram
β Acceptance Criteria
-
src/templates/directory created with at least one sample fillable PDF -
src/outputs/directory created with.gitkeepand added to.gitignore -
POST /templates/registerendpoint added - Template DB records use relative paths
-
SETUP.mddocuments how to add templates for new contributors - Batch filling ([FEAT]: Missing Batch Endpoint for Multi-Form FilingΒ #156) can reference templates by filename without upload
π Additional Context
- Prerequisite for properly implementing batch multi-template filling ([FEAT]: Missing Batch Endpoint for Multi-Form FilingΒ #156)
- Resolves stale path bug described in Issue ([BUG]: Stale template records cause 500 errors after re-clone or file moveΒ #235 )
- Aligns with department profile system ([FEAT]: Department Profile System for Pre-Mapped PDF TemplatesΒ #206)
- No breaking changes β existing upload flow preserved
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels