export enum PlanFeatures {
    MAIL_NOTIFICATIONS = "mail_notifications",
    SMS_NOTIFICATIONS = "sms_notifications",
    WAP_NOTIFICATIONS = "wap_notifications",
    HAS_BOT = "has_bot",
    PAYMENTS = "payments",
}

export type FindPlansParams = {
    _id?: string;
    code?: string;
    price?: number;
};

export interface IPlan {
    id?: string;
    name: string;
    description: string;
    features: string[];
    code: string;
    price: number;
    annualPrice: number;
    limitOrganizations: number;
    limitEmployees: number;
    limitServices: number;
    limitAppointments: number; //Cantidad de turnos por día.
    limitClients: number;
    limitRepeats: number;
    mailNotifications: boolean;
    smsNotifications: boolean;
    wapNotifications: boolean;
    payments: boolean;
    bot: boolean;
    active: boolean; //Indica si es posible contratar el plan.
    dateLimit: boolean; //Indica se el plan tiene un limite de fecha.
    //Por ejemplo, el plan gratuito no tiene un limite de fecha.
    mpPlanId?: string;
    discount3Months?: number;
    discount6Months?: number;
    discount12Months?: number;
    featured?: boolean;
}

export interface IPlansAdapter {
    find(filters: FindPlansParams): Promise<IPlan[]>;
    findOne(filters: FindPlansParams): Promise<IPlan | null>;
}

export interface IPlansManager {
    plans: IPlansAdapter;
    find(data: FindPlansParams): Promise<IPlan[]>;
    findOne(data: FindPlansParams): Promise<IPlan>;
}
