Goal
Add three new printing format options that were deferred during #650 — Update Names to Match Latest Platform Tab. These require new Kotlin enum values in CardSize and LabelSize, protobuf message mappings, and template configuration updates.
Reference
Section titled “Reference”- GitHub Issue — Arda-cards/management#820
- Printing Configuration Spreadsheet
- Analysis comment on #650 — full audit of the Documint Template Mapping sheet
- Operations Repository
- Common Module Repository — dependency of
operations, provided as reference only - Front End Repository
- Management Repository
- UX Component Guidelines
Deferred Items from GitHub Issue #650
Section titled “Deferred Items from GitHub Issue #650”1. X_SMALL for Label
Section titled “1. X_SMALL for Label”- Template:
68791aae43e038a3d3ddf8af - Columns: 1
- Description: 3x1 (Label Printer)
- Requires: Adding
X_SMALLto theLabelSizeenum, protobuf mapping inItemCsvUploadService, and database schema compatibility (enumerationByNamecolumns).
2. X_SMALL for Kanban Card
Section titled “2. X_SMALL for Kanban Card”- Template:
68e84551bde271e6a116e94f - Columns: 1
- Description: Quarter-Index
- Requires: Adding
X_SMALLto theCardSizeenum, protobuf mapping inItemCsvUploadService, and database schema compatibility.
3. LARGE+QR for Kanban Card
Section titled “3. LARGE+QR for Kanban Card”- Template:
690a35cc4d1069adadcc052c - Columns: 1
- Description: 3 x 5 - Large QR Code
- Requires: Deciding on the backend key name (e.g.,
LARGE_QR), adding it to theCardSizeenum, and determining whether this is a size variant or a separate concept.
The goal of this project is to:
- Add additional printing format options to the back-end component (
operations) - Create a detailed specification and acceptance criteria for the front-end to enable the additional format options and create a Github ticket in the
managementrepository with that information, assigned to the userdanmerb(using the/gh-ticketskill). thearda-frontend-apprepository can be consulted for this project but should not be modified as part of this project.
Current State
Section titled “Current State”Backend — operations
Section titled “Backend — operations”Each printing type (card, label, breadcrumb) has a corresponding Kotlin enum with four sizes and a parallel protobuf enum used for CSV upload ingestion.
Domain enums (Printing.kt): CardSize, LabelSize, and BreadcrumbSize — each with SMALL, MEDIUM, LARGE, X_LARGE.
Protobuf enums (item_row.proto): mirror the domain enums with a prefix and an UNSPECIFIED default (e.g., CARD_SIZE_SMALL = 1 … CARD_SIZE_EXTRA_LARGE = 4).
Protobuf → domain mapping (ItemCsvUploadService.kt): extension functions (CardSizeMessage.domain(), etc.) map each protobuf value to its domain counterpart; UNSPECIFIED defaults to MEDIUM.
Template configuration (pdf-templates.json): maps each {type}/{size} to a Documint template ID, column count, description, and default flag. Current entries:
| Type | Size | Description | Columns | Default | Template ID |
|---|---|---|---|---|---|
| label | SMALL | Quarter-Index | 1 | 6841c1d253cae4c4b60dc90c | |
| label | MEDIUM | Half-Index | 1 | ✓ | 68ad11a2d1a29a9243cccb20 |
| label | LARGE | 3x2 (Label Printer) | 1 | 694c089357f8c05f7a9ceeec | |
| label | X_LARGE | Business Card Stock | 2 | 67ad0901dfb47a918976c164 | |
| breadcrumb | SMALL | 3 x 1 (Label Printer) | 1 | 695eb8be226280f110894177 | |
| breadcrumb | MEDIUM | 3 x 2 (Label Printer) | 1 | 695ebd2f226280f11089519f | |
| breadcrumb | LARGE | Business Card Stock | 1 | 67af0a90a2ad294979b80133 | |
| breadcrumb | X_LARGE | Half-Index | 1 | ✓ | 67af0d4ca2ad294979b81954 |
| card | SMALL | Half-Index | 1 | 696087827ad281e7bbdc9348 | |
| card | MEDIUM | Business Card Stock | 2 | 67ab48cbdfb47a918969cdc1 | |
| card | LARGE | 3 x 5 | 1 | ✓ | 68a8d1d5027704369e07e839 |
| card | X_LARGE | 4 x 6 | 1 | 68e8320abde271e6a116ce8d |
Template resolution (PrintTemplates): looks up the requested size in the map; falls back to MEDIUM if the size key is missing.
Frontend — arda-frontend-app
Section titled “Frontend — arda-frontend-app”The frontend defines TypeScript union types (CardSize, LabelSize, BreadcrumbSize) with the same four values and maps them to display labels in constants.ts. Notably, the three new options are already present but commented out:
// cardSizeOptions/{ value: 'X-SMALL', label: 'Quarter-Index' }, // ← deferred/{ value: 'LARGE+QR', label: '3 x 5 - Large QR Code' }, // ← deferred
// labelSizeOptions/{ value: 'X-SMALL', label: '3x1 (Label Printer)' }, // ← deferredThe UI exposes size selection via dropdowns in ItemFormPanel.tsx and editable AG Grid columns in ItemTableAGGrid.tsx. Print actions proxy through Next.js API routes to backend endpoints (/v1/kanban/kanban-card/print-card, /v1/item/item/print-label, /v1/item/item/print-breadcrumb), which return a Documint PDF URL opened in a new browser tab.
Size mappers in ardaMappers.ts convert API response strings to the frontend union types.
Requirements
Section titled “Requirements”Enum Extension
Section titled “Enum Extension”- REQ-EPO-001:
CardSize,LabelSize, andBreadcrumbSizedomain enums must each includeX_SMALL,SMALL,MEDIUM,LARGE,X_LARGE, andSPECIAL_01throughSPECIAL_10(15 values total). - REQ-EPO-002: Protobuf enums must mirror the domain enums with a type prefix and an
UNSPECIFIED = 0default value. New field numbers must be appended after existing values to maintain wire compatibility.
Value Mapping
Section titled “Value Mapping”- REQ-EPO-003:
X_SMALLmaps to the template configuration defined in the spreadsheet for each category. - REQ-EPO-004:
LARGE+QR(from the original spreadsheet) maps toSPECIAL_01forCard. - REQ-EPO-005: All other
SPECIAL_NNvalues map to the default template configuration for their category.
Template Configuration
Section titled “Template Configuration”- REQ-EPO-006:
pdf-templates.jsonmust contain a template entry for every enum value in every category (45 entries total: 15 per category). - REQ-EPO-007: Each template entry must include
template(Documint ID),columns,description,default(boolean), andactive(boolean). - REQ-EPO-008: Template resolution must fall back to
MEDIUMwhen the requested size is missing. Theactiveflag must not affect backend template resolution.
CSV Upload
Section titled “CSV Upload”- REQ-EPO-009: Protobuf-to-domain mapping functions must handle all new protobuf values.
UNSPECIFIEDmust continue to default toMEDIUM. - REQ-EPO-010: CSV upload must accept the
Size of Templatedisplay names from the spreadsheet as aliases for enum values (e.g., “Quarter-Index” →X_SMALLfor Card).
Data Compatibility
Section titled “Data Compatibility”- REQ-EPO-011: Existing database rows with
SMALL,MEDIUM,LARGE, orX_LARGEmust continue to deserialize correctly viaenumerationByNamewithout schema migration.
Spreadsheet
Section titled “Spreadsheet”- REQ-EPO-012: A new versioned sheet
Documint Template Mapping (YYYYMMDD)must be created with all existing rows plusSPECIAL_01throughSPECIAL_10for each category, anActiveboolean column, and aNotescolumn. - REQ-EPO-013: The
LARGE+QRrow must not appear in the new sheet; its values are carried intoSPECIAL_01for Card.
Frontend (delivered as ticket)
Section titled “Frontend (delivered as ticket)”- REQ-EPO-014:
cardSizeOptions,labelSizeOptions, andbreadcrumbSizeOptionsmust include all enum values with display names from the spreadsheet. Non-compliant values (e.g.,X-SMALLhyphenated) must be reconciled to underscore form (X_SMALL). - REQ-EPO-015: Each size option must include an
enabledproperty sourced from the spreadsheetActivecolumn. Onlyenabledoptions are selectable in the UI; disabled options are visible but not selectable. - REQ-EPO-016: Size selection must be encapsulated in a reusable React component following the UX Component Guidelines. The array of size options is determined at design time; specific mappings at mount time.
Technical Specification
Section titled “Technical Specification”To support the requirements above, the system will implement:
Additional Printing Format Options (REQ-EPO-001, REQ-EPO-002)
Section titled “Additional Printing Format Options (REQ-EPO-001, REQ-EPO-002)”Each of Card, Label and Breadcrumb will add:
X_SMALLSPECIAL_01throughSPECIAL_10
Value Mapping (REQ-EPO-003, REQ-EPO-004, REQ-EPO-005)
Section titled “Value Mapping (REQ-EPO-003, REQ-EPO-004, REQ-EPO-005)”X_SMALLwill follow the mapping in the spreadsheet.LARGE+QRwill map toSPECIAL_01forCard- All other values for
SPECIAL_**will be mapped to theDefaultvalue in the spreadsheet.
Changes to the Spreadsheet (REQ-EPO-012, REQ-EPO-013)
Section titled “Changes to the Spreadsheet (REQ-EPO-012, REQ-EPO-013)”The spreadsheet will be updated to add a new Sheet called Documint Template Mapping (YYYYMMDD) with YYYYMMDD the date in which the spreadsheet is updated. The new sheet will be a copy of the Documint Template Mapping (20260129) sheet with the following changes:
- Add the new Values of
SPECIAL_01throughSPECIAL_10to each category (card, breadcrumb, label). - The
LARGE+QRrow will be removed once its values are copied into theSPECIAL_01row for thecard. - The other values for
SPECIAL_NNwill be copied from the correspondingDefaultrow for each category. - An additional column called
Activewith typeBooleanwill be added to the spreadsheet. Current Rows (X_SMALL through X_LARGE for all categories plusSPECIAL_01forcard) should betruethe rest should befalse.
Backend Changes (REQ-EPO-006 through REQ-EPO-011)
Section titled “Backend Changes (REQ-EPO-006 through REQ-EPO-011)”- Extend the Enum to all values.
- Update the Protobuf mapping to all values.
- Update the Template mapping to all values and populate them from the spreadsheet. Include the
Activeflag in the template configuration to keep backend data complete for future use. - The CSV upload should accept the new values and also provide aliases based on the
Size of Templatecolumn in the spreadsheet. - Verify that existing items with
SMALL/MEDIUM/LARGE/X_LARGEcontinue to deserialize correctly (enumerationByNamestores string names, so no schema migration is expected — confirm at implementation time).
Frontend Changes (REQ-EPO-014, REQ-EPO-015, REQ-EPO-016)
Section titled “Frontend Changes (REQ-EPO-014, REQ-EPO-015, REQ-EPO-016)”- Extend the cardSizeOptions with all values from this specification. Reconcile non-compliant values (i.e.
X-SMALL). Update it with information from the spreadsheet. - Add an
enabledproperty to each of the options with the values from the spreadsheet. - Wherever possible, encapsulate all the behavior of the options in a single React Component following the UX Component Guidelines. The Array of size options should be determined at design time, the specific mappings of each option should be determined at mount time.
Acceptance Criteria
Section titled “Acceptance Criteria”Spreadsheet
Section titled “Spreadsheet”- New sheet
Documint Template Mapping (YYYYMMDD)created withX_SMALLandSPECIAL_01throughSPECIAL_10rows for each category. LARGE+QRvalues copied intoSPECIAL_01forcard; originalLARGE+QRrow removed.- Remaining
SPECIAL_NNrows populated with default template values for their category. Activeboolean column added;trueforX_SMALLthroughX_LARGE(all categories) andSPECIAL_01(card only);falsefor all otherSPECIAL_NNrows.
Backend (operations)
Section titled “Backend (operations)”X_SMALLandSPECIAL_01throughSPECIAL_10added toCardSize,LabelSize, andBreadcrumbSizedomain enums inPrinting.kt.- Corresponding protobuf enum values added to
item_row.protowith sequential field numbers. - Protobuf → domain mapping functions in
ItemCsvUploadService.ktupdated for all new values. - CSV upload accepts aliases based on the
Size of Templatecolumn from the spreadsheet. pdf-templates.jsonupdated with all new entries, template IDs, column counts, andactiveflag matching the spreadsheet.PrintTemplatesfallback behavior unchanged — missing/unrecognized sizes still default toMEDIUM. Theactiveflag is stored in configuration for future use but does not affect backend template resolution.- Existing items with
SMALL/MEDIUM/LARGE/X_LARGEcontinue to deserialize and print correctly. make clean buildpasses with no test failures.- Code coverage meets or exceeds the targets configured in the Gradle build scripts.
- CHANGELOG updated.
Frontend (specification for arda-frontend-app — delivered as a GitHub ticket)
Section titled “Frontend (specification for arda-frontend-app — delivered as a GitHub ticket)”cardSizeOptions,labelSizeOptions, andbreadcrumbSizeOptionsextended with all new values;X-SMALL(hyphenated) reconciled toX_SMALL.- Each size option includes an
enabledproperty sourced from the spreadsheetActivecolumn. The frontend uses this as the filter for selectable options (backend serves all templates regardless ofactivestatus). - Size selection UI encapsulated in a reusable React component following the UX Component Guidelines.
- Only
enabledoptions are selectable in dropdowns; disabled options are visible but not selectable. - Code coverage meets or exceeds the targets configured in the npm build scripts.
- GitHub ticket created in
Arda-cards/management, assigned todanmerb, with full specification and acceptance criteria.
System Integration
Section titled “System Integration”- An item with
cardSize = X_SMALLprints a PDF using the Quarter-Index template (68e84551bde271e6a116e94f). - An item with
labelSize = X_SMALLprints a PDF using the 3x1 Label Printer template (68791aae43e038a3d3ddf8af). - An item with
cardSize = SPECIAL_01prints a PDF using the 3 x 5 - Large QR Code template (690a35cc4d1069adadcc052c). - CSV upload with
X_SMALLandSPECIAL_01values (and their aliases) ingests correctly and maps to the expected domain values.
Copyright: © Arda Systems 2025-2026, All rights reserved