package fr.marouse.entity;

import java.util.List;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;

@Entity
@Table(name = "Agent")
public class Agent {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int numAgent;

    @Column(nullable = false)
    private String nomAgent;

    @Column(nullable = false)
    private String prenomAgent;

    private double salaire;
    private boolean estDirecteur;

    @ManyToOne
    private Agence agence;

    @OneToMany(mappedBy = "agent")
    private List<Client> clients;

    public Agent() {}
    public Agent(String nomAgent, String prenomAgent, double salaire, boolean estDirecteur) {
        this.nomAgent = nomAgent;
        this.prenomAgent = prenomAgent;
        this.salaire = salaire;
        this.estDirecteur = estDirecteur;
    }
    public boolean isEstDirecteur() {
        return estDirecteur;
    }

    public int getNumAgent() {
        return numAgent;
    }

    public void setNumAgent(int numAgent) {
        this.numAgent = numAgent;
    }

    public String getNomAgent() {
        return nomAgent;
    }

    public void setNomAgent(String nomAgent) {
        this.nomAgent = nomAgent;
    }

    public String getPrenomAgent() {
        return prenomAgent;
    }

    public void setPrenomAgent(String prenomAgent) {
        this.prenomAgent = prenomAgent;
    }

    public double getSalaire() {
        return salaire;
    }

    public void setSalaire(double salaire) {
        this.salaire = salaire;
    }

    public void setEstDirecteur(boolean estDirecteur) {
        this.estDirecteur = estDirecteur;
    }

    public Agence getAgence() {
        return agence;
    }

    public void setAgence(Agence agence) {
        this.agence = agence;
    }

    public List<Client> getClients() {
        return clients;
    }

    public void setClients(List<Client> clients) {
        this.clients = clients;
    }
}