package com.eactive.eai.rms.onl.loader.layout.mapper;

import org.mapstruct.BeanMapping;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;

import com.eactive.eai.data.entity.onl.transformer.layout.LayoutEntity;
import com.eactive.eai.data.mapper.BaseMapperConfig;
import com.eactive.eai.data.mapper.GenericMapper;
import com.eactive.eai.rms.onl.loader.layout.deploy.LayoutDeploy;

@Mapper(config = BaseMapperConfig.class, uses = { LayoutItemDeployMapper.class })
public interface LayoutDeployMapper extends GenericMapper<LayoutDeploy, LayoutEntity> {

   @Mapping(source = "lastamndhms", target = "lastamndhms", dateFormat = "yyyyMMddHHmmssSS")
   @Mapping(source = "layoutItemEntities", target = "layoutItems")
   LayoutDeploy toVo(LayoutEntity entity);

   @InheritInverseConfiguration(name = "toVo")
   LayoutEntity toEntity(LayoutDeploy vo);

}
