package org.qinan.safetyeval.app.change.convertor;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.qinan.safetyeval.client.change.request.QualFilingMaterialChangeAddCmd;
import org.qinan.safetyeval.client.change.request.QualFilingMaterialChangeUpdateCmd;
import org.qinan.safetyeval.client.co.QualFilingMaterialCO;
import org.qinan.safetyeval.domain.change.model.QualFilingMaterialChangeE;
import org.qinan.safetyeval.domain.entity.QualFilingMaterialEntity;

import java.util.List;

/**
 * 备案申请材料-变更转换
 *
 * @Author: ltq
 * @date 2026-07-02 10:04:07
 */
@Mapper(componentModel = "spring")
public interface QualFilingMaterialChangeCmdConvertor {
    /**
     * cmd_add转领域模型
     *
     * @param qualFilingMaterialChangeAddCmd
     * @return
     */
    @Mapping(target = "qualFilingMaterialChangeGateway", ignore = true)
    QualFilingMaterialChangeE convertCmdToE(QualFilingMaterialChangeAddCmd qualFilingMaterialChangeAddCmd);

    /**
     * cmd_update转领域模型
     *
     * @param qualFilingMaterialChangeUpdateCmd
     * @return
     */
    @Mapping(target = "qualFilingMaterialChangeGateway", ignore = true)
    QualFilingMaterialChangeE convertCmdToE(QualFilingMaterialChangeUpdateCmd qualFilingMaterialChangeUpdateCmd);

    /**
     * 变更材料转材料实体
     */
    @Mapping(target = "id", ignore = true)
    @Mapping(target = "filingId", ignore = true)
    @Mapping(target = "tenantId", ignore = true)
    @Mapping(target = "orgId", ignore = true)
    QualFilingMaterialEntity convertChangeEToEntity(QualFilingMaterialChangeE changeE);

    /**
     * 批量转换
     */
    List<QualFilingMaterialEntity> convertChangeEListToEntityList(List<QualFilingMaterialChangeE> changeEs);

    /**
     * 变更材料转材料CO
     */
    QualFilingMaterialCO convertChangeEToCO(QualFilingMaterialChangeE changeE);

    /**
     * 批量转换变更材料为CO
     */
    List<QualFilingMaterialCO> convertChangeEListToCOList(List<QualFilingMaterialChangeE> changeEs);
}
