package com.eactive.eai.rms.onl.apim.apigroup.mapping;

import com.eactive.eai.data.entity.onl.apim.apigroup.ApiGroupApi;
import com.eactive.eai.data.entity.onl.message.EAIMessageEntity;
import com.eactive.eai.data.mapper.BaseMapperConfig;
import com.eactive.eai.data.mapper.GenericMapper;
import com.eactive.eai.rms.onl.apim.apigroup.ui.ApiGroupApiUI;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

@Mapper(config = BaseMapperConfig.class, uses = {})
public interface ApiGroupApiUIMapper extends GenericMapper<ApiGroupApiUI, ApiGroupApi> {
    @Mapping(source = "id.apiGroupId", target = "apiGroupId")
    @Mapping(source = "id.apiId", target = "apiId")
    @Mapping(source = "displayOrder", target = "displayOrder")
    ApiGroupApiUI toVo(ApiGroupApi apiGroupApi);

    @InheritInverseConfiguration
    ApiGroupApi toEntity(ApiGroupApiUI apiGroupApiUI);

    @Mapping(source = "eaibzwkdstcd", target = "bizCode")
    @Mapping(source = "eaisvcname", target = "apiId")
    @Mapping(source = "eaisvcdesc", target = "apiDesc")
    ApiGroupApiUI toVo(EAIMessageEntity eaiMessageEntity);
}
