Skip to content

Duplicate EnrollmentStatus and QuizResult type definitions cause compilation errors #427

Description

@DeFiVC

What

Two type definition files have duplicate identifiers that will cause TypeScript compilation errors:

  1. src/types/course.ts: EnrollmentStatus is defined twice — line 30 ("not_enrolled" | "active" | "completed" | "dropped") and line 98 ("not_enrolled" | "enrolled" | "in_progress" | "completed" | "expired"). The second silently shadows the first. Additionally, CourseEnrollment declares status twice (required on line 30, optional on line 47).

  2. src/types/quiz.ts: QuizResult is defined as an interface on line 64 and then redefined as export type QuizResult = QuizAttempt on line 98. This is a duplicate identifier error.

Why

TypeScript will either refuse to compile or produce unpredictable type behavior. Any code depending on EnrollmentStatus union members or importing QuizResult will break. The duplicate status property in CourseEnrollment creates undefined required/optional semantics.

Scope

  • Pick a single authoritative EnrollmentStatus definition in src/types/course.ts
  • Remove the duplicate status property from CourseEnrollment
  • Either remove the QuizResult interface or the type alias in src/types/quiz.ts
  • Update any consumers that depend on the removed/changed types

Acceptance criteria

  • No duplicate type definitions in course.ts or quiz.ts
  • EnrollmentStatus has a single, correct definition
  • CourseEnrollment.status appears once (with correct required/optional semantics)
  • QuizResult has a single definition
  • All files importing these types still compile
  • submitQuiz return type matches actual API response

Technical context

  • Files: src/types/course.ts:30,47,98, src/types/quiz.ts:64,98
  • Consumer: src/lib/api/courses.ts
  • Consumer: src/lib/api/quizzes.ts
  • Consumer: src/lib/hooks/use-courses.ts

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workinghighSignificant functionality broken, no workaround, affects multiple users

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions