Skip to content

Conversation

@jeromehardaway
Copy link
Contributor

Enrollment API Enhancements:

  • Extended /api/enrollment/enroll to support GET requests
  • Fetch user enrollments with course details
  • Order enrollments by most recent first

Courses Index Page Updates:

  • Added enrollment status fetching on page load
  • Display "Enrolled" badge on enrolled verticals
  • Dynamic button text ("Continue Learning" vs "View Vertical")
  • Vertical-to-course mapping for enrollment checking
  • Support for Software Engineering, Data Engineering, and AI Engineering verticals

Individual Course Page Updates (software-engineering.tsx):

  • Fetch and display enrollment status
  • Show "You're enrolled" badge when user is enrolled
  • Display "Enroll in Vertical" CTA when not enrolled
  • Placeholder enrollment handler (to be configured with actual course IDs)
  • Real-time enrollment state management

Student Benefits:

  • Clear visibility into enrollment status across all verticals
  • Streamlined navigation with contextual CTAs
  • Consistent enrollment experience across course pages
  • Foundation for future enrollment automation

Enrollment API Enhancements:
- Extended /api/enrollment/enroll to support GET requests
- Fetch user enrollments with course details
- Order enrollments by most recent first

Courses Index Page Updates:
- Added enrollment status fetching on page load
- Display "Enrolled" badge on enrolled verticals
- Dynamic button text ("Continue Learning" vs "View Vertical")
- Vertical-to-course mapping for enrollment checking
- Support for Software Engineering, Data Engineering, and AI Engineering verticals

Individual Course Page Updates (software-engineering.tsx):
- Fetch and display enrollment status
- Show "You're enrolled" badge when user is enrolled
- Display "Enroll in Vertical" CTA when not enrolled
- Placeholder enrollment handler (to be configured with actual course IDs)
- Real-time enrollment state management

Student Benefits:
- Clear visibility into enrollment status across all verticals
- Streamlined navigation with contextual CTAs
- Consistent enrollment experience across course pages
- Foundation for future enrollment automation
@jeromehardaway jeromehardaway requested a review from Copilot January 1, 2026 03:40
@jeromehardaway jeromehardaway self-assigned this Jan 1, 2026
@vercel
Copy link
Contributor

vercel bot commented Jan 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
vets-who-code-app Ready Ready Preview, Comment Jan 1, 2026 3:43am

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds enrollment status visibility and management to the course platform. It enables users to see which verticals they're enrolled in and provides contextual CTAs based on enrollment state.

Key Changes:

  • Extended the enrollment API endpoint to support GET requests for fetching user enrollments with course details
  • Added enrollment status indicators ("Enrolled" badges) to course vertical cards on the index page
  • Implemented dynamic CTA text that changes from "View Vertical" to "Continue Learning" for enrolled verticals

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/pages/api/enrollment/enroll.ts Added GET method support to fetch user enrollments with course details, ordered by enrollment date
src/pages/courses/index.tsx Added enrollment fetching, vertical-to-course mapping, status badges, and dynamic button text based on enrollment state
src/pages/courses/software-engineering.tsx Added enrollment status display with "You're enrolled" badge and placeholder enrollment handler for individual course page

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +70 to +79
const isEnrolledInVertical = (verticalSlug: string): boolean => {
const matchingTitles = verticalCourseMap[verticalSlug] || [];
return enrollments.some(
(enrollment) =>
enrollment.status === "ACTIVE" &&
matchingTitles.some((title) =>
enrollment.courseId.toLowerCase().includes(title.toLowerCase())
)
);
};
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enrollment check is comparing the courseId field with course title strings, but based on the API response structure, courseId is likely an ID (string), not a title. The comparison should use enrollment.course.title instead of enrollment.courseId to properly match against the title patterns in verticalCourseMap.

Copilot uses AI. Check for mistakes.
Comment on lines +137 to +146
const isEnrolled = (): boolean => {
const matchingTitles = ["Software Engineering", "Full-Stack Development", "Web Development"];
return enrollments.some(
(enrollment) =>
enrollment.status === "ACTIVE" &&
matchingTitles.some((title) =>
enrollment.courseId.toLowerCase().includes(title.toLowerCase())
)
);
};
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enrollment check is comparing courseId with course title strings, but courseId is an ID field, not a title. Based on the API response that includes course details, this should use enrollment.course.title instead of enrollment.courseId.

Copilot uses AI. Check for mistakes.
Comment on lines 9 to +14

type Enrollment = {
id: string;
courseId: string;
status: string;
progress: number;
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Enrollment type definition doesn't match the API response structure. According to the API implementation in enroll.ts, enrollments include a nested course object with fields like id, title, description, imageUrl, difficulty, and category. The type should include a course property with these fields.

Suggested change
type Enrollment = {
id: string;
courseId: string;
status: string;
progress: number;
type CourseInfo = {
id: string;
title: string;
description: string;
imageUrl: string;
difficulty: string;
category: string;
};
type Enrollment = {
id: string;
courseId: string;
status: string;
progress: number;
course: CourseInfo;

Copilot uses AI. Check for mistakes.
id: string;
courseId: string;
status: string;
progress: number;
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Enrollment type definition doesn't match the API response structure. The API returns enrollments with a nested course object containing id, title, description, imageUrl, difficulty, and category fields. Update the type to include a course property with these fields.

Suggested change
progress: number;
progress: number;
course: {
id: string;
title: string;
description: string;
imageUrl: string;
difficulty: string;
category: string;
};

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented Jan 1, 2026

🔍 Code Quality Score Breakdown:

  • 📖 Readability: 2/10
  • 📈 Scalability: 5/10
  • 🚀 Performance: 5/10
  • 🛠️ Maintainability: 8/10
  • ✅ Overall Score: 5.0/10

💡 Recommendations:

  • 🧹 Reduce ESLint warnings to improve readability.
  • 📦 Break up complex functions or components.
  • ⚙️ Consider splitting large files or lazy-loading.
  • 🔁 Refactor to increase your overall score next cycle.

@jeromehardaway jeromehardaway merged commit d49f68d into master Jan 1, 2026
5 checks passed
@jeromehardaway jeromehardaway deleted the feat/phase-2-enrollment-flow branch January 1, 2026 03:45
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.

2 participants