Skip to main content

Sync Contract

:::info Source Sourced from services/enrollment-service/SYNC_CONTRACT.md in the documentation repo. :::

1. Applicability

Enrollments are replicable for offline — learners need to know what they can play offline.

2. Registration

{ service: 'enrollment', entityType: 'Enrollment', conflictPolicy: 'server_authoritative', deltaProjector: 'enrollments_by_user', pushHandler: 'none', versionField: 'updatedAt', schemaRef: 'schemas://enrollment/enrollment/v1' }

3. Delta Format

Server upserts enrollment state. State changes propagate within 60s online.

4. Conflict Resolution

server_authoritative. Client read-only.

5. Cursor

Scope: enrollment:user:{userId}.

6. LocalStore

enrollments_view: (id PK, courseId, courseVersionId, state, expiresAt, lastAccessedAt)

7. Offline Capability

  • View active enrollments offline.
  • Play bundles for active enrollments.
  • Revocation propagated via sync; enforced by license envelope on bundle mount.

8. Security

  • Per-tenant + per-user scoping.
  • Bundle license enforcement independent (content-service).