import { type PaginationParamsWithQ } from 'src/utils/pagination';

export const SessionsTabs = {
  PUBLISHED: 'PUBLISHED',
  FINISHED: 'FINISHED',
} as const;

export type SessionsTabsType = (typeof SessionsTabs)[keyof typeof SessionsTabs];

export type Session = {
  id: number;
  learningSessionId: number;
  instanceId: number;
  title: string;
  localDate: string;
  startTime: string;
  endDate: string;
  startDate: string;
  endTime: string;
  isObligatory: boolean;
  timeZone: string;
  type: SessionModeType;
  status: SessionStatusType;
  pictureUrl?: string;
  confirmedAssistance: boolean;
  assisted: boolean | null;
  issueCertificate: boolean;
};

export type SessionDetail = Session & {
  description?: string;
  address?: string;
  collaborator?: string;
  meetingLink?: string | null;
  certUrl?: string;
};

export const SessionMode = {
  PRESENTIAL: 'PRESENTIAL',
  VIRTUAL: 'VIRTUAL',
} as const;

export type SessionModeType = (typeof SessionMode)[keyof typeof SessionMode];

export const SessionStatus = {
  DRAFT: 'DRAFT',
  PUBLISHED: 'PUBLISHED',
  FINISHED: 'FINISHED',
  IN_PROGRESS: 'IN_PROGRESS',
} as const;

export type SessionStatusType =
  (typeof SessionStatus)[keyof typeof SessionStatus];

export type GetSessionICSParams = {
  id: number;
  title: string;
};

export type GetSessionsParams = PaginationParamsWithQ & {
  status?: SessionStatusType;
};

export type ConfirmSessionAttendanceParams = {
  learningSessionId: number;
  assisted: boolean;
};
