export type FindSchedulesEnabledParams = {
    _id?: string;
    companyId: string;
    employeeId?: string;
    startDate: Date;
    endDate: Date;
};

export type CheckSchedulesEnabledParams = {
    companyId: string;
    employeeId?: string;
    dateDay: Date;
};

export type PaginateSchedulesEnabledParams = FindSchedulesEnabledParams & {
    page: number;
    limit: number;
};

export type PaginateSchedulesEnabledResults = {
    data: ISchedulesEnabled[];
    page: number;
    pages: number;
};

export type CreateSchedulesEnabledParams = {
    companyId: string;
    employeeId: string;
    startDate: Date;
    endDate: Date;
    sessionUser: string;
};

export type DeleteSchedulesEnabledParams = {
    id: string;
    companyId: string;
    sessionUser: string;
};

export type EmployeeItem = {
    employeeId: string;
};

export type EnableScheduleParams = {
    companyId: string;
    employees: EmployeeItem[];
    startDate: Date;
    endDate: Date;
    sessionUser: string;
};

export type DeleteSchedulesEnabledByCompanyParams = {
    companyId: string;
};

export type DeleteSchedulesEnabledByEmployeeParams = {
    employeeId: string;
};

export interface ISchedulesEnabled {
    id?: string;
    companyId: string;
    employeeId: string;
    startDate: Date;
    endDate: Date;
}

export interface SchedulesEnabledView {
    id: string;
    employeeId: string;
    employeeFullName: string;
    employeeEmail: string;
    employeeAvatar: string;
    employeeUserId: string;
    startDate: Date;
    endDate: Date;
    enabled: boolean;
}

export interface ISchedulesEnabledAdapter {
    create(data: CreateSchedulesEnabledParams): Promise<ISchedulesEnabled>;
    delete(id: string): Promise<void>;
    findOne(filters: FindSchedulesEnabledParams): Promise<ISchedulesEnabled | null>;
}

export interface ISchedulesEnabledManager {
    schedulesEnabled: ISchedulesEnabledAdapter;
    createSchedulesEnabled(data: CreateSchedulesEnabledParams): Promise<ISchedulesEnabled>;
    enableSchedule(data: EnableScheduleParams): Promise<void>;
    disableSchedule(data: EnableScheduleParams): Promise<void>;
    find(data: FindSchedulesEnabledParams): Promise<SchedulesEnabledView[]>;
    findOne(data: FindSchedulesEnabledParams): Promise<ISchedulesEnabled | null>;
    delete(data: DeleteSchedulesEnabledParams): Promise<void>;
    exists(data: CheckSchedulesEnabledParams): Promise<boolean>;
    deleteSchedulesEnabledByCompany(data: DeleteSchedulesEnabledByCompanyParams): Promise<void>;
    deleteSchedulesEnabledByEmployee(data: DeleteSchedulesEnabledByEmployeeParams): Promise<void>;
}
