/**
 * Generated by orval v8.5.3 🍺
 * Do not edit manually.
 * Api
 * CDACC Learning Plan AI API specification
 * OpenAPI spec version: 0.1.0
 */
export interface HealthStatus {
  status: string;
}

export type UserProfileRole =
  (typeof UserProfileRole)[keyof typeof UserProfileRole];

export const UserProfileRole = {
  admin: "admin",
  trainer: "trainer",
  reviewer: "reviewer",
  manager: "manager",
} as const;

export interface UserProfile {
  id: number;
  clerkUserId: string;
  /** @nullable */
  email?: string | null;
  /** @nullable */
  firstName?: string | null;
  /** @nullable */
  lastName?: string | null;
  role: UserProfileRole;
  /** @nullable */
  institutionId?: number | null;
  /** @nullable */
  departmentId?: number | null;
  createdAt?: string;
}

export type UserProfileUpdateRole =
  (typeof UserProfileUpdateRole)[keyof typeof UserProfileUpdateRole];

export const UserProfileUpdateRole = {
  admin: "admin",
  trainer: "trainer",
  reviewer: "reviewer",
  manager: "manager",
} as const;

export interface UserProfileUpdate {
  firstName?: string;
  lastName?: string;
  role?: UserProfileUpdateRole;
  institutionId?: number;
  departmentId?: number;
}

export interface Institution {
  id: number;
  name: string;
  /** @nullable */
  address?: string | null;
  /** @nullable */
  logoUrl?: string | null;
  /** @nullable */
  defaultHeaderText?: string | null;
  /** @nullable */
  defaultFooterText?: string | null;
  /** @nullable */
  signatureLines?: string | null;
  createdAt?: string;
}

export interface InstitutionInput {
  name: string;
  address?: string;
  logoUrl?: string;
  defaultHeaderText?: string;
  defaultFooterText?: string;
  signatureLines?: string;
}

export interface InstitutionUpdate {
  name?: string;
  address?: string;
  logoUrl?: string;
  defaultHeaderText?: string;
  defaultFooterText?: string;
  signatureLines?: string;
}

export interface Department {
  id: number;
  name: string;
  institutionId: number;
  /** @nullable */
  description?: string | null;
  createdAt?: string;
}

export interface DepartmentInput {
  name: string;
  institutionId: number;
  description?: string;
}

export interface DepartmentUpdate {
  name?: string;
  description?: string;
}

export type DocumentFileType =
  (typeof DocumentFileType)[keyof typeof DocumentFileType];

export const DocumentFileType = {
  pdf: "pdf",
  docx: "docx",
  txt: "txt",
} as const;

/**
 * @nullable
 */
export type DocumentTag = (typeof DocumentTag)[keyof typeof DocumentTag] | null;

export const DocumentTag = {
  occupational_standard: "occupational_standard",
  curriculum_design: "curriculum_design",
  assessment_guideline: "assessment_guideline",
  approval_template: "approval_template",
  session_plan_sample: "session_plan_sample",
  learning_plan_sample: "learning_plan_sample",
  policy_or_procedure: "policy_or_procedure",
} as const;

export interface Document {
  id: number;
  title: string;
  fileType: DocumentFileType;
  /** @nullable */
  institutionId?: number | null;
  /** @nullable */
  courseName?: string | null;
  /** @nullable */
  level?: string | null;
  /** @nullable */
  unitCode?: string | null;
  /** @nullable */
  tag?: DocumentTag;
  filePath?: string;
  /** @nullable */
  extractedText?: string | null;
  uploadedAt: string;
  /** @nullable */
  uploadedById?: string | null;
}

export type TemplateType = (typeof TemplateType)[keyof typeof TemplateType];

export const TemplateType = {
  learning_plan: "learning_plan",
  session_plan: "session_plan",
} as const;

export interface Template {
  id: number;
  name: string;
  type: TemplateType;
  /** @nullable */
  sector?: string | null;
  /** @nullable */
  institutionId?: number | null;
  /** @nullable */
  columns?: string | null;
  isDefault?: boolean;
  createdAt?: string;
}

export type TemplateInputType =
  (typeof TemplateInputType)[keyof typeof TemplateInputType];

export const TemplateInputType = {
  learning_plan: "learning_plan",
  session_plan: "session_plan",
} as const;

export interface TemplateInput {
  name: string;
  type: TemplateInputType;
  sector?: string;
  institutionId?: number;
  columns?: string;
  isDefault?: boolean;
}

export interface TemplateUpdate {
  name?: string;
  type?: string;
  sector?: string;
  columns?: string;
  isDefault?: boolean;
}

export type PlanStatus = (typeof PlanStatus)[keyof typeof PlanStatus];

