ENGLISH·COURSE API
    Preparing search index...

    Port: where the learner was in each course they have opened.

    The store holds one location per course. set replaces the location of that location's course and makes it the most recent; the other courses keep theirs. Ordering comes from the time storage wrote each entry, so the domain still needs no Clock port.

    Independent of PlaybackPositionRepository and ProgressTracker. Where the learner was, how far into that lesson they got, and what they have finished are three distinct concepts mapping to independent storage, and writing one never touches the others.

    An absent record is a supported state, not an error: get resolves to null and list to an empty array when nothing has been recorded or storage is unavailable, and an entry that cannot be parsed is left out.

    interface ContinueWatchingRepository {
        get(): Promise<
            | {
                courseSlug: string & $brand<"Slug">;
                moduleSlug: string & $brand<"Slug">;
                lessonId: string & $brand<"LessonId">;
            }
            | null,
        >;
        set(
            location: {
                courseSlug: string & $brand<"Slug">;
                moduleSlug: string & $brand<"Slug">;
                lessonId: string & $brand<"LessonId">;
            },
        ): Promise<void>;
        list(): Promise<
            readonly {
                location: {
                    courseSlug: string & $brand<"Slug">;
                    moduleSlug: string & $brand<"Slug">;
                    lessonId: string & $brand<"LessonId">;
                };
                watchedAt: number;
            }[],
        >;
    }

    Implemented by

    Index

    Methods

    Methods

    • The most recently set location across every course, or null.

      Returns Promise<
          | {
              courseSlug: string & $brand<"Slug">;
              moduleSlug: string & $brand<"Slug">;
              lessonId: string & $brand<"LessonId">;
          }
          | null,
      >

    • Records the learner's place in the location's course; it becomes the latest.

      Parameters

      • location: {
            courseSlug: string & $brand<"Slug">;
            moduleSlug: string & $brand<"Slug">;
            lessonId: string & $brand<"LessonId">;
        }

      Returns Promise<void>

    • One record per course, the most recently watched first.

      Returns Promise<
          readonly {
              location: {
                  courseSlug: string & $brand<"Slug">;
                  moduleSlug: string & $brand<"Slug">;
                  lessonId: string & $brand<"LessonId">;
              };
              watchedAt: number;
          }[],
      >