Give the proposed course its own records
CourseRevisionWorkflowService finds or creates an editable copy of an approved course. Creation locks the course inside a transaction and checks again for an existing revision before creating separate course and content records. Edits can then continue without changing the approved lessons.
The administrator controller chooses approve or reject; the service performs the writes. On publication, it locks the course and revision, verifies their relationship, copies the explicit field list, synchronizes assignments and rebuilds chapters, lessons and announcements. Rejection keeps the proposed content out of the approved course.
The service removes the consumed revision before returning the updated course. Learner notifications are invoked after the publication transaction returns.
Atomic publication still changes lesson identity
Tests check that editing leaves the approved course unchanged, approval transfers content and removes the draft, and rejection preserves the approved content and review decision. Notification fakes check which messages should be queued, not whether they were delivered.
The current publication path deletes and recreates chapter and lesson rows. A transaction keeps those writes together, but it doesn't preserve references to the old IDs. The inspected tests don't establish that learner progress survives those replacements; that needs separate relationship handling and migration coverage.
Publishing a reviewed course revision
The transaction locks related records and replaces curriculum; progress continuity needs separate evidence.
Review and notification
Publication transaction
Database records
Scroll or drag the background to move. Use the zoom buttons to resize.Arrow keys move between components. Enter selects.
Choose a component to explore
Select a numbered component on the map or use the component menu. Its details and connections will appear here.
No component selected.
All connections (8)
- 01 · Admin course review action → 03 · CourseRevisionWorkflowServiceApprove revision · Direct call
- 03 · CourseRevisionWorkflowService → 05 · Live course recordLock and update · Direct call
- 03 · CourseRevisionWorkflowService → 06 · Reviewable revision recordLock and read · Direct call
- 03 · CourseRevisionWorkflowService → 04 · Revision-to-course relationship checkVerify parent relationship · Direct call
- 04 · Revision-to-course relationship check → 01 · Admin course review actionReject mismatched revision · Blocked / denied
- 04 · Revision-to-course relationship check → 07 · Published chapters and lessonsReplace after verification · Direct call
- 03 · CourseRevisionWorkflowService → 06 · Reviewable revision recordRemove consumed revision · Direct call
- 03 · CourseRevisionWorkflowService → 02 · Course workflow notificationsAfter transaction returns · Direct call