Skip to content

Be/subjects#114

Merged
Alaa2019-ml merged 3 commits intodevelopfrom
BE/subjects
Feb 26, 2026
Merged

Be/subjects#114
Alaa2019-ml merged 3 commits intodevelopfrom
BE/subjects

Conversation

@Dmytro-Doronin
Copy link
Contributor

Added subjects schema and subjects for filters

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 a new “subjects” domain end-to-end (DB schema → API endpoint → client query) so the Teachers filters can be populated from server-provided subjects rather than a client constant.

Changes:

  • Server: introduce Subjects schema/query/controller/router and wire them into DI + Express routing.
  • Client: add subjects API + React Query hook and pass fetched subjects into the Teachers filters (with a loading skeleton).
  • UI/util: add a Radix-based Select component and a formatDate helper; remove unused utilities/components.

Reviewed changes

Copilot reviewed 24 out of 26 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
server/src/utils/mappers/subject.mapper.ts Adds mapper from DB subject doc to API view model.
server/src/types/subjects/subjects.type.ts Defines the subjects view type returned by the API.
server/src/routes/subjectRoute.ts Adds /subjects route handler wiring to controller.
server/src/repositories/queryRepositories/subjects.query.ts Implements query to fetch all subjects from Mongo.
server/src/db/schemes/types/subjects.types.ts Adds DB type for subjects schema.
server/src/db/schemes/subjects.schema.ts Introduces Mongoose schema + model for subjects.
server/src/controllers/subjects.controller.ts Adds controller endpoint to return all subjects.
server/src/composition/compositionRoot.ts Registers Subjects controller/query in Inversify container.
server/src/composition/composition.types.ts Adds Inversify symbols for Subjects bindings.
server/src/app.ts Registers subjects router in the Express app.
client/src/util/mapSubjectToOptions.util.ts Maps API subjects to {label,value} options for UI.
client/src/util/date.util.ts Adds formatDate helper and fixes import usage.
client/src/util/createTestIdFilePath.js Removes unused test-id path helper.
client/src/pages/teachersPage/TeachersPage.tsx Fetches subjects and injects options into Filters; adds skeleton + scroll-to-top on pagination.
client/src/pages/chat/chatDialogPage/ChatDialogPage.tsx Fixes formatDate import path.
client/src/features/subjects/query/useSubjectsQuery.tsx Adds React Query hook for loading subjects.
client/src/features/queryKeys.ts Adds subjectsKey; removes unused teachers detail key.
client/src/components/ui/select/Select.tsx Adds Radix Select wrapper component.
client/src/components/teacherSection/teacherSchedule/TeacherSchedule.tsx Updates Select import path.
client/src/components/teacherProfileSection/ProfileExperienceEducation.tsx Updates Select import path.
client/src/components/teacherProfileSection/LessonForm.tsx Updates Select import path.
client/src/components/skeletons/FiltersSkeleton.tsx Adds loading skeleton for Filters sidebar.
client/src/components/filters/Filters.tsx Accepts subject options via props instead of constants.
client/src/api/subjects/subjects.type.ts Adds client-side type for subject items.
client/src/api/subjects/subjects.api.ts Adds API call to fetch all subjects.
client/src/App.tsx Removes unused App component (Router is used instead).

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

@Alaa2019-ml Alaa2019-ml merged commit 0774d5a into develop Feb 26, 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.

5 participants