package com.neusoft.smart.pos.dto.printer.redis;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * 打印机redis结构
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class PrinterBean {
    
    private Long id;
    
    private Integer orgId;
    
    private Integer shopId;
    
    private Long parentId;
    
    private String printerSn;
    
    private String printerName;
    
    private String printerIp;
    
    private String printerPort;
    
    private String printerType;
    
    private String deviceType;
    
    private String printerStatus;
    
    List<PrinterBean> linkedPrinters = new ArrayList<>();
    
    List<PrintRuleBean> printerRules = new ArrayList<>();
    
    PrinterTemplateBean printerTemplate;
    
    List<PrinterGoodsBean> printerGoods = new ArrayList<>();
    
    @Data
    public static class PrintRuleBean {
        
        private Long id;
        
        private String ruleName;
        
        private String beanName;
        
        private String description;
        
        private String isEnable;
        
        List<PrintRuleAttributeBean> ruleAttributes = new ArrayList<>();
    }
    
    @Data
    public static class PrintRuleAttributeBean {
        
        private Long id;
        
        private Long ruleId;
        
        private Long printerRuleId;
        
        private Long attributeId;
        
        private Long attributeValue;
    }
    
    @Data
    public static class PrinterTemplateBean {
        
        private Long id;
        
        private String templateName;
        
        private String beanName;
        
        private String description;
        
        private String templateType;
        
        private String isEnable;
    }
    
    @Data
    public static class PrinterGoodsBean {
        
        private Long id;
        
        private Long printerId;
        
        private Integer relationshipId;
        
        private String relationshipType;
    }
    
    
}