# tallyflow-print Review

**Tech Stack:** Rust (Cargo)

## Purpose
Backend print service for TallyFlow Print. Handles label generation, RFID encoding, print job queuing/orchestration, and optional registration of printed assets into TallyFlow Core.

## Current Capabilities (post git pull - Jun 2026)
- Label config system with templates (simple_text, simple_text_2_5x1_25, datamatrix, etc.) and field_registry
- Parent/child label support
- Category names on tags
- orgsettings integration from TallyFlow
- Printing queue with enhanced orchestration and worker logic
- API endpoints for job submission and status
- Windows installation scripts and release support
- Updates to simple tag printing including RFID

## Key Components
- **api**: Main API service (port 8040)
- **orchestrator**: Proxies categories/zones and runs "print then register" flows (port 8041)
- **printing**: Core label generation and ZPL handling
- **worker**: Pulls jobs and sends to Zebra printers (raw TCP 9100)
- **label_configs**: Template definitions and manifest
- **web**: Web interface elements

## Architecture (from USER_GUIDE)
Operator → TallyFlow Print app → Print API → Print worker → Zebra printer
                    └── (optional) Orchestrator → TallyFlow Core

## Relevance
- Backend for the TallyFlow Print ingestion method (new tag assignment + optional data association)
- Works alongside tallyflow-print-ui (Flutter frontend)
- Supports all tag ingestion paths that involve printing/encoding

*Last updated: 2026-06-05 by Hermes Agent (after git pull using hermes_agent_ed25519 key)*
## Recent Changes (Jun 17, 2026 pull)
**Major theme:** GS1-128 / Case Label support + FSMA204 label templates + Windows reliability

**Key additions:**
- New `printing/src/gs1_trade_item.rs` for GS1 handling
- New `docs/CUSTOM_LABEL.md` documentation
- New FSMA204 300dpi label config + sample ZPL template
- Support for multiple case types (0=each, 1-8=fixed qty, 9=variable)
- GTIN-14 now treated as case label (starts with '1')
- Bug fix: GS1-128 serial AI (21) now properly included
- Voice pick algorithm correction (CRC-16)
- Enhanced Windows install/bundle scripts

**Files changed:** 29 files, +1249 insertions

*Last updated: 2026-06-17 by Hermes Agent (after git pull using hermes_agent_ed25519 key)*


## Enhancement Suggestions (from clarification - Jun 2026)
**RFID Encoding Scope**
- Currently limited to EPC memory bank only
- Suggested: Add support for TID, User Memory banks
- Suggested: Add password protection / lock bits support

**Serialization & Numbering**
- Currently customer-managed via policy (different starting serials per printer instance)
- Suggested improvement: Allow per-printer serial number **range configuration** in Settings
- Range should **wrap around** when the end is reached
- Local serial tracking + increment already exists

**Multi-Printer & Orchestration**
- UI already supports multiple printers
- Core returns error on duplicate asset registration attempts (good safeguard)

*Source: Direct clarification from Todd B*

## Roadmap / Integration Opportunities
- **Mobile (Assets) integration** for Scan-and-Print workflows — Allow the mobile app to trigger print jobs (e.g., reprint, on-demand encoding during field scans or enrollment). Closes the gap between mobile asset management and the Print pillar.
- **IoT integration** — Expose print job status/events and printer health to TallyFlow IoT for unified dashboards and alerts.
