55 lines
1.2 KiB
TypeScript
55 lines
1.2 KiB
TypeScript
import {
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Column,
|
|
Index,
|
|
CreateDateColumn,
|
|
} from 'typeorm';
|
|
|
|
@Entity('label_print_jobs')
|
|
export class LabelPrintJob {
|
|
@PrimaryGeneratedColumn()
|
|
Id!: number;
|
|
|
|
@Index()
|
|
@Column({ type: 'varchar', length: 20, default: 'pending' })
|
|
Status!: 'pending' | 'printed' | 'error';
|
|
|
|
@Column({ type: 'mediumblob', nullable: true })
|
|
LabelImageData!: Buffer | null;
|
|
|
|
@Column({ type: 'int' })
|
|
LabelWidthMm!: number;
|
|
|
|
@Column({ type: 'int' })
|
|
LabelHeightMm!: number;
|
|
|
|
@Column({ type: 'int', nullable: true })
|
|
BarcodeTemplateId!: number | null;
|
|
|
|
@Column({ type: 'simple-json', nullable: true })
|
|
LabelVariables!: Record<string, string> | null;
|
|
|
|
@Index()
|
|
@Column({ type: 'datetime', nullable: true })
|
|
LockedAt!: Date | null;
|
|
|
|
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
LockedByAgent!: string | null;
|
|
|
|
@Column({ type: 'datetime', nullable: true })
|
|
PrintedAt!: Date | null;
|
|
|
|
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
PrintedByAgent!: string | null;
|
|
|
|
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
PrinterName!: string | null;
|
|
|
|
@Column({ type: 'text', nullable: true })
|
|
ErrorMessage!: string | null;
|
|
|
|
@CreateDateColumn()
|
|
CreatedAt!: Date;
|
|
}
|