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

import cd.casic.ci.process.dto.req.testCase.TestCaseManagerReq;
import cd.casic.ci.process.dto.resp.testCase.TestCaseManagerResp;
import cd.casic.ci.process.process.dataObject.testCase.TestCaseManager;
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 TestCaseManagerConverter {
    TestCaseManagerConverter INSTANCE = Mappers.getMapper(TestCaseManagerConverter.class);

    TestCaseManager toBean(TestCaseManagerReq req);

    void updateReqCopyToBean(TestCaseManagerReq req, @MappingTarget TestCaseManager testCaseManager);

    List<TestCaseManagerResp> toRespList(List<TestCaseManager> testCaseManagers);

    TestCaseManagerResp toResp(TestCaseManager testCaseManager);
}