export const PlanStatus = {
  draft: "draft",
  trainer_review: "trainer_review",
  hod_review: "hod_review",
  iqa_review: "iqa_review",
  approved: "approved",
  rejected: "rejected",
} as const;

export interface Plan {
  id: number;
  unitTitle: string;
  /** @nullable */
  unitCode?: string | null;
  /** @nullable */
  level?: string | null;
  /** @nullable */
  trainerName?: string | null;
  /** @nullable */
  className?: string | null;
  /** @nullable */
  numberOfTrainees?: number | null;
  /** @nullable */
  totalDuration?: string | null;
  /** @nullable */
  deliveryMode?: string | null;
  /** @nullable */
  numberOfSessions?: number | null;
  /** @nullable */
  sessionDuration?: string | null;
  /** @nullable */
  institutionId?: number | null;
  /** @nullable */
  departmentId?: number | null;
  /** @nullable */
  createdById?: string | null;
  /** @nullable */
  templateId?: number | null;
  status: PlanStatus;
  versionNumber?: number;
  /** @nullable */
  complianceFlags?: string | null;
  /** @nullable */
  improvementNotes?: string | null;
  /** @nullable */
  dateOfPreparation?: string | null;
  /** @nullable */
  dateOfRevision?: string | null;
  createdAt: string;
  updatedAt?: string;
}

export interface PlanInput {
  unitTitle: string;
  unitCode?: string;
  level?: string;
  trainerName?: string;
  className?: string;
  numberOfTrainees?: number;
  totalDuration?: string;
  deliveryMode?: string;
  numberOfSessions?: number;
  sessionDuration?: string;
  institutionId?: number;
  departmentId?: number;
  templateId?: number;
  dateOfPreparation?: string;
  dateOfRevision?: string;
}

export type PlanUpdateStatus =
  (typeof PlanUpdateStatus)[keyof typeof PlanUpdateStatus];

export const PlanUpdateStatus = {
  draft: "draft",
  trainer_review: "trainer_review",
  hod_review: "hod_review",
  iqa_review: "iqa_review",
  approved: "approved",
  rejected: "rejected",
} as const;

export interface PlanUpdate {
  unitTitle?: string;
  unitCode?: string;
  level?: string;
  trainerName?: string;
  className?: string;
  numberOfTrainees?: number;
  totalDuration?: string;
  deliveryMode?: string;
  status?: PlanUpdateStatus;
  complianceFlags?: string;
  improvementNotes?: string;
  dateOfPreparation?: string;
  dateOfRevision?: string;
}

export type PlanDetailStatus =
  (typeof PlanDetailStatus)[keyof typeof PlanDetailStatus];

export const PlanDetailStatus = {
  draft: "draft",
  trainer_review: "trainer_review",
  hod_review: "hod_review",
  iqa_review: "iqa_review",
  approved: "approved",
  rejected: "rejected",
} as const;

export interface SessionRow {
  id: number;
  planId: number;
  weekNumber: number;
  sessionNumber: number;
  /** @nullable */
  topic?: string | null;
  /** @nullable */
  subtopic?: string | null;
  /** @nullable */
  learningOutcome?: string | null;
  /** @nullable */
  trainerActivity?: string | null;
  /** @nullable */
  traineeActivity?: string | null;
  /** @nullable */
  resources?: string | null;
  /** @nullable */
  assessmentMethod?: string | null;
  /** @nullable */
  duration?: string | null;
  /** @nullable */
  performanceCriteria?: string | null;
  /** @nullable */
  evidenceRequired?: string | null;
  /** @nullable */
  deliveryMode?: string | null;
  /** @nullable */
  practicalExercise?: string | null;
  /** @nullable */
  reflection?: string | null;
  /** @nullable */
  notes?: string | null;
  isLocked?: boolean;
  createdAt?: string;
}

export type ApprovalStage = (typeof ApprovalStage)[keyof typeof ApprovalStage];

export const ApprovalStage = {
  trainer_review: "trainer_review",
  hod_review: "hod_review",
  iqa_review: "iqa_review",
  final_approval: "final_approval",
} as const;

export type ApprovalStatus =
  (typeof ApprovalStatus)[keyof typeof ApprovalStatus];

export const ApprovalStatus = {
  pending: "pending",
  approved: "approved",
  rejected: "rejected",
  revision_requested: "revision_requested",
} as const;

export interface Approval {
  id: number;
  planId: number;
  stage: ApprovalStage;
  status: ApprovalStatus;
  /** @nullable */
  approverUserId?: string | null;
  /** @nullable */
  approverName?: string | null;
  /** @nullable */
  comments?: string | null;
  /** @nullable */
  signatureText?: string | null;
  createdAt: string;
}

