Skip to main content

LMS Event Producer Behavior

Summary

Source-backed producer triggers, lifecycle checks, state mutation, and save behavior.

Audience

Engineering, integration, QA, architecture, security, and product reviewers.

Reference Content

OperationPreconditions / duplicate behaviorState mutationContract construction and save boundary
Enrollment assignmentCourse must be Published; there is no duplicate pre-check, while a persistence uniqueness constraint protects the tenant/employee/course combination.Creates an Assigned enrollment.Calls the lifecycle helper for TrainingAssigned; business state, evidence, and outbox staging reach one SaveChanges call.
Enrollment startEnrollment must be Assigned; repeated or invalid transition conflicts.Changes enrollment to InProgress and records start time.Calls the lifecycle helper for TrainingStarted before the same SaveChanges call.
Enrollment completionEnrollment must be Assigned or InProgress; a terminal repeat conflicts. No assessment prerequisite is checked here.Changes enrollment to Completed and creates one completion record.Calls the lifecycle helper for TrainingCompleted before the same SaveChanges call.
Assessment submissionAttempt must not already be Passed or Failed; outcome is selected by the implemented threshold comparison.Stores a terminal Passed or Failed attempt result.Calls the assessment helper, which constructs exactly one outcome contract, before the same SaveChanges call.
Certificate issueCertificate must exist and must not already be Issued.Changes certificate state to Issued.Calls the certificate helper for CertificateIssued before the same SaveChanges call.
Session createCourse must exist.Creates a Scheduled session.Calls the session helper for TrainingSessionScheduled before the same SaveChanges call.
Session rescheduleSession and course must exist; repeated valid rescheduling remains permitted.Updates schedule and marks the session Rescheduled.Calls the session helper for TrainingSessionRescheduled before the same SaveChanges call.

All eight are direct helper constructions followed by SaveChanges. This is a local persistence boundary; no distributed transaction with a broker or HTTP dependency is shown. Certificate expiry is not invoked. Course create/publish/archive, content/material changes, learning paths, assessment/attempt creation, certificate document operations, and import lifecycle changes do not emit Training contracts.

Source References

  • microservices/src/training-service/Api/TrainingEndpoints.cs
  • microservices/src/training-service/Infrastructure/TrainingDbContext.cs

See Also

Keywords

  • LMS events
  • Training contracts
  • Source-backed integration

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-17
  • Review cycle: Quarterly