import { Steps } from 'src/pages/dashboard/Learning/Courses/types';

export const newCourseFields = {
  [Steps.BASIC_INFORMATION]: {
    all: () => Steps.BASIC_INFORMATION as const,
    title: () => `${newCourseFields.basicInformation.all()}.title` as const,
    body: () => `${newCourseFields.basicInformation.all()}.body` as const,
    category: () =>
      `${newCourseFields.basicInformation.all()}.category` as const,
    duration: () =>
      `${newCourseFields.basicInformation.all()}.duration` as const,
    image: () => `${newCourseFields.basicInformation.all()}.image` as const,
    status: () => `${newCourseFields.basicInformation.all()}.status` as const,
    isCourseStarted: () =>
      `${newCourseFields.basicInformation.all()}.isCourseStarted` as const,
  },
  [Steps.CONTENT]: {
    all: () => Steps.CONTENT as const,
    modules: {
      all: () => `${newCourseFields.content.all()}.modules` as const,
      detail: (module: number) =>
        `${newCourseFields.content.modules.all()}.${module}` as const,
      title: (module: number) =>
        `${newCourseFields.content.modules.detail(module)}.title` as const,
      icon: (module: number) =>
        `${newCourseFields.content.modules.detail(module)}.icon` as const,
      tasks: {
        all: (module: number) =>
          `${newCourseFields.content.modules.detail(module)}.tasks` as const,
        detail: (module: number, task: number) =>
          `${newCourseFields.content.modules.tasks.all(
            module,
          )}.${task}` as const,
        tag: (module: number, task: number) =>
          `${newCourseFields.content.modules.tasks.detail(
            module,
            task,
          )}.tag` as const,
        title: (module: number, task: number) =>
          `${newCourseFields.content.modules.tasks.detail(
            module,
            task,
          )}.title` as const,
        type: (module: number, task: number) =>
          `${newCourseFields.content.modules.tasks.detail(
            module,
            task,
          )}.type` as const,
        description: (module: number, task: number) =>
          `${newCourseFields.content.modules.tasks.detail(
            module,
            task,
          )}.description` as const,
        body: (module: number, task: number) =>
          `${newCourseFields.content.modules.tasks.detail(
            module,
            task,
          )}.body` as const,
        hasNewChanges: (module: number, task: number) =>
          `${newCourseFields.content.modules.tasks.detail(
            module,
            task,
          )}.hasNewChanges` as const,
        maximumAttempts: (module: number, task: number) =>
          `${newCourseFields.content.modules.tasks.detail(
            module,
            task,
          )}.maximumAttempts` as const,
        passingGrade: (module: number, task: number) =>
          `${newCourseFields.content.modules.tasks.detail(
            module,
            task,
          )}.passingGrade` as const,
        duration: (module: number, task: number) =>
          `${newCourseFields.content.modules.tasks.detail(
            module,
            task,
          )}.duration` as const,
        showCorrectAnswers: (module: number, task: number) =>
          `${newCourseFields.content.modules.tasks.detail(
            module,
            task,
          )}.showCorrectAnswers` as const,
        form: {
          all: (module: number, task: number) =>
            `${newCourseFields.content.modules.tasks.detail(
              module,
              task,
            )}.form` as const,
          questions: {
            all: (module: number, task: number) =>
              `${newCourseFields.content.modules.tasks.form.all(
                module,
                task,
              )}.questions` as const,
            detail: (module: number, task: number, question: number) =>
              `${newCourseFields.content.modules.tasks.form.questions.all(
                module,
                task,
              )}.${question}` as const,
            title: (module: number, task: number, question: number) =>
              `${newCourseFields.content.modules.tasks.form.questions.detail(
                module,
                task,
                question,
              )}.title` as const,
            points: (module: number, task: number, question: number) =>
              `${newCourseFields.content.modules.tasks.form.questions.detail(
                module,
                task,
                question,
              )}.points` as const,
            description: (module: number, task: number, question: number) =>
              `${newCourseFields.content.modules.tasks.form.questions.detail(
                module,
                task,
                question,
              )}.description` as const,
            type: (module: number, task: number, question: number) =>
              `${newCourseFields.content.modules.tasks.form.questions.detail(
                module,
                task,
                question,
              )}.type` as const,
            choices: {
              all: (module: number, task: number, question: number) =>
                `${newCourseFields.content.modules.tasks.form.questions.detail(
                  module,
                  task,
                  question,
                )}.choices` as const,
              detail: (
                module: number,
                task: number,
                question: number,
                choice: number,
              ) =>
                `${newCourseFields.content.modules.tasks.form.questions.choices.all(
                  module,
                  task,
                  question,
                )}.${choice}` as const,
            },
            text: (module: number, task: number) =>
              `${newCourseFields.content.modules.tasks.form.all(
                module,
                task,
              )}.text` as const,
            hasExplanation: (module: number, task: number, question: number) =>
              `${newCourseFields.content.modules.tasks.form.questions.detail(
                module,
                task,
                question,
              )}.hasExplanation` as const,
            explanation: (module: number, task: number, question: number) =>
              `${newCourseFields.content.modules.tasks.form.questions.detail(
                module,
                task,
                question,
              )}.explanation` as const,
          },
        },
        video: {
          all: (module: number, task: number) =>
            `${newCourseFields.content.modules.tasks.detail(module, task)}.video` as const,
          url: (module: number, task: number) =>
            `${newCourseFields.content.modules.tasks.video.all(module, task)}.url` as const,
          file: (module: number, task: number) =>
            `${newCourseFields.content.modules.tasks.video.all(module, task)}.file` as const,
        },
        drops: {
          all: (module: number, task: number) =>
            `${newCourseFields.content.modules.tasks.detail(module, task)}.drops` as const,
          detail: (module: number, task: number, attachment: number) =>
            `${newCourseFields.content.modules.tasks.drops.all(module, task)}.${attachment}` as const,
        },
        urlType: (module: number, task: number) =>
          `${newCourseFields.content.modules.tasks.detail(module, task)}.urlType` as const,
        reading: {
          all: (module: number, task: number) =>
            `${newCourseFields.content.modules.tasks.detail(module, task)}.reading` as const,
          type: (module: number, task: number) =>
            `${newCourseFields.content.modules.tasks.reading.all(module, task)}.type` as const,
          pdf: {
            all: (module: number, task: number) =>
              `${newCourseFields.content.modules.tasks.reading.all(module, task)}.pdf` as const,
            url: (module: number, task: number) =>
              `${newCourseFields.content.modules.tasks.reading.pdf.all(module, task)}.url` as const,
            file: (module: number, task: number) =>
              `${newCourseFields.content.modules.tasks.reading.pdf.all(module, task)}.file` as const,
          },
          body: (module: number, task: number) =>
            `${newCourseFields.content.modules.tasks.reading.all(module, task)}.body` as const,
        },
        scorm: {
          all: (module: number, task: number) =>
            `${newCourseFields.content.modules.tasks.detail(module, task)}.scorm` as const,
          zip: {
            all: (module: number, task: number) =>
              `${newCourseFields.content.modules.tasks.scorm.all(module, task)}.zip` as const,
            url: (module: number, task: number) =>
              `${newCourseFields.content.modules.tasks.scorm.zip.all(module, task)}.url` as const,
            file: (module: number, task: number) =>
              `${newCourseFields.content.modules.tasks.scorm.zip.all(module, task)}.file` as const,
          },
        },
      },
    },
  },
  [Steps.CONFIGURATION]: {
    all: () => Steps.CONFIGURATION as const,
    type: () => `${newCourseFields.configuration.all()}.type` as const,
    sequentiality: () =>
      `${newCourseFields.configuration.all()}.sequentiality` as const,
    refreshFinishedCourseUsers: () =>
      `${newCourseFields.configuration.all()}.refreshFinishedCourseUsers` as const,
    hasSurvey: () =>
      `${newCourseFields.configuration.all()}.hasSurvey` as const,
    issueCertificate: () =>
      `${newCourseFields.configuration.all()}.issueCertificate` as const,
    digitalSignature: () =>
      `${newCourseFields.configuration.all()}.digitalSignature` as const,
    instructor: () =>
      `${newCourseFields.configuration.all()}.instructor` as const,
    deadline: () => `${newCourseFields.configuration.all()}.deadline` as const,
    deadlineDays: () =>
      `${newCourseFields.configuration.all()}.deadlineDays` as const,
    deadlineType: () =>
      `${newCourseFields.configuration.all()}.deadlineType` as const,
    segmentation: () =>
      `${newCourseFields.configuration.all()}.segmentation` as const,
    sendPushNotification: () =>
      `${newCourseFields.configuration.all()}.sendPushNotification` as const,
    sendEmailNotification: () =>
      `${newCourseFields.configuration.all()}.sendEmailNotification` as const,
    satisfactionSurveyModel: {
      all: () =>
        `${newCourseFields.configuration.all()}.satisfactionSurveyModel` as const,
      contentRating: () =>
        `${newCourseFields.configuration.satisfactionSurveyModel.all()}.contentRating` as const,
      experienceRating: () =>
        `${newCourseFields.configuration.satisfactionSurveyModel.all()}.experienceRating` as const,
      recommendation: () =>
        `${newCourseFields.configuration.satisfactionSurveyModel.all()}.recommendation` as const,
      comments: () =>
        `${newCourseFields.configuration.satisfactionSurveyModel.all()}.comments` as const,
    },
  },
  [Steps.FINAL_REVISION]: {
    all: () => Steps.FINAL_REVISION as const,
  },
};
