Files
query-orchestration/internal/document/batch
Jay Brown b71a28d3c0 Merged in feature/support-more-types (pull request #219)
support new types for import

* tests pass

* missing file

* bug fixes
2026-03-31 17:40:42 +00:00
..
2025-08-05 07:03:35 -07:00

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 (storeEventRunnerdocInitRunner → etc.).

Files

  • service.go - Main batch service implementation with CRUD operations
  • service_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.