import { Attachment } from 'src/types/attachments';
import { FormAttributes } from 'src/types/forms';
import { Icon } from 'src/types/icons';

export enum OnboardingStatus {
  DONE = 'DONE',
  TODO = 'TODO',
}

export type CorrectChoices = {
  description: string;
  id: number;
  position: number;
  skip: null;
};

export type Chapter = {
  id: number;
  title: string;
  coverPicture: string;
  icon: Icon;
  body: string;
  position: number;
  createdAt: string;
  updatedAt: string;
  alreadyDone: boolean;
  attachments: any[];
  hasQuiz: boolean;
};

export type CorrectAnswer = {
  answer: null;
  correctChoices: CorrectChoices[];
  explanation: string;
};

export type Category = {
  id: number;
  instanceId: number;
  name: string;
  icon: Icon;
  position: number;
  taskIds: [number];
  alreadyDone: boolean;
  totalTasks: number;
  pendingTasks: number;
};

export type CategoryTask = {
  expirationDate: string | null;
  status: string;
  task: Task;
};

export type Task = {
  id: number;
  categoryId: number;
  name: string;
  body: string;
  coverPicture: string;
  position: number;
  attachments: Attachment[];
  dueDate: {
    customDueDateAmount?: number;
    customDueDatePeriod?: string;
    customDueDateRelation?: string;
    dueDateType?: string;
  };
  notificationTime: string;
  hasQuiz: boolean;
};

export type QuizAnswer = FormAttributes;

// Response

export type OnboardingsNotificationsResponse = {
  onboardingNotifications: number;
};
