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

import com.qsoft.rs.sincoar.dto.TgenesubproductratePKDTO;
import com.qsoft.rs.sincoar.model.TgenesubproductratePK;
import javax.annotation.processing.Generated;

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

    @Override
    public TgenesubproductratePK getEntidad(TgenesubproductratePKDTO tgenesubproductratePK) {
        if ( tgenesubproductratePK == null ) {
            return null;
        }

        TgenesubproductratePK tgenesubproductratePK1 = new TgenesubproductratePK();

        tgenesubproductratePK1.setInterestbalancetype( tgenesubproductratePK.getInterestbalancetype() );
        tgenesubproductratePK1.setInterestbalancegroup( tgenesubproductratePK.getInterestbalancegroup() );
        tgenesubproductratePK1.setModulecode( tgenesubproductratePK.getModulecode() );
        tgenesubproductratePK1.setProductcode( tgenesubproductratePK.getProductcode() );
        tgenesubproductratePK1.setSubproductcode( tgenesubproductratePK.getSubproductcode() );
        if ( tgenesubproductratePK.getCompanycode() != null ) {
            tgenesubproductratePK1.setCompanycode( tgenesubproductratePK.getCompanycode() );
        }
        tgenesubproductratePK1.setCurrencycode( tgenesubproductratePK.getCurrencycode() );
        if ( tgenesubproductratePK.getRatesequence() != null ) {
            tgenesubproductratePK1.setRatesequence( tgenesubproductratePK.getRatesequence().shortValue() );
        }

        return tgenesubproductratePK1;
    }

    @Override
    public TgenesubproductratePKDTO getDto(TgenesubproductratePK tgenesubproductratePK) {
        if ( tgenesubproductratePK == null ) {
            return null;
        }

        TgenesubproductratePKDTO tgenesubproductratePKDTO = new TgenesubproductratePKDTO();

        tgenesubproductratePKDTO.setInterestbalancetype( tgenesubproductratePK.getInterestbalancetype() );
        tgenesubproductratePKDTO.setInterestbalancegroup( tgenesubproductratePK.getInterestbalancegroup() );
        tgenesubproductratePKDTO.setModulecode( tgenesubproductratePK.getModulecode() );
        tgenesubproductratePKDTO.setProductcode( tgenesubproductratePK.getProductcode() );
        tgenesubproductratePKDTO.setSubproductcode( tgenesubproductratePK.getSubproductcode() );
        tgenesubproductratePKDTO.setCompanycode( (int) tgenesubproductratePK.getCompanycode() );
        tgenesubproductratePKDTO.setCurrencycode( tgenesubproductratePK.getCurrencycode() );
        tgenesubproductratePKDTO.setRatesequence( (int) tgenesubproductratePK.getRatesequence() );

        return tgenesubproductratePKDTO;
    }
}
