import { DiscountType } from "./Discounts.model";

export type FindRepeatsParams = {
    _id?: string;
    companyId?: string;
    employeeId?: string;
    serviceId?: string;
    clientId?: string;
    weekDay?: number;
    startHour?: number;
};

export type CreateRepeatsParams = {
    companyId: string;
    employeeId: string;
    serviceId: string;
    clientId: string;
    discountId?: string;
    weekDay: number;
    startHour: number;
    sessionUser: string;
};

export type DeleteRepeatsParams = {
    repeatId: string;
    sessionUser: string;
};

export type CountRepeatsParams = {
    companyId: string;
    employeeId: string;
    countDate: Date;
    heatMapFraction: number;
};

export type AddRepeatDisabledDateParams = {
    repeatId: string;
    disableDate: Date;
    sessionUser: string;
};

export interface IRepeat {
    id?: string;
    companyId: string;
    employeeId: string;
    serviceId: string;
    clientId: string;
    discountId?: string;
    weekDay: number;
    startHour: number;
    length: number;
    disabledDates?: Date[];
}

export interface RepeatView {
    id: string;
    weekDay: number;
    weekDayName: string;
    startHour: number;
    startHourFormatted: string;
    length: number;
    companyId: string;
    companyName: string;
    employeeId: string;
    employeeName: string;
    employeeCalendarColor: string;
    employeeAvatar: string;
    serviceId: string;
    serviceName: string;
    discountId: string;
    discountType: DiscountType;
    discountValue: number;
    discountName: string;
    discountCode: string;
    clientId: string;
    clientName: string;
}

export type GetPendingRepeatsParams = {
    companyId?: string;
    employeeId?: string;
    sessionUser: string;
    filterBySessionUser?: boolean;
};

export interface PendingRepeatView extends RepeatView {
    pendingDate: Date;
}
