Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Implements week-based teacher availability scheduling end-to-end, aligning backend API and frontend UI to save/load a full week of time ranges.
Changes:
- Replaced day-based availability endpoints/validation/types with week-based
/api/teachers/me/schedule/weekGET/PUT. - Added backend payload validation for per-day slot arrays with overlap/duplicate/range rules applied across the week.
- Wired the Teacher Profile schedule UI to load weekly availability on open and persist updates on save (with mapping between UI hour-cells and API time ranges).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/validation/availabilitySchedule/teacher/teacherScheduleValidationMiddleware.ts | Adds week-based payload + slot-rule validation; removes day-based validators. |
| server/src/types/teacher/teacher.types.ts | Replaces day/slots request body types with a week replacement payload type. |
| server/src/routes/teacherRoute.ts | Switches teacher schedule routes to GET/PUT /me/schedule/week. |
| server/src/repositories/queryRepositories/teacher.query.ts | Replaces day upsert/query with full-week replace/fetch queries. |
| server/src/controllers/teacher.controller.ts | Adds controllers for weekly fetch + replace. |
| client/src/pages/teacherProfile/scheduleMappers.ts | New UI↔API mapping utilities (grid hour cells ↔ merged weekly ranges). |
| client/src/pages/teacherProfile/TeacherProfile.tsx | Loads weekly availability on schedule open; saves weekly availability on schedule save. |
| client/src/components/teacherProfileSection/LessonSchedule.tsx | Allows onSave to be async; awaits before closing modal. |
| client/src/api/teacher/teacher.api.ts | Adds protected API calls for weekly schedule GET/PUT. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
server/src/validation/availabilitySchedule/teacher/teacherScheduleValidationMiddleware.ts
Show resolved
Hide resolved
dashaaaa21
approved these changes
Feb 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented weekly availability end-to-end for teacher profile schedule.
Backend
Added week-based schedule endpoints: PUT /api/teachers/me/schedule/week GET /api/teachers/me/schedule/week Removed day-based schedule flow (routes/controller/query/validators/types) to match current UX.
Frontend
Connected the schedule UI to the backend so teachers can save and view their weekly availability. When the schedule is opened, existing availability is loaded and shown. When changes are saved, the updated availability is sent to the backend and reflected correctly in the UI.