Skip to content

Conversation

@AugustoVSoares
Copy link

@AugustoVSoares AugustoVSoares commented Dec 27, 2025

Closes #48
Closes #49

@AugustoVSoares AugustoVSoares changed the title feat: service Model Feat: Service Model Dec 27, 2025
Copy link

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

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.

Comment on lines +30 to +46
@Column()
email?: string;

/**
* The service location.
* @example 'B-142'
*/

@Column()
location: string;

/**
* The service's phone number.
* @example '+315 999999999'
*/
@Column()
phoneNumber?: string;
Copy link

Copilot AI Dec 27, 2025

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.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

Create /service endpoint Create Service model

2 participants