package org.qinan.safetyeval.domain.change.model;

import cn.hutool.extra.spring.SpringUtil;
import com.alibaba.cola.domain.DomainFactory;
import com.alibaba.cola.domain.Entity;
import com.jjb.saas.framework.domain.model.BaseE;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.qinan.safetyeval.domain.change.gateway.QualFilingPersonnelCertChangeGateway;

import java.time.LocalDateTime;

/**
 * 备案申请人员证书领域模型
 *
 * @Author: ltq
 * @date 2026-07-02 10:04:23
 */
@Data
@Entity
@EqualsAndHashCode(callSuper = true)
public class QualFilingPersonnelCertChangeE extends BaseE {
    private static final long serialVersionUID = 1L;

    /**
     * 备案变更id
     */
    private Long filingChangeId;
    /**
     * 备案人员id
     */
    private Long filingPersonnelId;
    /**
     * 证照名称
     */
    private String certName;
    /**
     * 证书类型编码
     */
    private String certTypeCode;
    /**
     * 证书类型名称
     */
    private String certTypeName;
    /**
     * 证书类别编码
     */
    private String certCategoryCode;
    /**
     * 证书类别名称
     */
    private String certCategoryName;
    /**
     * 证书作业类别编码
     */
    private String operationCategoryCode;
    /**
     * 证书作业类别名称
     */
    private String operationCategoryName;
    /**
     * 证书编号
     */
    private String certNo;
    /**
     * 发证机关
     */
    private String issueOrg;
    /**
     * 证书有效开始日期
     */
    private LocalDateTime validStartDate;
    /**
     * 证书有效结束日期
     */
    private LocalDateTime validEndDate;
    /**
     * 复核日期
     */
    private LocalDateTime reviewDate;
    /**
     * 证书附件地址
     */
    private String certAttachmentUrl;
    /**
     * 来源人员证书id
     */
    private Long sourceCertId;
    /**
     * 环境
     */
    private String env;
    private transient QualFilingPersonnelCertChangeGateway qualFilingPersonnelCertChangeGateway;

    public QualFilingPersonnelCertChangeE() {
        this.qualFilingPersonnelCertChangeGateway = SpringUtil.getBean(QualFilingPersonnelCertChangeGateway.class);
    }

    public static QualFilingPersonnelCertChangeE of() {
        return DomainFactory.create(QualFilingPersonnelCertChangeE.class);
    }

    public boolean add() {
        return qualFilingPersonnelCertChangeGateway.add(this);
    }

    public boolean update() {
        return qualFilingPersonnelCertChangeGateway.update(this);
    }
}
