Build [v1.5.0] - Box Management & Label Printing

This commit is contained in:
Daniel Bedeleanu
2026-04-12 21:30:50 +03:00
parent e383b97d44
commit 2e5c666cc8
18 changed files with 1007 additions and 336 deletions

View File

@@ -28,10 +28,10 @@ A unified system to maintain an inventory of "items" and their quantities, inclu
- **Servers:** Frontend (`npm run dev` on 3000), Backend (`./start_server.sh` on 8000)
## 3. Data Models & Entities
- **Item:** Name, Category Group (Structured), Item Type (Specific), Quantity, Barcode, Part Number.
- **Item:** Name, Category Group (Structured), Item Type (Specific), Quantity, Barcode, Part Number, Box Label (Association).
- **Category:** Predefined groups for organizational structure.
- **Intervention:** Linked to a required items list.
- **Audit Log:** Immutable ledger detailing CRUD operations and stock fluctuations.
- **Box/Container:** A generic grouping label (box_label) that links multiple items together for rapid multi-scanning.
- **Audit Log:** Immutable ledger detailing CRUD operations and stock fluctuations, including point-in-time box associations.
## 4. Scanning & Optimization Strategy (Crucial)
### 4.1 AI Usage Policy
@@ -49,6 +49,15 @@ A unified system to maintain an inventory of "items" and their quantities, inclu
- Scoring: Exact S/N (+500), Exact P/N (+200), Token match (+50), Category match (+20).
- Threshold: Minimum **40 points** for auto-match without user intervention.
### 4.3 Box Labeling & Printing System (v1.5.0)
- **Local OCR Priority:** Before checking individual S/Ns, the matching engine searches for `box_label` tokens. If a box is identified:
- Single Match: Directly opens stock adjustment.
- Multi Match: Opens "Box Contents" selection interstitial.
- **Label Generation:** Native SVG-based Code 128 and QR generation (`lib/labels.ts`). Requires ZERO external libraries for maximum offline stability.
- **Printing Modes:**
- @media print: Hardcoded CSS styles for 62mm x 29mm label dimensions.
- Mobile Export: Canvas-to-PNG rasterization for sharing with Bluetooth printer roll apps.
## 5. Offline Sync Protocol
To prevent data loss in basements or unstable networks: