a080ca59d8
Implement v2 upload batch cleanup * Implement v2 upload batch cleanup * Merge remote-tracking branch 'origin/main' into jmathison/v2-upload-batch * Address upload batch review feedback * Raise batch worker coverage * Fix batch cleanup review issues Approved-by: Jay Brown
Document Batch Processing
This directory contains the service layer for managing document batch uploads.
Purpose
The batch service provides a business logic layer between the HTTP API handlers and the database repository for batch upload operations. It handles:
- Model Conversion: Translates between OpenAPI-generated types and internal database models
- Business Logic: Encapsulates batch-specific operations (CRUD, progress tracking)
- Data Validation: Manages UUID conversions, JSONB parsing, and nullable type handling
Architecture
HTTP Request → API Handler → Batch Service → Database Repository → PostgreSQL
The service is stateless and synchronous - it does not run background processes. Actual document processing happens through the existing Runner pipeline (storeEventRunner → docInitRunner → etc.).
Files
service.go- Main batch service implementation with CRUD operationsservice_test.go- Unit tests using testcontainers for database integration
Usage
The service is instantiated by API handlers in /api/queryAPI/documents.go to manage batch upload metadata, progress tracking, and status updates.