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

import com.qsoft.rs.sincoar.dto.TarmcashmanagementhistoryDTO;
import com.qsoft.rs.sincoar.model.Tarmcashmanagementhistory;
import com.qsoft.rs.sincoar.model.Tsafeuser;
import javax.annotation.processing.Generated;

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

    @Override
    public Tarmcashmanagementhistory getEntidad(TarmcashmanagementhistoryDTO tarmcashmanagementhistory) {
        if ( tarmcashmanagementhistory == null ) {
            return null;
        }

        Tarmcashmanagementhistory tarmcashmanagementhistory1 = new Tarmcashmanagementhistory();

        tarmcashmanagementhistory1.setUsercode( tarmcashmanagementhistoryDTOToTsafeuser( tarmcashmanagementhistory ) );
        tarmcashmanagementhistory1.setCcashmanagement( tarmcashmanagementhistory.getCcashmanagement() );
        tarmcashmanagementhistory1.setDateto( tarmcashmanagementhistory.getDateto() );
        tarmcashmanagementhistory1.setDatefrom( tarmcashmanagementhistory.getDatefrom() );
        tarmcashmanagementhistory1.setNombrearchivo( tarmcashmanagementhistory.getNombrearchivo() );
        tarmcashmanagementhistory1.setPathreporte( tarmcashmanagementhistory.getPathreporte() );

        return tarmcashmanagementhistory1;
    }

    @Override
    public TarmcashmanagementhistoryDTO getDto(Tarmcashmanagementhistory tarmcashmanagementhistory) {
        if ( tarmcashmanagementhistory == null ) {
            return null;
        }

        TarmcashmanagementhistoryDTO tarmcashmanagementhistoryDTO = new TarmcashmanagementhistoryDTO();

        tarmcashmanagementhistoryDTO.setUsercode( tarmcashmanagementhistoryUsercodeUsercode( tarmcashmanagementhistory ) );
        tarmcashmanagementhistoryDTO.setCcashmanagement( tarmcashmanagementhistory.getCcashmanagement() );
        tarmcashmanagementhistoryDTO.setDateto( tarmcashmanagementhistory.getDateto() );
        tarmcashmanagementhistoryDTO.setDatefrom( tarmcashmanagementhistory.getDatefrom() );
        tarmcashmanagementhistoryDTO.setNombrearchivo( tarmcashmanagementhistory.getNombrearchivo() );
        tarmcashmanagementhistoryDTO.setPathreporte( tarmcashmanagementhistory.getPathreporte() );

        return tarmcashmanagementhistoryDTO;
    }

    protected Tsafeuser tarmcashmanagementhistoryDTOToTsafeuser(TarmcashmanagementhistoryDTO tarmcashmanagementhistoryDTO) {
        if ( tarmcashmanagementhistoryDTO == null ) {
            return null;
        }

        Tsafeuser tsafeuser = new Tsafeuser();

        tsafeuser.setUsercode( tarmcashmanagementhistoryDTO.getUsercode() );

        return tsafeuser;
    }

    private String tarmcashmanagementhistoryUsercodeUsercode(Tarmcashmanagementhistory tarmcashmanagementhistory) {
        if ( tarmcashmanagementhistory == null ) {
            return null;
        }
        Tsafeuser usercode = tarmcashmanagementhistory.getUsercode();
        if ( usercode == null ) {
            return null;
        }
        String usercode1 = usercode.getUsercode();
        if ( usercode1 == null ) {
            return null;
        }
        return usercode1;
    }
}
