import { FavouritesManager } from "../../Models/Favourites/Favourites";
import { FavouritesAdapterMongoose } from "../../Models/Favourites/Favourites.Adapter.Mongoose";
import {
    CreateFavouriteParams,
    DeleteFavouriteParams,
    IFavourite,
    PaginateFavouritesParams,
    PaginateFavouritesResults,
} from "../../Models/Favourites/Favourites.interface";

export class FavouritesService {
    private favouritesManager: FavouritesManager;

    constructor() {
        this.favouritesManager = new FavouritesManager(new FavouritesAdapterMongoose());
    }

    public async createFavourite(data: CreateFavouriteParams): Promise<IFavourite> {
        return this.favouritesManager.createFavourite(data);
    }

    public async deleteFavourite(data: DeleteFavouriteParams): Promise<void> {
        return this.favouritesManager.deleteFavourite(data);
    }

    public async paginate(data: PaginateFavouritesParams): Promise<PaginateFavouritesResults> {
        return this.favouritesManager.paginate(data);
    }
}