export interface Comment {
  id: number;
  planId: number;
  /** @nullable */
  userId?: string | null;
  /** @nullable */
  userName?: string | null;
  content: string;
  /** @nullable */
  sessionRowId?: number | null;
  createdAt: string;
}

export interface PlanDetail {
  id: number;
  unitTitle: string;
  /** @nullable */
  unitCode?: string | null;
  /** @nullable */
  level?: string | null;
  /** @nullable */
  trainerName?: string | null;
  /** @nullable */
  className?: string | null;
  /** @nullable */
  numberOfTrainees?: number | null;
  /** @nullable */
  totalDuration?: string | null;
  /** @nullable */
  deliveryMode?: string | null;
  /** @nullable */
  numberOfSessions?: number | null;
  /** @nullable */
  sessionDuration?: string | null;
  /** @nullable */
  institutionId?: number | null;
  /** @nullable */
  departmentId?: number | null;
  /** @nullable */
  createdById?: string | null;
  /** @nullable */
  templateId?: number | null;
  status: PlanDetailStatus;
  versionNumber?: number;
  /** @nullable */
  complianceFlags?: string | null;
  /** @nullable */
  improvementNotes?: string | null;
  /** @nullable */
  dateOfPreparation?: string | null;
  /** @nullable */
  dateOfRevision?: string | null;
  sessions: SessionRow[];
  approvals?: Approval[];
  comments?: Comment[];
  createdAt: string;
  updatedAt?: string;
}

export type GeneratePlanRequestDocumentType =
  (typeof GeneratePlanRequestDocumentType)[keyof typeof GeneratePlanRequestDocumentType];

export const GeneratePlanRequestDocumentType = {
  learning_plan: "learning_plan",
  session_plan: "session_plan",
  both: "both",
} as const;

export interface GeneratePlanRequest {
  documentType: GeneratePlanRequestDocumentType;
  weeklyStructure?: string;
  sessionsPerWeek?: number;
  specificOutcomes?: string;
  practicalEmphasis?: string;
  assessmentStyle?: string;
  availableResources?: string;
  documentIds?: number[];
}

export interface GeneratePlanResult {
  success: boolean;
  sessions?: SessionRow[];
  complianceFlags?: string[];
  improvementNotes?: string[];
  sourcedDocuments?: string[];
}

export type ExportRequestFormat =
  (typeof ExportRequestFormat)[keyof typeof ExportRequestFormat];

export const ExportRequestFormat = {
  pdf: "pdf",
  docx: "docx",
} as const;

export interface ExportRequest {
  format: ExportRequestFormat;
}

export interface ExportResult {
  success: boolean;
  downloadUrl: string;
  format?: string;
}

export interface TeachingSlot {
  /** 0=Sun, 1=Mon, 2=Tue, 3=Wed, 4=Thu, 5=Fri, 6=Sat */
  dayOfWeek: number;
  /** HH:MM */
  startTime: string;
  /** HH:MM */
  endTime: string;
  /** @nullable */
  venue?: string | null;
}

export interface Timetable {
  id: number;
  planId: number;
  /** @nullable */
  termStartDate?: string | null;
  /** @nullable */
  termEndDate?: string | null;
  teachingSlots?: TeachingSlot[];
  holidays?: string[];
  excludedDates?: string[];
  /** @nullable */
  notes?: string | null;
  createdAt?: string;
  updatedAt?: string;
}

export interface TimetableInput {
  termStartDate?: string;
  termEndDate?: string;
  teachingSlots?: TeachingSlot[];
  holidays?: string[];
  excludedDates?: string[];
  notes?: string;
}

export interface ScheduledSession {
  sessionIndex: number;
  date: string;
  dayOfWeek: number;
  startTime: string;
  endTime: string;
  /** @nullable */
  venue?: string | null;
  /** @nullable */
  sessionRowId?: number | null;
  /** @nullable */
  topic?: string | null;
}

export interface TimetableSchedule {
  totalSessions: number;
  sessions: ScheduledSession[];
}

export interface ParticipationStage {
  title: string;
  duration: string;
  trainerActivity?: string;
  traineeActivity?: string;
  teachingMethod?: string;
  learningCheck?: string;
  /** @nullable */
  notes?: string | null;
}

export type SessionPlanContentBridgeIn = {
  attentionGrabber?: string;
  scenario?: string;
  priorKnowledgeActivity?: string;
};

export type SessionPlanContentSummary = {
  recap?: string;
  keyTakeaways?: string[];
  assignment?: string;
  nextLessonPrep?: string;
};

export interface SessionPlanContent {
  bridge_in?: SessionPlanContentBridgeIn;
  learning_outcomes?: string[];
  resources?: string[];
  safety_requirements?: string[];
  pre_assessment?: string[];
  participatory_stages?: ParticipationStage[];
  post_assessment?: string[];
  summary?: SessionPlanContentSummary;
  reflection_prompts?: string[];
}

