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.completeLesson

Mark a lesson as completed.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Tags: learning, progress
  • File: packages/modules/learning-journey/src/contracts/operations.ts
  • field.key.label
    learning.completeLesson
    field.version.label
    1.0.0
    field.type.label
    operation (command)
    field.title.label
    learning.completeLesson
    field.description.label

    Mark a lesson as completed.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Tags: learning, progress
  • File: packages/modules/learning-journey/src/contracts/operations.ts
  • field.tags.label
    learning,progress
    field.owners.label
    field.stability.label
    stable

    Mark a lesson as completed.

    Goal

    Record lesson completion and earn XP.

    Context

    Called when a learner finishes a lesson.

    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 CompleteLessonContract = defineCommand({
    	meta: {
    		key: 'learning.completeLesson',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: [...LEARNING_JOURNEY_OWNERS],
    		tags: ['learning', 'progress'],
    		description: 'Mark a lesson as completed.',
    		goal: 'Record lesson completion and earn XP.',
    		context: 'Called when a learner finishes a lesson.',
    	},
    	io: {
    		input: CompleteLessonInput,
    		output: SuccessOutput,
    		errors: {
    			LESSON_NOT_FOUND: {
    				description: 'Lesson does not exist',
    				http: 404,
    				gqlCode: 'LESSON_NOT_FOUND',
    				when: 'Lesson ID is invalid',
    			},
    			NOT_ENROLLED: {
    				description: 'Not enrolled in course',
    				http: 403,
    				gqlCode: 'NOT_ENROLLED',
    				when: 'Learner is not enrolled in the course',
    			},
    		},
    	},
    	policy: {
    		auth: 'user',
    	},
    });