-
Notifications
You must be signed in to change notification settings - Fork 1
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
Dev #9
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… for better code organization and readability
…il' for consistency across repositories The 'findByEmail' method in the 'UserRepositoryInMemory' and 'UserPrismaRepository' classes has been renamed to 'getByEmail' to provide a consistent naming convention across all user repositories. This improves code readability and maintainability.
…mail for better clarity and consistency
…mail for better clarity and consistency
…login method to ensure it returns a token when given valid login credentials
…ser-in-memory.repository.spec.ts 🔧 fix(auth.service.spec.ts): update test description to be more specific and accurate
…hrown when email is not found during login
…r readability and consistency 🔒 test(auth.service.spec.ts): add import statement for NotFoundError from utils/http-errors to fix missing import error
…s module to fix reference error ✅ test(auth.service.spec.ts): add test case to throw an error if password is invalid during login
…database schema 📝 chore(schema.prisma): add 'queue' model to the Prisma schema
…with name and phone properties
…ase operations related to Queue entity
…o implement QueueRepository interface This commit adds a new file `queue-prisma.repository.ts` which contains the implementation of the `QueueRepository` interface. The `QueuePrismaRepository` class provides methods for creating, retrieving, updating, and deleting queues using Prisma ORM. Currently, all methods throw an error as they are not yet implemented.
…ry interfaces - Added `QueuePrismaRepository` class that implements the `QueueRepository` interface. - The `QueuePrismaRepository` class contains methods for creating, retrieving, updating, and deleting queues. - The `QueueRepository` interface extends the `BaseRepository` interface and defines the contract for queue repositories.
…nused queue repository files The queue-prisma.repository.ts and queue.repository.ts files were removed as they were no longer being used in the project. This cleanup improves code organization and reduces clutter.
… 'queue' table 🔧 chore(schema.prisma): update 'queue' model to reflect the column name change from 'phone' to 'phoneNumber'
… for better clarity and consistency
…operations 📦 chore(queue-router): add queue router to handle queue-related requests 📦 chore(queue-router): add queue controller to handle queue-related logic 📦 chore(queue-router): add queue service to handle queue-related operations 📦 chore(queue-router): add queue create schema for request body validation
…y create a new queue in the database ✨ feat(queue-prisma.repository.ts): return the created queue object after successfully creating it in the database
…the same name already exists to prevent duplicate queues
…dpoints to ensure correct functionality
The test file 'index.spec.ts' was removed as it was no longer needed.
…er modules 🔧 fix(user-router.spec): replace prisma.user.findUnique with userRepository.getByEmail and prisma.user.create with userRepository.create to use the exported userRepository instead of prisma directly
…userRepository to improve testability and decouple from specific ORM implementation
…cking and resetting mocks 🔧 fix(user-router.spec.ts): replace sinon.stub().resolves with vi.fn().mockResolvedValue for mocking repository methods
…n().mockResolvedValue() to improve test readability and maintainability
…and maintainability 🔀 chore(index.ts): add exports for auth-router and queue-router to consolidate route exports 🔀 chore(user-router/index.ts): rename usersRouter to userRouter for consistency with file name and improve semantics
…ueue" table with "WAITING" as default value 📝 docs(schema.prisma): add "status" field to "queue" model with "WAITING" as default value and create "Status" enum with values "WAITING", "ABSENT", and "DONE"
…Repository to retrieve queues created today ✨ feat(queue.repository.ts): add getToday method to QueueRepository interface to enforce implementation in concrete repositories
…rt from 1 instead of 0 to match the first queue id 🔒 chore(queue-in-memory.repository.ts): make queues and index private to encapsulate internal state ✨ feat(queue-in-memory.repository.ts): implement deleteAll method to clear all queues in memory repository
…s to retrieve today's queues 🔧 chore(queue.service.ts): refactor create() method in QueueService class for better readability and maintainability
…se real timers, and delete all queues before each test case 🔬 test(queue.service.spec.ts): add async/await to 'Should create a queue' test case to properly handle promises 🔬 test(queue.service.spec.ts): add 'getToday' test case to test the 'getToday' method of QueueService 🔬 test(queue.service.spec.ts): add assertions to 'getToday' test case to ensure correct behavior
🐛 fix(queue.controller): use http-status-codes library to improve readability and maintainability of status codes in responses
…enRouter in the app 🔀 merge(routes/index.ts): export open-router module to allow importing and using openRouter in the app
…the status of the queue ✨ feat(queue-in-memory.repository.ts): set default status of newly created queues to 'WAITING' 🔧 fix(queue.repository.ts): add create method to QueueRepository interface to create a new queue without specifying id, status, createdAt, and updatedAt properties
…Today query to use Date objects instead of string conversion
…s of the created queue is set to 'WAITING'
…e to exclude unnecessary properties from the data parameter 🐛 fix(queue-prisma.repository.ts): fix create method signature to exclude unnecessary properties from the data parameter
…reusability and modularity 🔀 refactor(queue-router/index.ts): change route path from '/' to '/today' for better clarity and consistency
…ble for better code readability and maintainability
…eue and getting all current day customers
…to restrict access to ADMIN users 🔧 chore(queue-router): refactor POST / route to include authentication middleware before validation and controller functions
…re a length of 11 characters instead of 9 to match the expected format
… have 11 digits instead of 9 🔒 chore(queue-router.spec.ts): add authorization header to create queue test to simulate authenticated request
…columns to Open table 🔧 chore(schema.prisma): update Open model to include createdAt and updatedAt columns
…ith isOpen property
…er naming consistency and clarity
…ons related to the Open entity 📦 chore(open.repository.ts): import Open entity and BaseRepository to enable usage in the file
…tation 📦 chore(open.repository.ts): add OpenRepository type definition
…teAll methods in OpenPrismaRepository 🔥 chore(open.respository.ts): remove unused OpenRepository file
…nRepository to improve modularity and testability 🔧 refactor(open.service.ts): replace prisma.open.create with model.create to improve code readability and maintainability 🔧 refactor(open.service.ts): replace prisma.open.findUnique with model.getById to improve code readability and maintainability 🔧 refactor(open.service.ts): replace prisma.open.update with model.update to improve code readability and maintainability
… OpenPrismaRepository to improve separation of concerns and maintainability
…y class to provide in-memory storage for Open entities 🐛 fix(open-in-memory.repository.ts): fix delete method to correctly handle index not found error
…mprove reusability and modularity
…ad of "vitest" to enable running tests in development mode
…rations before running the app 🔧 chore(docker-compose.dev.yml): add db-studio service to run database migrations and seed data
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.