OSS-first docs

These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.

learning.enroll

Enroll in a course.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Tags: learning, enrollment
  • File: packages/modules/learning-journey/src/contracts/operations.ts
  • Start learning a new course.

    field.key.label
    learning.enroll
    field.version.label
    1.0.0
    field.type.label
    operation (command)
    field.title.label
    learning.enroll
    field.description.label

    Enroll in a course.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Tags: learning, enrollment
  • File: packages/modules/learning-journey/src/contracts/operations.ts
  • Start learning a new course.

    field.tags.label
    learning,enrollment
    field.owners.label
    field.stability.label
    stable

    Enroll in a course.

    Goal

    Start learning a new course.

    Context

    Called when a learner wants to start a course.

    Source Definition

    import { defineCommand, defineQuery } from '@lssm-tech/lib.contracts-spec';
    import {
    	CompleteLessonInput,
    	EnrollInCourseInput,
    	EnrollmentModel,
    	GetDueCardsInput,
    	GetDueCardsOutput,
    	GetLearnerDashboardInput,
    	LearnerDashboardModel,
    	SubmitCardReviewInput,
    	SuccessOutput,
    } from './models';
    import { LEARNING_JOURNEY_OWNERS } from './shared';
    
    export const EnrollInCourseContract = defineCommand({
    	meta: {
    		key: 'learning.enroll',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: [...LEARNING_JOURNEY_OWNERS],
    		tags: ['learning', 'enrollment'],
    		description: 'Enroll in a course.',
    		goal: 'Start learning a new course.',
    		context: 'Called when a learner wants to start a course.',
    	},
    	io: {
    		input: EnrollInCourseInput,
    		output: EnrollmentModel,
    		errors: {
    			COURSE_NOT_FOUND: {
    				description: 'Course does not exist',
    				http: 404,
    				gqlCode: 'COURSE_NOT_FOUND',
    				when: 'Course ID is invalid',
    			},
    			ALREADY_ENROLLED: {
    				description: 'Already enrolled in course',
    				http: 409,
    				gqlCode: 'ALREADY_ENROLLED',
    				when: 'Learner is already enrolled',
    			},
    		},
    	},
    	policy: {
    		auth: 'user',
    	},
    });