package com.qsoft.rs.sincoar.dominio.mapper;

import com.qsoft.rs.sincoar.model.Tarmarmas;
import com.qsoft.rs.sincoar.dto.TarmarmasDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface TarmarmasMapper {

    TarmarmasMapper INSTANCE = Mappers.getMapper(TarmarmasMapper.class);
    @Mapping(source = "cregistro", target = "cregistro.cregistro")
    @Mapping(source = "ctipoarmaexplosivo", target = "ctipoarmaexplosivo.ctipoarmaexplosivo")
    @Mapping(source = "tgenecatalogdetail", target = "tgenecatalogdetail.tgenecatalogdetailPK.catalog")
    @Mapping(source = "tgenecatalogdetail1", target = "tgenecatalogdetail1.tgenecatalogdetailPK.catalog")
    @Mapping(source = "tgenecatalogdetail2", target = "tgenecatalogdetail2.tgenecatalogdetailPK.catalog")
    @Mapping(source = "tgenecatalogdetail3", target = "tgenecatalogdetail3.tgenecatalogdetailPK.catalog")
    @Mapping(source = "tgenecatalogdetail4", target = "tgenecatalogdetail4.tgenecatalogdetailPK.catalog")
    @Mapping(source = "tgenecity", target = "tgenecity.tgenecityPK.citycode")
    @Mapping(source = "tgeneparroquia", target = "tgeneparroquia.tgeneparroquiaPK.parroquiacode")
    @Mapping(source = "cpaisorigen", target = "cpaisorigen.countrycode")
    Tarmarmas getEntidad(TarmarmasDTO tarmarmas);
    
    @Mapping(target = "cregistro", source = "cregistro.cregistro")
    @Mapping(target = "ctipoarmaexplosivo", source = "ctipoarmaexplosivo.ctipoarmaexplosivo")
    @Mapping(target = "tgenecatalogdetail", source = "tgenecatalogdetail.tgenecatalogdetailPK.catalog")
    @Mapping(target = "tgenecatalogdetail1", source = "tgenecatalogdetail1.tgenecatalogdetailPK.catalog")
    @Mapping(target = "tgenecatalogdetail2", source = "tgenecatalogdetail2.tgenecatalogdetailPK.catalog")
    @Mapping(target = "tgenecatalogdetail3", source = "tgenecatalogdetail3.tgenecatalogdetailPK.catalog")
    @Mapping(target = "tgenecatalogdetail4", source = "tgenecatalogdetail4.tgenecatalogdetailPK.catalog")
    @Mapping(target = "tgenecity", source = "tgenecity.tgenecityPK.citycode")
    @Mapping(target = "tgeneparroquia", source = "tgeneparroquia.tgeneparroquiaPK.parroquiacode")
    @Mapping(target = "cpaisorigen", source = "cpaisorigen.countrycode")
    TarmarmasDTO getDto(Tarmarmas tarmarmas);

}