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

import com.qsoft.rs.sincoar.dto.TgenetransactionlogDTO;
import com.qsoft.rs.sincoar.model.Tgenetransactionlog;
import java.math.BigDecimal;
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 TgenetransactionlogMapperImpl implements TgenetransactionlogMapper {

    @Override
    public Tgenetransactionlog getEntidad(TgenetransactionlogDTO tgenetransactionlog) {
        if ( tgenetransactionlog == null ) {
            return null;
        }

        Tgenetransactionlog tgenetransactionlog1 = new Tgenetransactionlog();

        tgenetransactionlog1.setJournalid( tgenetransactionlog.getJournalid() );
        tgenetransactionlog1.setTransactionmodule( tgenetransactionlog.getTransactionmodule() );
        if ( tgenetransactionlog.getTransactioncode() != null ) {
            tgenetransactionlog1.setTransactioncode( tgenetransactionlog.getTransactioncode().shortValue() );
        }
        if ( tgenetransactionlog.getTransactionversion() != null ) {
            tgenetransactionlog1.setTransactionversion( tgenetransactionlog.getTransactionversion().shortValue() );
        }
        tgenetransactionlog1.setAccountingdate( tgenetransactionlog.getAccountingdate() );
        tgenetransactionlog1.setServer( tgenetransactionlog.getServer() );
        tgenetransactionlog1.setRealdate( tgenetransactionlog.getRealdate() );
        tgenetransactionlog1.setCompanycode( tgenetransactionlog.getCompanycode() );
        tgenetransactionlog1.setBranchcode( tgenetransactionlog.getBranchcode() );
        tgenetransactionlog1.setOfficecode( tgenetransactionlog.getOfficecode() );
        tgenetransactionlog1.setTerminalcode( tgenetransactionlog.getTerminalcode() );
        tgenetransactionlog1.setUsercode( tgenetransactionlog.getUsercode() );
        if ( tgenetransactionlog.getDuration() != null ) {
            tgenetransactionlog1.setDuration( BigDecimal.valueOf( tgenetransactionlog.getDuration() ) );
        }
        tgenetransactionlog1.setResultcode( tgenetransactionlog.getResultcode() );
        tgenetransactionlog1.setUsermessage( tgenetransactionlog.getUsermessage() );
        tgenetransactionlog1.setAccount( tgenetransactionlog.getAccount() );
        tgenetransactionlog1.setPersoncode( tgenetransactionlog.getPersoncode() );
        tgenetransactionlog1.setSolicitudenumber( tgenetransactionlog.getSolicitudenumber() );
        tgenetransactionlog1.setMethod( tgenetransactionlog.getMethod() );
        tgenetransactionlog1.setAditionaldata( tgenetransactionlog.getAditionaldata() );
        tgenetransactionlog1.setOperativsystem( tgenetransactionlog.getOperativsystem() );
        tgenetransactionlog1.setBrowser( tgenetransactionlog.getBrowser() );

        return tgenetransactionlog1;
    }

    @Override
    public TgenetransactionlogDTO getDto(Tgenetransactionlog tgenetransactionlog) {
        if ( tgenetransactionlog == null ) {
            return null;
        }

        TgenetransactionlogDTO tgenetransactionlogDTO = new TgenetransactionlogDTO();

        tgenetransactionlogDTO.setJournalid( tgenetransactionlog.getJournalid() );
        tgenetransactionlogDTO.setTransactionmodule( tgenetransactionlog.getTransactionmodule() );
        tgenetransactionlogDTO.setTransactioncode( (int) tgenetransactionlog.getTransactioncode() );
        tgenetransactionlogDTO.setTransactionversion( (int) tgenetransactionlog.getTransactionversion() );
        tgenetransactionlogDTO.setAccountingdate( tgenetransactionlog.getAccountingdate() );
        tgenetransactionlogDTO.setServer( tgenetransactionlog.getServer() );
        tgenetransactionlogDTO.setRealdate( tgenetransactionlog.getRealdate() );
        tgenetransactionlogDTO.setCompanycode( tgenetransactionlog.getCompanycode() );
        tgenetransactionlogDTO.setBranchcode( tgenetransactionlog.getBranchcode() );
        tgenetransactionlogDTO.setOfficecode( tgenetransactionlog.getOfficecode() );
        tgenetransactionlogDTO.setTerminalcode( tgenetransactionlog.getTerminalcode() );
        tgenetransactionlogDTO.setUsercode( tgenetransactionlog.getUsercode() );
        if ( tgenetransactionlog.getDuration() != null ) {
            tgenetransactionlogDTO.setDuration( tgenetransactionlog.getDuration().intValue() );
        }
        tgenetransactionlogDTO.setResultcode( tgenetransactionlog.getResultcode() );
        tgenetransactionlogDTO.setUsermessage( tgenetransactionlog.getUsermessage() );
        tgenetransactionlogDTO.setAccount( tgenetransactionlog.getAccount() );
        tgenetransactionlogDTO.setPersoncode( tgenetransactionlog.getPersoncode() );
        tgenetransactionlogDTO.setSolicitudenumber( tgenetransactionlog.getSolicitudenumber() );
        tgenetransactionlogDTO.setMethod( tgenetransactionlog.getMethod() );
        tgenetransactionlogDTO.setAditionaldata( tgenetransactionlog.getAditionaldata() );
        tgenetransactionlogDTO.setOperativsystem( tgenetransactionlog.getOperativsystem() );
        tgenetransactionlogDTO.setBrowser( tgenetransactionlog.getBrowser() );

        return tgenetransactionlogDTO;
    }
}
