/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.triz.trizservice.modeles;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author FORCE TECH
 */
@Entity
@Table(name = "tresorie", catalog = "triz_tresorie", schema = "public")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tresorie.findAll", query = "SELECT t FROM Tresorie t"),
    @NamedQuery(name = "Tresorie.findById", query = "SELECT t FROM Tresorie t WHERE t.id = :id"),
    @NamedQuery(name = "Tresorie.findByNumero", query = "SELECT t FROM Tresorie t WHERE t.numero = :numero"),
    @NamedQuery(name = "Tresorie.findByCode", query = "SELECT t FROM Tresorie t WHERE t.code = :code"),
    @NamedQuery(name = "Tresorie.findByCle", query = "SELECT t FROM Tresorie t WHERE t.cle = :cle"),
    @NamedQuery(name = "Tresorie.findByDesignation", query = "SELECT t FROM Tresorie t WHERE t.designation = :designation"),
    @NamedQuery(name = "Tresorie.findByMinLiq", query = "SELECT t FROM Tresorie t WHERE t.minLiq = :minLiq"),
    @NamedQuery(name = "Tresorie.findByMaxLiq", query = "SELECT t FROM Tresorie t WHERE t.maxLiq = :maxLiq"),
    @NamedQuery(name = "Tresorie.findBySoldInitial", query = "SELECT t FROM Tresorie t WHERE t.soldInitial = :soldInitial"),
    @NamedQuery(name = "Tresorie.findByDateSoldeInitial", query = "SELECT t FROM Tresorie t WHERE t.dateSoldeInitial = :dateSoldeInitial"),
    @NamedQuery(name = "Tresorie.findByNbrCheque", query = "SELECT t FROM Tresorie t WHERE t.nbrCheque = :nbrCheque"),
    @NamedQuery(name = "Tresorie.findByNumCompteComptable", query = "SELECT t FROM Tresorie t WHERE t.numCompteComptable = :numCompteComptable"),
    @NamedQuery(name = "Tresorie.findByIsDeleted", query = "SELECT t FROM Tresorie t WHERE t.isDeleted = :isDeleted"),
    @NamedQuery(name = "Tresorie.findByStockId", query = "SELECT t FROM Tresorie t WHERE t.stockId = :stockId")})
public class Tresorie implements Serializable {

