import { type z } from 'zod';

import { type downloadTicketsReportSchema } from 'src/pages/dashboard/serviceManagement/agentWorkspace/form/schemas';
import { type User } from 'src/types/user';

import { type AgentGroup, type HelpDesk } from './agent';
import { type ServiceItem } from './serviceItem';
import { type State } from './state';

export enum TaskReportType {
  CONSOLIDATED = 'CONSOLIDATED',
  SERVICE = 'SERVICE',
}

export type ConsolidatedReportFilters = {
  startDate: string;
  endDate: string;
};

export type ConsolidatedReportParsedFilters = {
  startDate: string;
  endDate: string;
};

export type ServiceReportFilters = {
  startDate: string;
  endDate: string;
};

export type ServiceReportParsedFilters = {
  destinationEmails: string[];
  initiator: {
    segmentationGroupIds: number[];
    profileFields: string[];
  };
  catalogItemsIn: ServiceItem['id'][];
  statesIn: State['id'][];
  initiatorsIn: User['id'][];
  assigneesIn: User['id'][];
  agentGroupsIn: AgentGroup['id'][];
  helpDesksIn: HelpDesk['id'][];
  createdAtFrom: string | null;
  createdAtTo: string | null;
};

export type DownloadTasksReportFormValues = z.infer<
  ReturnType<typeof downloadTicketsReportSchema>
>;
