Files
invyone/frontend/types/barcode.ts
T

87 lines
1.9 KiB
TypeScript

/**
* 바코드 라벨 관리 시스템 타입 정의
* ZD421 등 바코드 프린터 연동용 라벨 템플릿/출력 관리
*/
// 캔버스 요소 (디자이너용)
export interface BarcodeLabelComponent {
id: string;
type: "text" | "barcode" | "image" | "line" | "rectangle";
x: number;
y: number;
width: number;
height: number;
z_index: number;
content?: string;
font_size?: number;
font_color?: string;
font_weight?: string;
barcode_type?: string;
barcode_value?: string;
show_barcode_text?: boolean;
image_url?: string;
object_fit?: string;
line_color?: string;
line_width?: number;
background_color?: string;
}
export interface BarcodeLabelLayout {
width_mm: number;
height_mm: number;
components: BarcodeLabelComponent[];
}
// 바코드 라벨 마스터 (목록/카드용)
export interface BarcodeLabelMaster {
label_id: string;
label_name_kor: string;
label_name_eng: string | null;
description: string | null;
width_mm?: number;
height_mm?: number;
layout_json?: string | null;
template_type?: string;
use_yn: string;
created_at: string;
created_by: string | null;
updated_at: string | null;
updated_by: string | null;
}
// 목록 조회 응답
export interface GetBarcodeLabelsResponse {
items: BarcodeLabelMaster[];
total: number;
page: number;
limit: number;
}
// 목록 조회 파라미터
export interface GetBarcodeLabelsParams {
page?: number;
limit?: number;
search_text?: string;
use_yn?: string;
sort_by?: string;
sort_order?: "ASC" | "DESC";
}
// 생성 요청
export interface CreateBarcodeLabelRequest {
label_name_kor: string;
label_name_eng?: string;
description?: string;
template_type?: string;
template_id?: string; // 선택 시 해당 템플릿 레이아웃 적용
}
// 수정 요청
export interface UpdateBarcodeLabelRequest {
label_name_kor?: string;
label_name_eng?: string;
description?: string;
template_type?: string;
use_yn?: string;
}