Switch queue to local label templates

This commit is contained in:
2026-05-07 15:16:24 +02:00
parent 61ea6f7c96
commit 85a2766256
19 changed files with 1021 additions and 520 deletions
+20 -9
View File
@@ -1,29 +1,40 @@
CREATE TABLE IF NOT EXISTS label_print_queue (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
layout_key VARCHAR(100) NOT NULL,
barcode_template_id INT(11) NOT NULL,
payload_json JSON NOT NULL,
status ENUM('pending','printing','printed','error','deleted') NOT NULL DEFAULT 'pending',
reserved_number BIGINT NULL,
number_reserved_at DATETIME NULL,
number_printed_at DATETIME NULL,
status ENUM('pending','number_reserved','printing','printed','error','deleted') NOT NULL DEFAULT 'pending',
printer_name VARCHAR(255) NULL,
attempts INT NOT NULL DEFAULT 0,
error_message TEXT NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
locked_at DATETIME NULL,
printed_at DATETIME NULL,
INDEX idx_label_print_queue_status_created (status, created_at),
INDEX idx_label_print_queue_layout_key (layout_key)
INDEX idx_label_print_queue_barcode_template_id (barcode_template_id),
CONSTRAINT fk_label_print_queue_barcode_template
FOREIGN KEY (barcode_template_id)
REFERENCES barcode_templates(Id)
);
INSERT INTO label_print_queue
(layout_key, payload_json, status)
(barcode_template_id, payload_json, status)
VALUES
(
'dymo_57x32_standard',
1,
JSON_OBJECT(
'titel', 'Beleg privat',
'beschreibung', 'Dokument 2026-000123',
'nummer', '2026-000123',
'datum', '2026-05-07',
'qr', 'bjoernprivat 0000123'
'beschreibung', 'Tankbeleg',
'datum', '2026-05-07'
),
'pending'
);