feat: implement backend label print agent system for remote label rendering and job management
Build and Push Multi-Platform Images / build-and-push (push) Successful in 33s

This commit is contained in:
2026-05-07 22:46:29 +02:00
parent 0c94e7b999
commit 80f862a0c0
15 changed files with 995 additions and 15 deletions
@@ -2,6 +2,17 @@ import api from './client';
export type BarcodeActionType = 'SEND_TO_PAPERLESS' | 'SEND_BY_EMAIL';
export interface LabelInputField {
name: string;
label: string;
type: 'text' | 'number' | 'date';
}
export type LabelElement =
| { type: 'text'; content: string; x: number; y: number; fontSize: number; bold?: boolean; align?: 'left' | 'center' | 'right'; maxWidth?: number }
| { type: 'qr'; content: string; x: number; y: number; sizeMm: number }
| { type: 'line'; x1: number; y1: number; x2: number; y2: number; lineWidth?: number };
export interface BarcodeTemplate {
Id: number;
Name: string;
@@ -9,6 +20,14 @@ export interface BarcodeTemplate {
SplitBefore: boolean;
DateinameTemplate: string | null;
Actions: BarcodeActionType[];
LabelEnabled: boolean;
LabelWidthMm: number | null;
LabelHeightMm: number | null;
LabelInputFields: LabelInputField[] | null;
LabelGetUrl: string | null;
LabelPrintedUrl: string | null;
LabelReleaseUrl: string | null;
LabelLayout: LabelElement[] | null;
CreatedAt: string;
UpdatedAt: string;
}
@@ -19,6 +38,14 @@ export interface BarcodeTemplateInput {
SplitBefore: boolean;
DateinameTemplate?: string | null;
Actions: BarcodeActionType[];
LabelEnabled?: boolean;
LabelWidthMm?: number | null;
LabelHeightMm?: number | null;
LabelInputFields?: LabelInputField[] | null;
LabelGetUrl?: string | null;
LabelPrintedUrl?: string | null;
LabelReleaseUrl?: string | null;
LabelLayout?: LabelElement[] | null;
}
export const BARCODE_ACTION_LABELS: Record<BarcodeActionType, string> = {
@@ -0,0 +1,8 @@
import api from './client';
export const labelPrintAgentApi = {
createJob: (templateId: number, fieldValues: Record<string, string>) =>
api
.post<{ jobId: string }>('/api/label-print-agent/jobs', { templateId, fieldValues })
.then((r) => r.data),
};