Model/backlog/tasks/task-1 - Add-POST-bulk-uploads-trigger-splitter-FastAPI-route.md
2026-04-20 13:06:31 +00:00

1.3 KiB

id title status assignee created_date updated_date labels dependencies priority ordinal
TASK-1 Add POST /bulk-uploads/trigger-splitter FastAPI route Done
2026-04-20 2026-04-20 12:31
backend
bulk-upload
api
high 2000

Description

Expose an HTTP route that the frontend can call instead of sending SQS directly. Route:

POST /bulk-uploads/trigger-splitter

Body: {task_id, sub_task_id, s3_uri} — task+subtask already created by frontend /api/tasks call before this is invoked.

Behaviour: validate inputs, then publish an SQS message to the postcode_splitter queue (see backend/postcode_splitter/main.py for expected message shape: {task_id, sub_task_id, s3_uri}). Use existing SubTaskInterface / TasksInterface patterns from backend/app/tasks/router.py.

Place under backend/app/ next to tasks/router.py — likely backend/app/bulk_uploads/router.py.

Acceptance Criteria

  • #1 Route returns 202 with {task_id, sub_task_id}
  • #2 SQS message enqueued with correct shape for postcode_splitter Lambda
  • #3 Auth via existing validate_token dependency
  • #4 Queue URL from config, not hardcoded
  • #5 Unit test with mocked boto3 sqs client