Async job infrastructure
Part of #541
Depends on: Common schemas (#543 ), DB models (#544), Celery infra (#498)
Contract reference
What needs to happen
Multiple operations in FireForm are async: voice transcription, LLM extraction, form generation, report generation. All of them need a way to queue work, track progress, and let the client poll for status.
Celery setup
- Add Redis container (broker) and Celery worker container to
docker-compose.yml
- Celery app configuration in the backend
- Base task class that auto-creates/updates
Job records in DB on state transitions (queued -> processing -> completed/failed)
Job service
create_job(job_type) - creates a Job record, returns job_id
update_job(job_id, status, progress_percent, result_url, error) - updates job state
get_job(job_id) - returns current job state
Endpoint
GET /api/v1/jobs/{job_id} - Universal job status polling endpoint. Returns status, progress percentage, and result_url when completed. See path/jobs.yaml for all response examples (queued, processing, completed, failed).
Async job infrastructure
Part of #541
Depends on: Common schemas (#543 ), DB models (#544), Celery infra (#498)
Contract reference
path/jobs.yamlschemas/common.yaml#JobandAsyncJobResponseWhat needs to happen
Multiple operations in FireForm are async: voice transcription, LLM extraction, form generation, report generation. All of them need a way to queue work, track progress, and let the client poll for status.
Celery setup
docker-compose.ymlJobrecords in DB on state transitions (queued -> processing -> completed/failed)Job service
create_job(job_type)- creates a Job record, returnsjob_idupdate_job(job_id, status, progress_percent, result_url, error)- updates job stateget_job(job_id)- returns current job stateEndpoint
GET /api/v1/jobs/{job_id}- Universal job status polling endpoint. Returns status, progress percentage, andresult_urlwhen completed. Seepath/jobs.yamlfor all response examples (queued, processing, completed, failed).