flow

Bulk Upload Site Images

Accept N site-visit photos as one AT-E1 request, return 202, persist SiteImage records, and poll operation status on the ui row.

FlowStatus: Implemented in api-v1

Overview

This flow is the only construction-management write path in api-v1 today. HTTP 202 means accepted. The Airtable script treats 202 as success-of-submit and exits under the automation budget. The server continues, then writes terminal success / error on ui_site_images_bulk_upload and script_log.

N is a use-case concern. There is no SiteImageBatch aggregate.

During the Airtable persistence phase, a construction project may have a blank domain_id. The AT-E1 script writes a UUID once before POST. The API resolves projects by domain_id only.

Construction script_log.status is singleLineText. Canonical AT-A helpers write { name: status } for singleSelect. Construction scripts and the Node scriptLog adapter write a bare string.

HTTP

  • Queue: POST /api/v1/construction/site-images/actions/bulk-upload — OpenAPI operationId queueBulkUploadSiteImages
  • Poll: GET /api/v1/construction/operations/:operationId — OpenAPI operationId getSiteImageBulkUploadOperation

Do not invent other operation ids. Do not copy request/response schemas here; use generated OpenAPI.

Code References

  • apps/api-v1/src/modules/construction-management/core/application/use-cases/QueueBulkUploadSiteImagesUseCase.ts
  • apps/api-v1/src/modules/construction-management/core/application/use-cases/GetSiteImageBulkUploadOperationUseCase.ts
  • apps/api-v1/src/modules/construction-management/adapters/inbound/rest/site-images/siteImages.openapi.ts
  • apps/api-v1/src/modules/construction-management/adapters/outbound/persistence/airtable/AirtableSiteImageRepository.ts