ENGLISH·COURSE API
    Preparing search index...
    EnrollInCourse: (
        input: { courseSlug: Slug },
    ) => ResultAsync<{ enrolled: true }, EnrollInCourseErrors>

    Use case: enroll the learner in a course the catalog serves.

    Resolves the course through CourseRepository first, so a slug the catalog does not serve — unknown, or a draft hidden from this environment — is refused instead of enrolling anyone in it. Enrolling twice is harmless: the port's write is idempotent.

    Type Declaration