Skip to content

Fe/be/delete apointments#82

Merged
Dmytro-Doronin merged 4 commits intodevelopfrom
FE/BE/delete-apointments
Feb 19, 2026
Merged

Fe/be/delete apointments#82
Dmytro-Doronin merged 4 commits intodevelopfrom
FE/BE/delete-apointments

Conversation

@dashaaaa21
Copy link
Contributor

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.

Знімок екрана 2026-02-19 о 10 48 56 Знімок екрана 2026-02-19 о 10 48 45

Copilot AI review requested due to automatic review settings February 19, 2026 10:08
@HackYourFutures HackYourFutures temporarily deployed to study-bridge-fe-be-dele-xthypq February 19, 2026 10:08 Inactive
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

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/:id with 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.

@HackYourFutures HackYourFutures temporarily deployed to study-bridge-fe-be-dele-xthypq February 19, 2026 10:54 Inactive
@Dmytro-Doronin Dmytro-Doronin merged commit 51410ce into develop Feb 19, 2026
2 checks passed
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.

3 participants

Comments