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

import com.arrebol.apc.model.core.User;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.GenericGenerator;

/**
 *
 * @author Carlos Janitzio Zavala Lopez <janitzio.zavala@arrebol.com.mx>
 */
@Entity
@Table(name = "APC_LOAN_FEE_NOTIFICATION")
public class LoanFeeNotification implements Serializable {

    private static final long serialVersionUID = -6178422651111540801L;

    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid2")
    @Column(name = "id", length = 36)
    private String id;

    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(
            name = "id_loan",
            referencedColumnName = "id",
            nullable = false
    )
    private Loan loan;

    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(
            name = "id_user",
            referencedColumnName = "id",
            nullable = false
    )
    private User user;

    @Column(name = "notification_number", nullable = false, length = 36)
    private Integer notificationNumber;

    @Column(name = "created_by", nullable = false, length = 36)
    private String createdBy;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "created_on", length = 19)
    private Date createdOn;

    public LoanFeeNotification() {
    }

    /**
     * 
     * @param loan
     * @param user
     * @param notificationNumber
     * @param createdBy
     * @param createdOn 
     */
    public LoanFeeNotification(Loan loan, User user, Integer notificationNumber, String createdBy, Date createdOn) {
        this.loan = loan;
        this.user = user;
        this.notificationNumber = notificationNumber;
        this.createdBy = createdBy;
        this.createdOn = createdOn;
    }

    public String getId() {
        return id;
    }

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

    public Loan getLoan() {
        return loan;
    }

    public void setLoan(Loan loan) {
        this.loan = loan;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Integer getNotificationNumber() {
        return notificationNumber;
    }

    public void setNotificationNumber(Integer notificationNumber) {
        this.notificationNumber = notificationNumber;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public Date getCreatedOn() {
        return createdOn;
    }

    public void setCreatedOn(Date createdOn) {
        this.createdOn = createdOn;
    }

    @Override
    public String toString() {
        return "LoanFeeNotification{" + "notificationNumber=" + notificationNumber + ", createdBy=" + createdBy + '}';
    }

}
