package com.example.pap_teste;

import com.google.firebase.firestore.FirebaseFirestore;
import com.google.firebase.firestore.CollectionReference;

public class FirestoreManager {
    private static FirestoreManager instance;
    private final FirebaseFirestore db;

    private FirestoreManager() {
        db = FirebaseFirestore.getInstance();
    }

    public static synchronized FirestoreManager getInstance() {
        if (instance == null) {
            instance = new FirestoreManager();
        }
        return instance;
    }

    public FirebaseFirestore getDb() {
        return db;
    }

    public CollectionReference getUsersCollection() {
        return db.collection("users");
    }

    public CollectionReference getRestaurantsCollection() {
        return db.collection("restaurants");
    }

    public CollectionReference getReservationsCollection() {
        return db.collection("reservations");
    }
}
