package cd.casic.ci.process.process.converter;

import cd.casic.ci.process.dto.req.testCase.TestCaseInfoReq;
import cd.casic.ci.process.dto.resp.testCase.TestCaseInfoResp;
import cd.casic.ci.process.process.dataObject.testCase.TestCaseInfo;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author HopeLi
 * @version v1.0
 * @ClassName PipelineConverter
 * @Date: 2025/5/13 14:39
 * @Description:
 */
@Mapper(componentModel = "spring",nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface TestCaseInfoConverter {
    TestCaseInfoConverter INSTANCE = Mappers.getMapper(TestCaseInfoConverter.class);

    TestCaseInfo toBean(TestCaseInfoReq req);

    List<TestCaseInfoResp> toRespList(List<TestCaseInfo> testCaseInfos);

    TestCaseInfoResp toResp(TestCaseInfo testCaseInfo);

    void updateReqCopyToBean(TestCaseInfoReq req, @MappingTarget TestCaseInfo testCaseInfo);
}
