Skip to content

Requirements: Phase 2 — Multi-Template Printing

When a bulk print request contains items with different template sizes, the system shall group items by their resolved template and produce one PDF per group. A failure in one group shall not prevent other groups from completing.

Traces to: SAC::PRINT::FR-0001, SAC::PRINT::FR-0004, #575

REQ-P2-002: Parallel rendering with concurrency limit

Section titled “REQ-P2-002: Parallel rendering with concurrency limit”

Template groups within a single bulk print request shall be rendered in parallel, up to a configurable maximum concurrency limit (maxParallelRenders). This limit is a system configuration value.

Traces to: SAC::PRINT::FR-0002

The bulk print response shall contain:

  • job: UUID identifying the print request
  • asOF: Bitemporal timestamp
  • results: Array with one entry per template group, each containing:
    • templateId: The Documint template ID
    • description: Template description (e.g., “3 x 5”)
    • url: PDF URL on success, null on failure
    • error: Error description on failure, null on success
    • itemCount: Number of items in the group

When a request resolves to a single template group (the common case), the response still uses the composite shape.

Traces to: SAC::PRINT::FR-0003, goal.md § Desired Changes

When a template group contains more items than the per-call limit (maxItemsPerCall), the system shall split it into sequential sub-batches. Each sub-batch produces a separate PDF and a separate entry in the results array.

Traces to: SAC::PRINT::FR-0007, SAC::PRINT::FR-0008, #519

The system shall enforce a maximum total items per user print request (maxItemsPerRequest). Requests exceeding this limit shall be rejected before any Documint calls with a descriptive error indicating the limit and the number of items requested.

Traces to: SAC::PRINT::FR-0009, SAC::PRINT::FR-0010, #519

The following configuration values shall be added to the item and kanban module configurations:

KeyTypeDefaultDescription
printing.maxItemsPerDocumintRequestInt40Maximum items in a single Documint API call
printing.maxItemsPerRequestInt200Maximum total items in a single user print request
printing.maxParallelRendersInt3Maximum concurrent Documint calls per request

These are system configuration values, not user-configurable.

Traces to: SAC::PRINT::FR-0002, SAC::PRINT::FR-0007, SAC::PRINT::FR-0010

REQ-P2-007: Frontend handles composite response

Section titled “REQ-P2-007: Frontend handles composite response”

The frontend shall handle the new composite response shape:

  • Open one new browser tab per successfully returned PDF URL
  • Display an error toast notification for each template group that failed, identifying the template description and error message
  • Maintain backward compatibility: if the response contains a single url field (legacy shape from other callers), handle it as before

Traces to: SAC::PRINT::FR-0005, SAC::PRINT::FR-0006

REQ-P2-008: Card print status updates for multi-template batches

Section titled “REQ-P2-008: Card print status updates for multi-template batches”

When a bulk card print request produces multiple template groups, the system shall update print status (PRINTED) only for cards in groups that rendered successfully. Cards in failed groups shall retain their previous print status.

Traces to: SAC::PRINT::FR-0011, SAC::PRINT::FR-0004

The same-size bulk print path (all items resolve to one template) shall continue to work. The composite response is used for all bulk requests regardless of whether grouping occurs.

The following design documents shall be updated to reflect the multi-template architecture:


Copyright: (c) Arda Systems 2025-2026, All rights reserved