Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds appointment deletion support (limited to past appointments owned by the current user) and extends the appointments UI to support selecting past appointments (including “Select All” past) and deleting individually or in bulk. Also aligns appointment payload fields to consistently use teacherId / studentId and improves schedule time-slot availability by filtering out already-approved bookings.
Changes:
- Backend: add
DELETE /api/appointments/:idwith ownership + “past only” enforcement. - Frontend: add per-row and bulk deletion flows in appointments tables with “select past only” behavior.
- Data/model alignment: switch client/server appointment response fields to
teacherId/studentId, and update booking/schedule date handling + filtering of booked slots.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/services/appointment/appointment.service.ts | Adds delete logic + updates appointment response shape to teacherId/studentId. |
| server/src/routes/appointmentRoute.ts | Registers DELETE /:id route. |
| server/src/repositories/commandRepositories/appointment.command.ts | Adds DB delete command method. |
| server/src/controllers/appointment.controller.ts | Adds delete controller returning 204. |
| client/src/types/appointments.types.ts | Makes teacherId/studentId required on Appointment. |
| client/src/pages/privetTeachersPages/teacherAppointments/TeacherAppointments.tsx | Adds selection state + single/bulk deletion for teacher appointments. |
| client/src/pages/privateStudentsPages/clientsAppointments/ClientsAppointments.tsx | Adds selection state + single/bulk deletion for student/teacher view. |
| client/src/features/appointments/query/useTeacherAppointmentsQuery.ts | Allows optional teacherId override for fetching teacher appointments. |
| client/src/features/appointments/mutations/useUpdateAppointmentMutation.ts | Improves invalidation + adds success/error notifications. |
| client/src/features/appointments/mutations/useDeleteAppointmentMutation.ts | New mutation for deleting appointments + cache invalidation + notifications. |
| client/src/features/appointments/mutations/useCreateAppointmentMutation.ts | Adds teacher-appointments invalidation on successful booking. |
| client/src/components/teacherSection/teacherSchedule/Time/Time.tsx | Removes default slots; shows “no available slots” message when empty. |
| client/src/components/teacherSection/teacherSchedule/TeacherSchedule.tsx | Filters available slots by removing times already booked by approved appointments. |
| client/src/components/table/LessonsTableHeader.tsx | Adds select-all control and bulk delete action in table header. |
| client/src/components/table/LessonsTable.tsx | Implements selection tracking, select-all (past-only), and selection callbacks. |
| client/src/components/table/LessonRow.tsx | Disables selection for non-selectable rows and adds per-row delete affordance. |
| client/src/components/clientsDashboard/MyLessonsSection.tsx | Updates displayed teacher field to teacherId. |
| client/src/components/bookingConfirmation/BookingConfirmation.tsx | Uses local-date formatting to avoid timezone shift when sending booking date. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
client/src/features/appointments/mutations/useDeleteAppointmentMutation.ts
Show resolved
Hide resolved
client/src/components/teacherSection/teacherSchedule/TeacherSchedule.tsx
Outdated
Show resolved
Hide resolved
client/src/features/appointments/query/useTeacherAppointmentsQuery.ts
Outdated
Show resolved
Hide resolved
client/src/pages/privetTeachersPages/teacherAppointments/TeacherAppointments.tsx
Show resolved
Hide resolved
client/src/pages/privateStudentsPages/clientsAppointments/ClientsAppointments.tsx
Show resolved
Hide resolved
Dmytro-Doronin
approved these changes
Feb 19, 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.
On the Appointments page in the private dashboard, both teachers and students can delete only their own past appointments (future appointments cannot be deleted), they can select and delete individual old appointments, and when clicking “Select All,” only past appointments are selected and can be deleted.