package cokr.xit.ens.modules.kkoalimtalk.model.struct;

import cokr.xit.ens.core.mapstruct.GenericMapper;
import cokr.xit.ens.core.mapstruct.StructMapperConfig;
import cokr.xit.ens.modules.kkoalimtalk.domain.TmpltMngKkoAlimtalk;
import cokr.xit.ens.modules.kkoalimtalk.model.TmpltMngKkoAlimtalkDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

@Mapper(config = StructMapperConfig.class)
public interface TmpltMngKkoAlimtalkMapper extends GenericMapper<TmpltMngKkoAlimtalkDTO, TmpltMngKkoAlimtalk> {

    @Override
    @Mapping(target = "orgMng.orgCd", source = "orgCd")
    TmpltMngKkoAlimtalk toEntity(TmpltMngKkoAlimtalkDTO tmpltMngKkoAlimtalkDTO);

    @Override
    @Mapping(target = "orgCd", expression = "java(tmpltMngKkoAlimtalk.getOrgMng().getOrgCd())")
    TmpltMngKkoAlimtalkDTO toDto(TmpltMngKkoAlimtalk tmpltMngKkoAlimtalk);
}
