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

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

export type PaginateSchedulesDisabledParams = FindSchedulesDisabledParams & {
    page: number;
    limit: number;
};

export type PaginateSchedulesDisabledResults = {
    data: ISchedulesDisabled[];
    page: number;
    pages: number;
};

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

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

export type EmployeeItem = {
    employeeId: string;
};

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

export type DeleteSchedulesDisabledByCompanyParams = {
    companyId: string;
};

export type DeleteSchedulesDisabledByEmployeeParams = {
    employeeId: string;
};

export interface ISchedulesDisabled {
    companyId: string;
    employeeId: string;
    startDate: Date;
    endDate: Date;
}

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

export interface SchedulesDisabledByCollaboratorView {
    id: string;
    employeeId: string;
    employeeFullName: string;
    employeeEmail: string;
    employeeAvatar: string;
    employeeUserId: string;
    disabledItems: ISchedulesDisabled[];
}

export interface ISchedulesDisabledAdapter {
    create(data: CreateSchedulesDisabledParams): Promise<ISchedulesDisabled>;
    delete(id: string): Promise<void>;
    findOne(filters: FindSchedulesDisabledParams): Promise<ISchedulesDisabled | null>;
}

export interface ISchedulesDisabledManager {
    schedulesDisabled: ISchedulesDisabledAdapter;
    createSchedulesDisabled(data: CreateSchedulesDisabledParams): Promise<ISchedulesDisabled>;
    disableSchedule(data: DisableScheduleParams): Promise<void>;
    enableSchedule(data: DisableScheduleParams): Promise<void>;
    findOne(data: FindSchedulesDisabledParams): Promise<ISchedulesDisabled | null>;
    findSchedulesDisabledByCollaborator(
        data: FindSchedulesDisabledParams
    ): Promise<SchedulesDisabledByCollaboratorView>;
    delete(data: DeleteSchedulesDisabledParams): Promise<void>;
    exists(data: CheckSchedulesDisabledParams): Promise<boolean>;
    deleteSchedulesDisabledByCompany(data: DeleteSchedulesDisabledByCompanyParams): Promise<void>;
    deleteSchedulesDisabledByEmployee(data: DeleteSchedulesDisabledByEmployeeParams): Promise<void>;
}
