import {
  GetMyTeamJourneyParams,
  JourneysParams,
  JourneyTasksParams,
} from './types';

export const employeeLifecycleKeys = {
  all: () => ['employee-lifecycle'],
  journeys: {
    all: () => [...employeeLifecycleKeys.all(), 'journeys'],
    allTasks: () => [...employeeLifecycleKeys.journeys.all(), 'allTasks'],
    list: (params: JourneysParams) => [
      ...employeeLifecycleKeys.journeys.all(),
      'list',
      JSON.stringify(params),
    ],
    steps: (journeyId: number) => [
      ...employeeLifecycleKeys.journeys.all(),
      'steps',
      journeyId,
    ],
    step: (journeyId: number, stepId: number) => [
      ...employeeLifecycleKeys.journeys.all(),
      'step',
      journeyId,
      stepId,
    ],
    stepTasks: (params: JourneyTasksParams) => [
      ...employeeLifecycleKeys.journeys.all(),
      'stepTasks',
      JSON.stringify(params),
    ],
    tasksCollaborators: (params: JourneyTasksParams) => [
      ...employeeLifecycleKeys.journeys.all(),
      'tasksCollaborators',
      JSON.stringify(params),
    ],
    stepTask: (taskId: number) => [
      ...employeeLifecycleKeys.journeys.all(),
      'stepTask',
      taskId,
    ],
  },
  myTeamJourneys: {
    all: () => [...employeeLifecycleKeys.all(), 'myTeamJourneys'],
    allItems: () => [...employeeLifecycleKeys.myTeamJourneys.all(), 'allItems'],
    list: (params: GetMyTeamJourneyParams) => [
      ...employeeLifecycleKeys.myTeamJourneys.all(),
      'list',
      JSON.stringify(params),
    ],
  },
  notifications: {
    employeeLifecycle: () => [...employeeLifecycleKeys.all(), 'notifications'],
    tasks: () => [...employeeLifecycleKeys.all(), 'tasks', 'notifications'],
  },
};
