/*
 * 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.views;

import com.arrebol.apc.model.enums.CustomerClassification;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 *
 * @author David Rodríguez Huaracha
 */
@Entity
@Table(name = "APC_LOAN_FINISHED_VIEW")
public class LoanFinishedView implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid2")
    @Column(name = "id", length = 36)
    private String id;
    
    @Column(name = "customer_id", length = 36)
    private String customerId;
    
    @Column(name = "customer_name", length = 300)
    private String customerName;
    
    @Column(name = "address_home", length = 300)
    private String addressHome;
    
    @Column(name = "classification", length = 10)
    private String classification;
    
    @Column(name = "user_name", length = 300)
    private String userName;

    @Column(name = "amount_to_pay", nullable = true)
    private BigDecimal amountToPay;
    
    @Column(name = "loan_status", length = 10)
    private String loan_status;

    @Column(name = "id_loan_type", length = 36)
    private String loanType;
    
    @Column(name = "payment", nullable = true)
    private BigDecimal payment;

    @Column(name = "comments", length = 200)
    private String loanComments;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLoanType() {
        return loanType;
    }

    public void setLoanType(String loanType) {
        this.loanType = loanType;
    }
    
    public BigDecimal getPayment() {
        return payment;
    }

    public void setPayment(BigDecimal payment) {
        this.payment = payment;
    }

    public BigDecimal getAmountToPay() {
        return amountToPay;
    }

    public void setAmountToPay(BigDecimal amountToPay) {
        this.amountToPay = amountToPay;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getAddressHome() {
        return addressHome;
    }

    public void setAddressHome(String addressHome) {
        this.addressHome = addressHome;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getLoanComments() {
        return loanComments;
    }

    public void setLoanComments(String loanComments) {
        this.loanComments = loanComments;
    }

      public String getCustomerId() {
        return customerId;
    }

    public void setCustomerId(String customerId) {
        this.customerId = customerId;
    }

    public String getClassification() {
        return classification;
    }

    public void setClassification(String classification) {
        this.classification = classification;
    }

    public String getLoan_status() {
        return loan_status;
    }

    public void setLoan_status(String loan_status) {
        this.loan_status = loan_status;
    }

    @Override
    public String toString() {
        return "";
    }
    
    public String conditionStyle()
    {
        if(getClassification().equals(CustomerClassification.RED.getValue()))
            return "redRow";
        else if(getClassification().equals(CustomerClassification.YELLOW.getValue()))
            return "yellowRow";
        return null;
    }

}
