app.form_submissions
TableRow level security on
A submitted form: its answers against one template version, score, GPS stamp, signature and approval. Written only through app.submit_form; a project submission links to the record it became.
Primary key: id
| Column | Type | Nullable | Description |
|---|---|---|---|
| id | uuid | No | Primary key, UUID v7. |
| org_id | uuid | No | Owning org, derived from app.form_templates on insert; never accepted from the caller and never changed.References app.organizations.id |
| form_template_id | uuid | No | Form answered.References app.form_templates.id |
| form_template_version_id | uuid | No | Version of the form answered.References app.form_template_versions.id |
| project_id | uuid | Yes | Project the submission belongs to, when any.References app.projects.id |
| record_id | uuid | Yes | Record the project submission became.References app.records.id |
| submitted_by_membership_id | uuid | No | Member who submitted.References app.memberships.id |
| answers | jsonb | No | Answers keyed by field key. |
| score | numeric | Yes | Points earned, when the form scores answers. |
| max_score | numeric | Yes | Points available on the fields shown. |
| passed | boolean | Yes | Whether the score met the passing score; NULL when the form has none. |
| latitude | numeric | Yes | GPS latitude at submission. |
| longitude | numeric | Yes | GPS longitude at submission. |
| accuracy_m | numeric | Yes | GPS accuracy in metres. |
| signer_name | text | Yes | Name of the person who signed. |
| signature_path | text | Yes | Storage path of the signature image in the field-media bucket. |
| signed_at | timestamp with time zone | Yes | When it was signed. |
| submission_state | app.form_submission_state | No | Submitted, Approved, Rejected or Recorded. |
| decided_by_membership_id | uuid | Yes | Approver who decided.References app.memberships.id |
| decision_note | text | Yes | Approver's note. |
| created_at | timestamp with time zone | No | When the row was inserted. Set by the database. |
| created_by | uuid | Yes | Person who inserted the row, or null for a platform process. Set by the database.References app.people.id |
| updated_at | timestamp with time zone | No | When the row last changed. Set by the database. |
| updated_by | uuid | Yes | Person who last changed the row, or null for a platform process. Set by the database.References app.people.id |
| deleted_at | timestamp with time zone | Yes | Soft delete time. A row with deleted_at set is ignored by every access helper. |