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

import com.qsoft.rs.sincoar.dto.TgenechargesgroupPKDTO;
import com.qsoft.rs.sincoar.model.TgenechargesgroupPK;
import java.math.BigDecimal;
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 TgenechargesgroupPKMapperImpl implements TgenechargesgroupPKMapper {

    @Override
    public TgenechargesgroupPK getEntidad(TgenechargesgroupPKDTO tgenechargesgroupPK) {
        if ( tgenechargesgroupPK == null ) {
            return null;
        }

        TgenechargesgroupPK tgenechargesgroupPK1 = new TgenechargesgroupPK();

        tgenechargesgroupPK1.setChargecatalog( tgenechargesgroupPK.getChargecatalog() );
        tgenechargesgroupPK1.setChargecatalogcode( tgenechargesgroupPK.getChargecatalogcode() );
        tgenechargesgroupPK1.setBalancetype( tgenechargesgroupPK.getBalancetype() );
        tgenechargesgroupPK1.setBalancegroup( tgenechargesgroupPK.getBalancegroup() );
        tgenechargesgroupPK1.setModulecode( tgenechargesgroupPK.getModulecode() );
        tgenechargesgroupPK1.setStatuscode( tgenechargesgroupPK.getStatuscode() );
        if ( tgenechargesgroupPK.getCompanycode() != null ) {
            tgenechargesgroupPK1.setCompanycode( tgenechargesgroupPK.getCompanycode() );
        }
        tgenechargesgroupPK1.setCurrencycode( tgenechargesgroupPK.getCurrencycode() );
        if ( tgenechargesgroupPK.getMinamount() != null ) {
            tgenechargesgroupPK1.setMinamount( BigDecimal.valueOf( tgenechargesgroupPK.getMinamount() ) );
        }

        return tgenechargesgroupPK1;
    }

    @Override
    public TgenechargesgroupPKDTO getDto(TgenechargesgroupPK tgenechargesgroupPK) {
        if ( tgenechargesgroupPK == null ) {
            return null;
        }

        TgenechargesgroupPKDTO tgenechargesgroupPKDTO = new TgenechargesgroupPKDTO();

        tgenechargesgroupPKDTO.setChargecatalog( tgenechargesgroupPK.getChargecatalog() );
        tgenechargesgroupPKDTO.setChargecatalogcode( tgenechargesgroupPK.getChargecatalogcode() );
        tgenechargesgroupPKDTO.setBalancetype( tgenechargesgroupPK.getBalancetype() );
        tgenechargesgroupPKDTO.setBalancegroup( tgenechargesgroupPK.getBalancegroup() );
        tgenechargesgroupPKDTO.setModulecode( tgenechargesgroupPK.getModulecode() );
        tgenechargesgroupPKDTO.setStatuscode( tgenechargesgroupPK.getStatuscode() );
        tgenechargesgroupPKDTO.setCompanycode( (int) tgenechargesgroupPK.getCompanycode() );
        tgenechargesgroupPKDTO.setCurrencycode( tgenechargesgroupPK.getCurrencycode() );
        if ( tgenechargesgroupPK.getMinamount() != null ) {
            tgenechargesgroupPKDTO.setMinamount( tgenechargesgroupPK.getMinamount().intValue() );
        }

        return tgenechargesgroupPKDTO;
    }
}
