package fr.marouse.entity;

import java.sql.Date;

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.Table;

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

    private Date dateOperation;

    @Column(nullable = false)
    private String typeOperation;

    @Column(nullable = false)
    private double montant;

    @ManyToOne
    private Compte compte;

    public Operation() {}
    public Operation(Date dateOperation, String typeOperation, double montant, Compte compte) {
        this.dateOperation = dateOperation;
        this.typeOperation = typeOperation;
        this.montant = montant;
        this.compte = compte;
    }

    public int getNumOperation() {
        return numOperation;
    }
    public Date getDateOperation() {
        return dateOperation;
    }
    public String getTypeOperation() {
        return typeOperation;
    }
    public double getMontant() {
        return montant;
    }
    public Compte getCompte() {
        return compte;
    }
    public void setCompte(Compte compte) {
        this.compte = compte;
    }

    public void setNumOperation(int numOperation) {
        this.numOperation = numOperation;
    }

    public void setDateOperation(Date dateOperation) {
        this.dateOperation = dateOperation;
    }

    public void setTypeOperation(String typeOperation) {
        this.typeOperation = typeOperation;
    }

    public void setMontant(double montant) {
        this.montant = montant;
    }
}