export type HeatMapItem = {
    keyDate: Date;
    count: number;
};
export type FindHeatMapParams = {
    _id?: string;
    companyId?: string;
    employeeId?: string;
    serviceId?: string;
    heatMapDate?: Date;
    heatmap?: Array<HeatMapItem>;
};

export type DeleteHeatMapParams = {
    _id?: string;
    companyId?: string;
    employeeId?: string;
    serviceId?: string;
    heatMapDate: Date;
};

export type CreateHeatMapParams = {
    companyId: string;
    employeeId: string;
    serviceId: string;
    heatmap: IHeatMap;
    heatMapDate: Date;
};

export type DeleteHeatMapByCompanyParams = {
    companyId: string;
};

export type UpdateHeatMapParams = CreateHeatMapParams & {
    id: string;
};

export type DeleteHeatMapByEmployeeParams = {
    employeeId: string;
};

export interface IHeatMap {
    id?: string;
    companyId?: string;
    employeeId?: string;
    serviceId?: string;
    heatMap?: Array<HeatMapItem>;
    heatMapDate?: Date;
}

export interface IHeatMapAdapter {
    create(data: CreateHeatMapParams): Promise<IHeatMap>;
    update(data: UpdateHeatMapParams): Promise<void>;
    delete(data: DeleteHeatMapParams): Promise<void>;
    findOne(filters: FindHeatMapParams): Promise<IHeatMap | null>;
}

export interface IHeatMapManager {
    heatMaps: IHeatMapAdapter;
    createHeatMap(data: CreateHeatMapParams): Promise<IHeatMap>;
    updateHeatMap(data: UpdateHeatMapParams): Promise<void>;
    deleteHeatMapByDate(data: DeleteHeatMapParams): Promise<void>;
    findOne(filters: FindHeatMapParams): Promise<IHeatMap | null>;
    deleteHeatMapByCompany(data: DeleteHeatMapByCompanyParams): Promise<void>;
    deleteHeatMapByEmployee(data: DeleteHeatMapByEmployeeParams): Promise<void>;
    cleanUpHeatMap(): Promise<void>;
}
