Skip to content

feat(course-registry): add enroll_many batch enrollment operation - #74

Open
Degentle12 wants to merge 1 commit into
Kqirox:mainfrom
Degentle12:issue-31-enroll-many
Open

feat(course-registry): add enroll_many batch enrollment operation#74
Degentle12 wants to merge 1 commit into
Kqirox:mainfrom
Degentle12:issue-31-enroll-many

Conversation

@Degentle12

Copy link
Copy Markdown

Problem

Course-registry has only single-learner enrollment. A 100-learner cohort onboarding requires 100 separate transactions.

Solution

  • enroll_many(env, admin, learners: Vec<Address>, id) -> Vec<bool> — Admin-authorized batch enrollment for cohort onboarding.
  • Returns true for each newly-enrolled learner, false for already-enrolled (skipped).
  • Does not abort on partial failure — each learner is processed independently.
  • Validates course exists and is active before processing.
  • 7 unit tests covering: success, partial duplicates, empty vec, all-already-enrolled, unauthorized admin, nonexistent course, and inactive course.

Closes #31

- Add enroll_many(env, admin, learners, id) -> Vec<bool> for cohort onboarding
- Admin-authorized batch enrollment that does not abort on partial failure
- Returns true for each newly-enrolled learner, false for already-enrolled
- Validates course exists and is active before enrolling each learner
- Add 7 unit tests: success, partial duplicates, empty vec,
  all-already-enrolled, unauthorized admin, nonexistent course,
  and inactive course scenarios

Closes Kqirox#31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[31] Add vec/batch operations to course-registry: enroll many, complete many

1 participant