package com.jwipc.supplier.dto;

import com.jwipc.aggregation.annotation.RelationAggregationField;
import com.jwipc.supplier.service.IQualificationService;
import com.jwipc.sys.client.FileClient;
import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.io.Serializable;

/**
 * <p>
 * 供应商资质变更申请明细表
 * </p>
 *
 * @author ZhangJie
 * @since 2024-02-27
 */
@Getter
@Setter
public class SupplierQualificationChangeItemBaseDTO implements Serializable {


    @Serial
    private static final long serialVersionUID = 3575924898517514182L;
    private Long id;

    /**
     * 申请表id
     */
    private Long changeId;

    /**
     * 供应商资质id, t_supplier_qualification 或 供应商资质文件id t_supplier_qualification_file；根据适用场景判断
     */
    private Long qualificationId;
    /**
     * 资质的样例文件
     */
    private Long qualificationFileId;

    /**
     * 资质编码
     */
    private String qualificationCode;

    /**
     * 资质名称
     */
    private String qualificationName;

    /**
     * 原证书编号
     */
    private String qualificationNumber;

    /**
     * 原附件id
     */
    private Long fileId;
    @RelationAggregationField(masterIdField = "fileId", relationIdField = "id", relationNameField = "fileName",
            relationClientClass = FileClient.class, relationMethod = "getFileInfos")
    private String fileName;

    /**
     * 原生效开始日期yyyy-MM-dd
     */
    private String availableStartDate;

    /**
     * 原生效结束日期yyyy——MM-dd
     */
    private String availableEndDate;

    /**
     * 新附件id
     */
    private Long newFileId;
    @RelationAggregationField(masterIdField = "newFileId", relationIdField = "id", relationNameField = "fileName",
            relationClientClass = FileClient.class, relationMethod = "getFileInfos")
    private String newFileName;

    /**
     * 新证书编号
     */
    private String newQualificationNumber;

    /**
     * 新生效开始日期yyyy-MM-dd
     */
    private String newAvailableStartDate;

    /**
     * 新生效结束日期yyyy——MM-dd
     */
    private String newAvailableEndDate;

    /**
     * 备注
     */
    private String remark;
    @RelationAggregationField(masterIdField = "qualificationCode", relationIdField = "code", relationNameField = "version",
            relationClientClass = IQualificationService.class, relationMethod = "findByCodes")
    private String version;
}
