Skip to content

Fix/reject#157

Merged
dashaaaa21 merged 4 commits intodevelopfrom
Fix/reject
Mar 9, 2026
Merged

Fix/reject#157
dashaaaa21 merged 4 commits intodevelopfrom
Fix/reject

Conversation

@dashaaaa21
Copy link
Copy Markdown
Contributor

added feat: teacher need write explanation why reject lesson
Teacher:
Знімок екрана 2026-03-09 о 10 44 03
Student:
Знімок екрана 2026-03-09 о 10 10 16

@HackYourFutures HackYourFutures temporarily deployed to study-bridge-fix-reject-pdtydr March 9, 2026 10:02 Inactive
Copy link
Copy Markdown
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 support for requiring and storing a teacher-provided rejection explanation when an appointment/lesson is rejected, and surfaces that reason to students in the UI.

Changes:

  • Adds rejectionReason to appointment types, DB schema, and API formatting.
  • Adds server/client-side validation enforcing a 100–500 character rejection reason when status is rejected.
  • Adds a teacher-side “Reject Appointment” modal for entering the reason and a student-side display of the rejection reason.

Reviewed changes

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

Show a summary per file
File Description
server/src/validation/appointment/rejectionReasonValidation.ts Introduces reusable rejection-reason validation (currently not wired in).
server/src/validation/appointment/appointmentValidationMiddleware.ts Adds request validation for rejectionReason when rejecting.
server/src/types/appointment/appointment.types.ts Extends update-status payload type with optional rejectionReason.
server/src/services/appointment/appointment.service.ts Enforces rejection-reason rules in service layer and includes it in formatted response.
server/src/db/schemes/types/appointment.types.ts Adds rejectionReason to DB appointment type.
server/src/db/schemes/appointmentSchema.ts Adds rejectionReason field to Mongoose schema.
client/src/types/appointments.types.ts Adds rejectionReason to client appointment type.
client/src/pages/privetTeachersPages/teacherAppointments/TeacherAppointments.tsx Opens a reject modal when teacher selects “rejected”.
client/src/features/appointments/mutations/useUpdateAppointmentMutation.ts Sends rejectionReason with status update when provided.
client/src/components/ui/statusButtons/StatusButtons.tsx Avoids locally setting status to rejected (delegates rejection flow to parent/modal).
client/src/components/appointmentCard/RejectionReasonDisplay.tsx Displays rejection reason on appointment card when status is rejected.
client/src/components/appointmentCard/RejectAppointmentModal.tsx New modal to collect and validate rejection reason and submit rejection.
client/src/components/appointmentCard/AppointmentCard.tsx Renders rejection reason display section.
Comments suppressed due to low confidence (1)

server/src/services/appointment/appointment.service.ts:133

  • updateData spreads the incoming payload, so if an appointment was previously rejected and then later moved to another status without providing rejectionReason, the old reason may remain stored. Consider explicitly clearing rejectionReason when status !== "rejected" to prevent stale data from persisting.
    const updateData = {
      ...data,
      updatedAt: new Date(),
    };

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

You can also share your feedback on Copilot code review. Take the survey.

@dashaaaa21 dashaaaa21 merged commit 2e9023f into develop Mar 9, 2026
6 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.

4 participants