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

import com.qsoft.rs.sincoar.dto.TcustpeopletradereferencesPKDTO;
import com.qsoft.rs.sincoar.model.TcustpeopletradereferencesPK;
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 TcustpeopletradereferencesPKMapperImpl implements TcustpeopletradereferencesPKMapper {

    @Override
    public TcustpeopletradereferencesPK getEntidad(TcustpeopletradereferencesPKDTO tcustpeopletradereferencesPK) {
        if ( tcustpeopletradereferencesPK == null ) {
            return null;
        }

        TcustpeopletradereferencesPK tcustpeopletradereferencesPK1 = new TcustpeopletradereferencesPK();

        if ( tcustpeopletradereferencesPK.getPersoncode() != null ) {
            tcustpeopletradereferencesPK1.setPersoncode( tcustpeopletradereferencesPK.getPersoncode() );
        }
        tcustpeopletradereferencesPK1.setDateto( tcustpeopletradereferencesPK.getDateto() );
        if ( tcustpeopletradereferencesPK.getTradesequence() != null ) {
            tcustpeopletradereferencesPK1.setTradesequence( tcustpeopletradereferencesPK.getTradesequence().shortValue() );
        }

        return tcustpeopletradereferencesPK1;
    }

    @Override
    public TcustpeopletradereferencesPKDTO getDto(TcustpeopletradereferencesPK tcustpeopletradereferencesPK) {
        if ( tcustpeopletradereferencesPK == null ) {
            return null;
        }

        TcustpeopletradereferencesPKDTO tcustpeopletradereferencesPKDTO = new TcustpeopletradereferencesPKDTO();

        tcustpeopletradereferencesPKDTO.setPersoncode( (int) tcustpeopletradereferencesPK.getPersoncode() );
        tcustpeopletradereferencesPKDTO.setDateto( tcustpeopletradereferencesPK.getDateto() );
        tcustpeopletradereferencesPKDTO.setTradesequence( (int) tcustpeopletradereferencesPK.getTradesequence() );

        return tcustpeopletradereferencesPKDTO;
    }
}
