Skip to content

Rework form generation around incidents and templates#620

Open
chetanr25 wants to merge 1 commit into
fireform-core:development-approach-cfrom
chetanr25:form_api_contract_update
Open

Rework form generation around incidents and templates#620
chetanr25 wants to merge 1 commit into
fireform-core:development-approach-cfrom
chetanr25:form_api_contract_update

Conversation

@chetanr25

Copy link
Copy Markdown
Collaborator

Rework form generation around incidents and templates

Why

Form generation was still built around a single extraction and a closed list of form types, from before templates were user-registered and before extraction started producing a stored incident. Two separate endpoints for one form versus all forms did not make sense once generation is just a lookup, not an LLM call.

What changed

  • generate/all and generate/{form_type} are now one POST /forms/generate, taking an incident_id and a list of template_ids. Leaving template_ids out generates everything the readiness matrix reports as ready.
  • Generation reads from incident_id, since the contract document now lives on the incident row rather than the extraction.
  • Generation stays a pure lookup and draw, no LLM, so a whole batch finishes in seconds regardless of how many templates are requested.
  • Templates that are not ready are skipped with a reason instead of failing the whole request, unless force_partial is set.
  • Single-form and batch responses now share the same FormRecord shape.
  • Added GET /forms/batch/{batch_id}/download to pull a batch as one archive.

Reference

Discussion: #609.
Related Issue: #619

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.

1 participant