Course Enrollment API Client
Component Detail
Infrastructure
low complexity
mobile
1
Dependencies
0
Dependents
2
Entities
0
Integrations
Description
Flutter REST client handling all HTTP communication for the course registration feature. Wraps the shared JWT HTTP Client with endpoint-specific request/response models for courses and enrollments, including error mapping to BLoC-consumable failure types.
course-enrollment-api-client
Responsibilities
- Serialize and deserialize course and enrollment API payloads
- Map HTTP error codes (409 Conflict for capacity, 404 for course not found) to typed failures
- Expose typed methods for list, enroll, unenroll, and status endpoints
- Reuse shared JWT token injection from the existing auth infrastructure
Interfaces
getCourses(organizationId): Future<List<Course>>
getCourseById(courseId): Future<Course>
postEnrollment(courseId): Future<Enrollment>
deleteEnrollment(enrollmentId): Future<void>
getMyEnrollments(): Future<List<Enrollment>>
Relationships
Related Data Entities (2)
Data entities managed by this component