    @Size(max = 10)
    @Column(name = "numero")
    private String numero;
    @Size(max = 10)
    @Column(name = "code")
    private String code;
    @Size(max = 2)
    @Column(name = "cle")
    private String cle;
    @Size(max = 50)
    @Column(name = "designation")
    private String designation;
    @Size(max = 5)
    @Column(name = "is_deleted")
    private String isDeleted;
    @Size(max = 50)
    @Column(name = "stock_id")
    private String stockId;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "min_liq")
    private Double minLiq;
    @Column(name = "max_liq")
    private Double maxLiq;
    @Column(name = "solde_initial")
    private Double soldeInitial;
   
    @OneToMany(mappedBy = "fkTresorie")
    private List<ServiceUserTresorie> serviceUserTresorieList;

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
   
    @Column(name = "sold_Initial")
    private Double soldInitial;
    @Column(name = "date_solde_initial")
    @Temporal(TemporalType.DATE)
    private Date dateSoldeInitial;
    @Column(name = "nbr_cheque")
    private Integer nbrCheque;
    @Column(name = "num_compte_comptable")
    private Integer numCompteComptable;
    @OneToMany(mappedBy = "fkTresorie")
    private List<ControleTresorie> controleTresorieList;
    @OneToMany(mappedBy = "fkTresorie")
    private List<Chequier> chequierList;
    @JoinColumn(name = "fk_etablissement", referencedColumnName = "id_etab_stock")
    @ManyToOne
    private Etablissement fkEtablissement;
    @JoinColumn(name = "fk_agence", referencedColumnName = "id")
    @ManyToOne
    private Agence fkAgence;
    @JoinColumn(name = "fk_compte_comptable", referencedColumnName = "id")
    @ManyToOne
    private CompteComptable fkCompteComptable;
    @JoinColumn(name = "fk_type_tresorie", referencedColumnName = "id")
    @ManyToOne
    private TypeTresorie fkTypeTresorie;
    @OneToMany(mappedBy = "fkTresorieSource")
    private List<Mouvement> mouvementList;
    @OneToMany(mappedBy = "fkTresorieDestinataire")
    private List<Mouvement> mouvementList1;

    public Tresorie() {
    }

    public Tresorie(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

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


    public Double getMinLiq() {
        return minLiq;
    }

    public void setMinLiq(Double minLiq) {
        this.minLiq = minLiq;
    }

    public Double getMaxLiq() {
        return maxLiq;
    }

    public void setMaxLiq(Double maxLiq) {
        this.maxLiq = maxLiq;
    }

    public Double getSoldInitial() {
        return soldInitial;
    }

    public void setSoldInitial(Double soldInitial) {
        this.soldInitial = soldInitial;
    }

    public Date getDateSoldeInitial() {
        return dateSoldeInitial;
    }

    public void setDateSoldeInitial(Date dateSoldeInitial) {
        this.dateSoldeInitial = dateSoldeInitial;
    }

    public Integer getNbrCheque() {
        return nbrCheque;
    }

    public void setNbrCheque(Integer nbrCheque) {
        this.nbrCheque = nbrCheque;
    }

    public Integer getNumCompteComptable() {
        return numCompteComptable;
    }

    public void setNumCompteComptable(Integer numCompteComptable) {
        this.numCompteComptable = numCompteComptable;
    }


    public String getStockId() {
        return stockId;
    }

    public void setStockId(String stockId) {
        this.stockId = stockId;
    }

    @XmlTransient
    public List<ControleTresorie> getControleTresorieList() {
        return controleTresorieList;
    }

    public void setControleTresorieList(List<ControleTresorie> controleTresorieList) {
        this.controleTresorieList = controleTresorieList;
    }

    @XmlTransient
    public List<Chequier> getChequierList() {
        return chequierList;
    }

    public void setChequierList(List<Chequier> chequierList) {
        this.chequierList = chequierList;
    }

    public Etablissement getFkEtablissement() {
        return fkEtablissement;
    }

    public void setFkEtablissement(Etablissement fkEtablissement) {
        this.fkEtablissement = fkEtablissement;
    }

    public Agence getFkAgence() {
        return fkAgence;
    }

    public void setFkAgence(Agence fkAgence) {
        this.fkAgence = fkAgence;
    }

    public CompteComptable getFkCompteComptable() {
        return fkCompteComptable;
    }

    public void setFkCompteComptable(CompteComptable fkCompteComptable) {
        this.fkCompteComptable = fkCompteComptable;
    }

    public TypeTresorie getFkTypeTresorie() {
        return fkTypeTresorie;
    }

    public void setFkTypeTresorie(TypeTresorie fkTypeTresorie) {
        this.fkTypeTresorie = fkTypeTresorie;
    }

    @XmlTransient
    public List<Mouvement> getMouvementList() {
        return mouvementList;
    }

    public void setMouvementList(List<Mouvement> mouvementList) {
        this.mouvementList = mouvementList;
    }

    @XmlTransient
    public List<Mouvement> getMouvementList1() {
        return mouvementList1;
    }

    public void setMouvementList1(List<Mouvement> mouvementList1) {
        this.mouvementList1 = mouvementList1;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tresorie)) {
            return false;
        }
        Tresorie other = (Tresorie) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.triz.trizservice.modeles.Tresorie[ id=" + id + " ]";
    }
    @XmlTransient
    public List<ServiceUserTresorie> getServiceUserTresorieList() {
        return serviceUserTresorieList;
    }
    public void setServiceUserTresorieList(List<ServiceUserTresorie> serviceUserTresorieList) {
        this.serviceUserTresorieList = serviceUserTresorieList;
    }
    public String getIsDeleted() {
        return isDeleted;
    }
    public void setIsDeleted(String isDeleted) {
        this.isDeleted = isDeleted;
    }

    public String getNumero() {
        return numero;
    }

    public void setNumero(String numero) {
        this.numero = numero;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getCle() {
        return cle;
    }

    public void setCle(String cle) {
        this.cle = cle;
    }

    public String getDesignation() {
        return designation;
    }

    public void setDesignation(String designation) {
        this.designation = designation;
    }

   

  
    
}
