package com.erp.print.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.Builder;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("printer")
public class Printer {

    @TableId(type = IdType.AUTO)
    private Long id;

    /** 打印机编码 */
    private String printerCode;

    /** 打印机名称 */
    private String printerName;

    /** 打印机类型: laser/inkjet/thermal */
    private String printerType;

    /** 连接方式: usb/parallel/serial/network */
    private String connectionType;

    /** IP地址(网络打印机) */
    private String ipAddress;

    /** 端口 */
    private Integer port;

    /** 物理地址/MAC */
    private String macAddress;

    /** 驱动名称 */
    private String driverName;

    /** 纸张尺寸: A4/A5/58mm/80mm/custom */
    private String paperSize;

    /** 状态: 0-离线 1-在线 2-忙碌 3-错误 */
    private Integer status;

    /** 打印机描述 */
    private String description;

    /** 仓库ID(关联仓库) */
    private Long warehouseId;

    /** 仓库名称 */
    private String warehouseName;

    /** 是否默认: 0-否 1-是 */
    private Integer isDefault;

    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;

    @TableLogic
    private Integer deleted;
}
