package com.eactive.eai.rms.onl.manage.control.control;

import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;

import com.eactive.eai.data.entity.onl.restrict.RestrictInfo;
import com.eactive.eai.data.entity.onl.restrict.RestrictInfoHistory;
import com.eactive.eai.data.mapper.GenericMapper;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface ControlManMapper extends GenericMapper<ControlManUI, RestrictInfo> {
	@Override
	ControlManUI toVo(RestrictInfo entity);

	@Override
	@InheritInverseConfiguration
	RestrictInfo toEntity(ControlManUI vo);

	@Mapping(target = "eaictrldsticctnt2", source = "eaictrldsticctnt")
    ControlManUI toVo(ControlServiceDto serviceDto);
	
	@Mapping(target = "id.eaictrlname", source = "eaictrlname")
	@Mapping(target = "id.ctrlprcssyms", source = "ctrlprcssyms")
    RestrictInfoHistory toHistoryEntity(RestrictInfo info);
}
