package com.eactive.httpmockserver.client.mapper;

import com.eactive.httpmockserver.client.dto.ApiCollectionDTO;
import com.eactive.httpmockserver.client.dto.ApiRequestDTO;
import com.eactive.httpmockserver.client.entity.ApiCollection;
import com.eactive.httpmockserver.client.entity.ApiRequestInfo;
import com.eactive.httpmockserver.common.mapper.CommonMapper;
import com.eactive.httpmockserver.server.mapper.ServerMapper;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.springframework.stereotype.Component;

import java.util.List;


@Mapper(componentModel = "spring",
        uses = {CommonMapper.class, ServerMapper.class},
        unmappedTargetPolicy = ReportingPolicy.IGNORE)
@Component
public interface ApiRequestMapper {
    ApiCollection map(ApiCollectionDTO dto);

    ApiRequestInfo map(ApiRequestDTO dto);


    ApiRequestDTO map(ApiRequestInfo entity);



    List<ApiRequestInfo> mapApis(List<ApiRequestDTO> apis);

    List<ApiCollectionDTO> mapCollections(List<ApiCollection> apis);
}