export type SessionPlanStatus =
  (typeof SessionPlanStatus)[keyof typeof SessionPlanStatus];

export const SessionPlanStatus = {
  draft: "draft",
  approved: "approved",
} as const;

export interface SessionPlan {
  id: number;
  sessionRowId: number;
  planId: number;
  /** @nullable */
  scheduledDate?: string | null;
  /** @nullable */
  scheduledStartTime?: string | null;
  /** @nullable */
  scheduledEndTime?: string | null;
  /** @nullable */
  duration?: string | null;
  /** @nullable */
  venue?: string | null;
  status: SessionPlanStatus;
  content?: SessionPlanContent;
  createdAt: string;
  updatedAt?: string;
}

export interface GenerateSessionPlanRequest {
  /** e.g. '2 hours', '4 hours' */
  duration?: string;
  venue?: string;
  scheduledDate?: string;
  scheduledStartTime?: string;
  scheduledEndTime?: string;
  /** classroom, workshop, lab, fieldwork */
  deliveryContext?: string;
  documentIds?: number[];
}

export type UpdateSessionPlanRequestStatus =
  (typeof UpdateSessionPlanRequestStatus)[keyof typeof UpdateSessionPlanRequestStatus];

export const UpdateSessionPlanRequestStatus = {
  draft: "draft",
  approved: "approved",
} as const;

export interface UpdateSessionPlanRequest {
  scheduledDate?: string;
  scheduledStartTime?: string;
  scheduledEndTime?: string;
  duration?: string;
  venue?: string;
  status?: UpdateSessionPlanRequestStatus;
  content?: SessionPlanContent;
}

export type RegenerateSectionRequestSection =
  (typeof RegenerateSectionRequestSection)[keyof typeof RegenerateSectionRequestSection];

export const RegenerateSectionRequestSection = {
  bridge_in: "bridge_in",
  pre_assessment: "pre_assessment",
  participatory_stages: "participatory_stages",
  post_assessment: "post_assessment",
  summary: "summary",
  reflection_prompts: "reflection_prompts",
} as const;

export interface RegenerateSectionRequest {
  section: RegenerateSectionRequestSection;
  extraInstructions?: string;
}

export interface BatchGenerateResult {
  success: boolean;
  generated: number;
  failed: number;
  sessionPlanIds?: number[];
}

export interface SessionRowInput {
  weekNumber: number;
  sessionNumber: number;
  topic?: string;
  subtopic?: string;
  learningOutcome?: string;
  trainerActivity?: string;
  traineeActivity?: string;
  resources?: string;
  assessmentMethod?: string;
  duration?: string;
  performanceCriteria?: string;
  evidenceRequired?: string;
  deliveryMode?: string;
  practicalExercise?: string;
  reflection?: string;
  notes?: string;
}

export interface SessionRowUpdate {
  topic?: string;
  subtopic?: string;
  learningOutcome?: string;
  trainerActivity?: string;
  traineeActivity?: string;
  resources?: string;
  assessmentMethod?: string;
  duration?: string;
  performanceCriteria?: string;
  evidenceRequired?: string;
  deliveryMode?: string;
  practicalExercise?: string;
  reflection?: string;
  notes?: string;
  isLocked?: boolean;
}

export type ApprovalInputStage =
  (typeof ApprovalInputStage)[keyof typeof ApprovalInputStage];

export const ApprovalInputStage = {
  trainer_review: "trainer_review",
  hod_review: "hod_review",
  iqa_review: "iqa_review",
  final_approval: "final_approval",
} as const;

export type ApprovalInputStatus =
  (typeof ApprovalInputStatus)[keyof typeof ApprovalInputStatus];

export const ApprovalInputStatus = {
  pending: "pending",
  approved: "approved",
  rejected: "rejected",
  revision_requested: "revision_requested",
} as const;

export interface ApprovalInput {
  stage: ApprovalInputStage;
  status: ApprovalInputStatus;
  approverName?: string;
  comments?: string;
  signatureText?: string;
}

export interface CommentInput {
  content: string;
  sessionRowId?: number;
  userName?: string;
}

export interface DashboardStats {
  totalPlans: number;
  draftPlans: number;
  awaitingReview: number;
  approvedPlans: number;
  rejectedPlans: number;
  totalDocuments: number;
  totalTrainers: number;
}

export interface StatusCount {
  status: string;
  count: number;
}

export type ListDepartmentsParams = {
  institutionId?: number;
};

export type ListDocumentsParams = {
  institutionId?: number;
  tag?: string;
};

export type ListTemplatesParams = {
  institutionId?: number;
  type?: string;
};

export type ListPlansParams = {
  status?: string;
  institutionId?: number;
  createdById?: string;
};
