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

import com.qsoft.rs.sincoar.dto.TgenesubproductchargesPKDTO;
import com.qsoft.rs.sincoar.model.TgenesubproductchargesPK;
import javax.annotation.processing.Generated;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2022-09-02T16:14:47-0500",
    comments = "version: 1.5.2.Final, compiler: javac, environment: Java 17.0.4 (Private Build)"
)
public class TgenesubproductchargesPKMapperImpl implements TgenesubproductchargesPKMapper {

    @Override
    public TgenesubproductchargesPK getEntidad(TgenesubproductchargesPKDTO tgenesubproductchargesPK) {
        if ( tgenesubproductchargesPK == null ) {
            return null;
        }

        TgenesubproductchargesPK tgenesubproductchargesPK1 = new TgenesubproductchargesPK();

        tgenesubproductchargesPK1.setBalancetype( tgenesubproductchargesPK.getBalancetype() );
        tgenesubproductchargesPK1.setBalancegroup( tgenesubproductchargesPK.getBalancegroup() );
        tgenesubproductchargesPK1.setModulecode( tgenesubproductchargesPK.getModulecode() );
        tgenesubproductchargesPK1.setProductcode( tgenesubproductchargesPK.getProductcode() );
        tgenesubproductchargesPK1.setSubproductcode( tgenesubproductchargesPK.getSubproductcode() );
        tgenesubproductchargesPK1.setStatuscode( tgenesubproductchargesPK.getStatuscode() );
        if ( tgenesubproductchargesPK.getCompanycode() != null ) {
            tgenesubproductchargesPK1.setCompanycode( tgenesubproductchargesPK.getCompanycode() );
        }
        tgenesubproductchargesPK1.setCurrencycode( tgenesubproductchargesPK.getCurrencycode() );
        if ( tgenesubproductchargesPK.getRatesequence() != null ) {
            tgenesubproductchargesPK1.setRatesequence( tgenesubproductchargesPK.getRatesequence().shortValue() );
        }

        return tgenesubproductchargesPK1;
    }

    @Override
    public TgenesubproductchargesPKDTO getDto(TgenesubproductchargesPK tgenesubproductchargesPK) {
        if ( tgenesubproductchargesPK == null ) {
            return null;
        }

        TgenesubproductchargesPKDTO tgenesubproductchargesPKDTO = new TgenesubproductchargesPKDTO();

        tgenesubproductchargesPKDTO.setBalancetype( tgenesubproductchargesPK.getBalancetype() );
        tgenesubproductchargesPKDTO.setBalancegroup( tgenesubproductchargesPK.getBalancegroup() );
        tgenesubproductchargesPKDTO.setModulecode( tgenesubproductchargesPK.getModulecode() );
        tgenesubproductchargesPKDTO.setProductcode( tgenesubproductchargesPK.getProductcode() );
        tgenesubproductchargesPKDTO.setSubproductcode( tgenesubproductchargesPK.getSubproductcode() );
        tgenesubproductchargesPKDTO.setStatuscode( tgenesubproductchargesPK.getStatuscode() );
        tgenesubproductchargesPKDTO.setCompanycode( (int) tgenesubproductchargesPK.getCompanycode() );
        tgenesubproductchargesPKDTO.setCurrencycode( tgenesubproductchargesPK.getCurrencycode() );
        tgenesubproductchargesPKDTO.setRatesequence( (int) tgenesubproductchargesPK.getRatesequence() );

        return tgenesubproductchargesPKDTO;
    }
}
