/*
 * Arrebol Consultancy copyright.
 * 
 * This code belongs to Arrebol Consultancy
 * its use, redistribution or modification are prohibited 
 * without written authorization from Arrebol Consultancy.
 */
package com.arrebol.apc.model.ws.parsed;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Carlos Janitzio Zavala Lopez <janitzio.zavala@arrebol.com.mx>
 */
@XmlRootElement(name = "loanRequested")
public class LoanRequestedJaxb {

    private String loanTypeId;
    private String officeId;
    private String userId;
    private String routeId;
    private PersonJaxb customer;
    private PersonJaxb endorsement;
    private String strDate;
    private String routeIdNewClient;

    public LoanRequestedJaxb() {
    }

    @XmlElement(name = "loanTypeId")
    public String getLoanTypeId() {
        return loanTypeId;
    }

    public void setLoanTypeId(String loanTypeId) {
        this.loanTypeId = loanTypeId;
    }

    @XmlElement(name = "officeId")
    public String getOfficeId() {
        return officeId;
    }

    public void setOfficeId(String officeId) {
        this.officeId = officeId;
    }

    @XmlElement(name = "userId")
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @XmlElement(name = "routeId")
    public String getRouteId() {
        return routeId;
    }

    public void setRouteId(String routeId) {
        this.routeId = routeId;
    }

    @XmlElement(name = "customer")
    public PersonJaxb getCustomer() {
        return customer;
    }

    public void setCustomer(PersonJaxb customer) {
        this.customer = customer;
    }

    @XmlElement(name = "endorsement")
    public PersonJaxb getEndorsement() {
        return endorsement;
    }

    public void setEndorsement(PersonJaxb endorsement) {
        this.endorsement = endorsement;
    }

    @XmlElement(name = "strDate")
    public String getStrDate() {
        return strDate;
    }

    public void setStrDate(String strDate) {
        this.strDate = strDate;
    }

    @XmlElement(name = "routeIdNewClient")
    public String getRouteIdNewClient() {
        return routeIdNewClient;
    }

    public String chooseRouteId() {
        try {
            return null == getRouteIdNewClient() || "".equals(getRouteIdNewClient()) ? getRouteId() : getRouteIdNewClient();
        } catch (Exception e) {
            return getRouteId();
        }
    }

    public void setRouteIdNewClient(String routeIdNewClient) {
        this.routeIdNewClient = routeIdNewClient;
    }

}
