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

import com.qsoft.rs.sincoar.dto.TgeneaccountingdatePKDTO;
import com.qsoft.rs.sincoar.model.TgeneaccountingdatePK;
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 TgeneaccountingdatePKMapperImpl implements TgeneaccountingdatePKMapper {

    @Override
    public TgeneaccountingdatePK getEntidad(TgeneaccountingdatePKDTO tgeneaccountingdatePK) {
        if ( tgeneaccountingdatePK == null ) {
            return null;
        }

        TgeneaccountingdatePK tgeneaccountingdatePK1 = new TgeneaccountingdatePK();

        if ( tgeneaccountingdatePK.getBranchcode() != null ) {
            tgeneaccountingdatePK1.setBranchcode( tgeneaccountingdatePK.getBranchcode().shortValue() );
        }
        if ( tgeneaccountingdatePK.getCompanycode() != null ) {
            tgeneaccountingdatePK1.setCompanycode( tgeneaccountingdatePK.getCompanycode() );
        }
        tgeneaccountingdatePK1.setRealdate( tgeneaccountingdatePK.getRealdate() );

        return tgeneaccountingdatePK1;
    }

    @Override
    public TgeneaccountingdatePKDTO getDto(TgeneaccountingdatePK tgeneaccountingdatePK) {
        if ( tgeneaccountingdatePK == null ) {
            return null;
        }

        TgeneaccountingdatePKDTO tgeneaccountingdatePKDTO = new TgeneaccountingdatePKDTO();

        tgeneaccountingdatePKDTO.setBranchcode( (int) tgeneaccountingdatePK.getBranchcode() );
        tgeneaccountingdatePKDTO.setCompanycode( (int) tgeneaccountingdatePK.getCompanycode() );
        tgeneaccountingdatePKDTO.setRealdate( tgeneaccountingdatePK.getRealdate() );

        return tgeneaccountingdatePKDTO;
    }
}
