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

import com.qsoft.rs.sincoar.dto.TlogheaderDTO;
import com.qsoft.rs.sincoar.model.Tlogheader;
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 TlogheaderMapperImpl implements TlogheaderMapper {

    @Override
    public Tlogheader getEntidad(TlogheaderDTO tlogheader) {
        if ( tlogheader == null ) {
            return null;
        }

        Tlogheader tlogheader1 = new Tlogheader();

        tlogheader1.setJournalid( tlogheader.getJournalid() );
        tlogheader1.setAccountingdate( tlogheader.getAccountingdate() );
        tlogheader1.setTransactionmodule( tlogheader.getTransactionmodule() );
        if ( tlogheader.getTransactioncode() != null ) {
            tlogheader1.setTransactioncode( tlogheader.getTransactioncode().shortValue() );
        }
        if ( tlogheader.getTransactionversion() != null ) {
            tlogheader1.setTransactionversion( tlogheader.getTransactionversion().shortValue() );
        }
        tlogheader1.setRealdate( tlogheader.getRealdate() );
        tlogheader1.setCompanycode( tlogheader.getCompanycode() );
        tlogheader1.setBranchcode( tlogheader.getBranchcode() );
        tlogheader1.setOfficecode( tlogheader.getOfficecode() );
        tlogheader1.setUsercode( tlogheader.getUsercode() );
        tlogheader1.setAditionaldata( tlogheader.getAditionaldata() );

        return tlogheader1;
    }

    @Override
    public TlogheaderDTO getDto(Tlogheader tlogheader) {
        if ( tlogheader == null ) {
            return null;
        }

        TlogheaderDTO tlogheaderDTO = new TlogheaderDTO();

        tlogheaderDTO.setJournalid( tlogheader.getJournalid() );
        tlogheaderDTO.setAccountingdate( tlogheader.getAccountingdate() );
        tlogheaderDTO.setTransactionmodule( tlogheader.getTransactionmodule() );
        tlogheaderDTO.setTransactioncode( (int) tlogheader.getTransactioncode() );
        tlogheaderDTO.setTransactionversion( (int) tlogheader.getTransactionversion() );
        tlogheaderDTO.setRealdate( tlogheader.getRealdate() );
        tlogheaderDTO.setCompanycode( tlogheader.getCompanycode() );
        tlogheaderDTO.setBranchcode( tlogheader.getBranchcode() );
        tlogheaderDTO.setOfficecode( tlogheader.getOfficecode() );
        tlogheaderDTO.setUsercode( tlogheader.getUsercode() );
        tlogheaderDTO.setAditionaldata( tlogheader.getAditionaldata() );

        return tlogheaderDTO;
    }
}
