package com.example.pap_teste.models;

import com.google.firebase.Timestamp;

public class Reserva {
    private String id;
    private String userId;
    private String restaurantId;
    private String restaurantName;
    private String clienteEmail;
    private String restauranteName;
    private String restauranteEmail;
    private String data;
    private String hora;
    private int pessoas;
    private int guests;
    private String estado;
    private String status;
    private Timestamp date;
    private String timeSlot;
    private String specialRequests;
    private Timestamp createdAt;

    public Reserva() {
    }

    public Reserva(String id, String clienteEmail, String restauranteName, String restauranteEmail, 
                   String data, String hora, int pessoas, String estado) {
        this.id = id;
        this.clienteEmail = clienteEmail;
        this.restauranteName = restauranteName;
        this.restauranteEmail = restauranteEmail;
        this.data = data;
        this.hora = hora;
        this.pessoas = pessoas;
        this.estado = estado;
    }

    // Existing getters/setters
    public String getId() { return id; }
    public void setId(String id) { this.id = id; }
    public String getClienteEmail() { return clienteEmail; }
    public void setClienteEmail(String clienteEmail) { this.clienteEmail = clienteEmail; }
    public String getRestauranteName() { return restauranteName; }
    public void setRestauranteName(String restauranteName) { this.restauranteName = restauranteName; }
    public String getRestauranteEmail() { return restauranteEmail; }
    public void setRestauranteEmail(String restauranteEmail) { this.restauranteEmail = restauranteEmail; }
    public String getData() { return data; }
    public void setData(String data) { this.data = data; }
    public String getHora() { return hora; }
    public void setHora(String hora) { this.hora = hora; }
    public int getPessoas() { return pessoas; }
    public void setPessoas(int pessoas) { this.pessoas = pessoas; }
    public String getEstado() { return estado; }
    public void setEstado(String estado) { this.estado = estado; }

    // New getters/setters to fix ReservationActivity
    public String getUserId() { return userId != null ? userId : clienteEmail; }
    public void setUserId(String userId) { this.userId = userId; }
    public String getRestaurantId() { return restaurantId != null ? restaurantId : restauranteEmail; }
    public void setRestaurantId(String restaurantId) { this.restaurantId = restaurantId; }
    public String getRestaurantName() { return restaurantName != null ? restaurantName : restauranteName; }
    public void setRestaurantName(String restaurantName) { this.restaurantName = restaurantName; }
    public int getGuests() { return guests != 0 ? guests : pessoas; }
    public void setGuests(int guests) { this.guests = guests; }
    public String getStatus() { return status != null ? status : estado; }
    public void setStatus(String status) { this.status = status; }
    public Timestamp getDate() { return date; }
    public void setDate(Timestamp date) { this.date = date; }
    public String getTimeSlot() { return timeSlot != null ? timeSlot : hora; }
    public void setTimeSlot(String timeSlot) { this.timeSlot = timeSlot; }
    public String getSpecialRequests() { return specialRequests; }
    public void setSpecialRequests(String specialRequests) { this.specialRequests = specialRequests; }
    public Timestamp getCreatedAt() { return createdAt; }
    public void setCreatedAt(Timestamp createdAt) { this.createdAt = createdAt; }
}
