-
Notifications
You must be signed in to change notification settings - Fork 0
Feat: Service Model #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements a Service model for managing faculty services (like shops, cafeterias, etc.) with scheduling capabilities, addressing issue #48. However, it's missing the critical relationship to Faculty that was specified in the requirements.
Key Changes:
- Created Service, Schedule, and TimeInterval entities with relationships for managing services and their operating hours
- Implemented CRUD operations in ServicesService and ServicesController with JWT authentication for mutations
- Added database seeding and factory support for generating test data
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| src/services/entity/service.entity.ts | Defines the Service entity with name, email, location, phone number, and schedule relationship |
| src/services/entity/schedule.entity.ts | Defines Schedule entity as a container for multiple time intervals |
| src/services/entity/timeInterval.entity.ts | Defines TimeInterval entity for storing opening/closing hours per day of week |
| src/services/dto/create-service.dto.ts | DTO for creating services with validation decorators |
| src/services/dto/update-service.dto.ts | DTO for updating services, extends CreateServiceDto as partial |
| src/services/services.service.ts | Business logic for CRUD operations with transaction handling |
| src/services/services.controller.ts | REST API endpoints with Swagger documentation and JWT guards |
| src/services/services.module.ts | Module configuration registering entities and providers |
| src/services/services.service.spec.ts | Basic service unit test setup |
| src/services/services.controller.spec.ts | Basic controller unit test setup |
| src/database/factories/service.factory.ts | Faker factory for generating service test data |
| src/database/seeds/service.seeder.ts | Seeder for populating database with services |
| src/database/seed.ts | Updated to include Service entities in seed configuration |
| src/app.module.ts | Registered ServicesModule in application |
| package-lock.json | Dependency lock file updates (dev dependency changes) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @Column() | ||
| email?: string; | ||
|
|
||
| /** | ||
| * The service location. | ||
| * @example 'B-142' | ||
| */ | ||
|
|
||
| @Column() | ||
| location: string; | ||
|
|
||
| /** | ||
| * The service's phone number. | ||
| * @example '+315 999999999' | ||
| */ | ||
| @Column() | ||
| phoneNumber?: string; |
Copilot
AI
Dec 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional fields should be marked as nullable in the database schema. Add { nullable: true } to the @column decorator for email and phoneNumber fields to properly reflect that these fields are optional, preventing potential database constraint issues.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Closes #48
Closes #49