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

import com.qsoft.rs.sincoar.dto.TgeneratesgroupPKDTO;
import com.qsoft.rs.sincoar.model.TgeneratesgroupPK;
import java.math.BigDecimal;
import javax.annotation.processing.Generated;

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

    @Override
    public TgeneratesgroupPK getEntidad(TgeneratesgroupPKDTO tgeneratesgroupPK) {
        if ( tgeneratesgroupPK == null ) {
            return null;
        }

        TgeneratesgroupPK tgeneratesgroupPK1 = new TgeneratesgroupPK();

        tgeneratesgroupPK1.setInterestbalancetype( tgeneratesgroupPK.getInterestbalancetype() );
        tgeneratesgroupPK1.setInterestbalancegroup( tgeneratesgroupPK.getInterestbalancegroup() );
        tgeneratesgroupPK1.setRatecatalog( tgeneratesgroupPK.getRatecatalog() );
        tgeneratesgroupPK1.setRatecatalogcode( tgeneratesgroupPK.getRatecatalogcode() );
        if ( tgeneratesgroupPK.getCompanycode() != null ) {
            tgeneratesgroupPK1.setCompanycode( tgeneratesgroupPK.getCompanycode() );
        }
        tgeneratesgroupPK1.setCurrencycode( tgeneratesgroupPK.getCurrencycode() );
        if ( tgeneratesgroupPK.getMinterm() != null ) {
            tgeneratesgroupPK1.setMinterm( tgeneratesgroupPK.getMinterm() );
        }
        if ( tgeneratesgroupPK.getMinamount() != null ) {
            tgeneratesgroupPK1.setMinamount( BigDecimal.valueOf( tgeneratesgroupPK.getMinamount() ) );
        }

        return tgeneratesgroupPK1;
    }

    @Override
    public TgeneratesgroupPKDTO getDto(TgeneratesgroupPK tgeneratesgroupPK) {
        if ( tgeneratesgroupPK == null ) {
            return null;
        }

        TgeneratesgroupPKDTO tgeneratesgroupPKDTO = new TgeneratesgroupPKDTO();

        tgeneratesgroupPKDTO.setInterestbalancetype( tgeneratesgroupPK.getInterestbalancetype() );
        tgeneratesgroupPKDTO.setInterestbalancegroup( tgeneratesgroupPK.getInterestbalancegroup() );
        tgeneratesgroupPKDTO.setRatecatalog( tgeneratesgroupPK.getRatecatalog() );
        tgeneratesgroupPKDTO.setRatecatalogcode( tgeneratesgroupPK.getRatecatalogcode() );
        tgeneratesgroupPKDTO.setCompanycode( (int) tgeneratesgroupPK.getCompanycode() );
        tgeneratesgroupPKDTO.setCurrencycode( tgeneratesgroupPK.getCurrencycode() );
        tgeneratesgroupPKDTO.setMinterm( tgeneratesgroupPK.getMinterm() );
        if ( tgeneratesgroupPK.getMinamount() != null ) {
            tgeneratesgroupPKDTO.setMinamount( tgeneratesgroupPK.getMinamount().intValue() );
        }

        return tgeneratesgroupPKDTO;
    }
}
