datrujillog / barFinder360

barFinder360
0 stars 0 forks source link

Refactor codebase and add new features #3

Closed datrujillog closed 7 months ago

datrujillog commented 7 months ago

This pull request includes multiple commits that refactor the codebase, improve performance and readability, fix bugs, and add new features. The changes include refactoring the OrderService class and adding the OrderRepository, adding the restaurantRepository.js file, fixing error handling in the createOrder method, refactoring the createOrder method in restaurantRepository.js, removing unnecessary comments and improving code readability in orderService.js, removing unnecessary console.log statements, updating the restaurantRepository.js to use the OrderModel and adding the orderUpdate method, fixing function names in orderRouter.js, removing server startup code, fixing bugs in the login functionality, adding Swagger documentation support, updating the authRouter.js to use versioned API endpoints, adding the orderList method to restaurantRepository.js, refactoring code to improve performance and readability, updating imports and method names in orderService.js, removing the restaurantRepository.js file, adding the OrderRepository class with createOrder, orderList, findOrderById, and updateOrderById methods, fixing function names in orderRouter.js, refactoring the orderRepository.js to use the orderModel for querying bar_orders, fixing function calls in orderRouter.js, refactoring the orderList method and adding the deleteOrder method, renaming the orderList method in orderService.js, renaming the createOrder and deleteOrder methods in orderRepository.js, fixing method names in orderService.js, refactoring the order deletion logic and error handling, fixing order creation bugs and removing commented code, refactoring the order deletion in OrderRepository, adding the UserRepository class with createUsers, listOrders, findOrderById, updateOrderById, and deleteOrders methods, refactoring the userRouter.js to handle user creation and retrieval, refactoring the roleById method to include the businessId parameter, refactoring the user creation and retrieval logic, fixing bugs in the login functionality, refactoring the userRouter.js to handle authentication and error handling, refactoring the createUser and addUser methods, refactoring the createToken function, fixing token verification in authResponse function, adding the findUserByEmail method to UserRepository, fixing login error handling in authRouter.js, fixing login bugs and improving error handling in AuthService, fixing user search by email bug, refactoring the userRouter.js to improve error handling and response payload, refactoring the auth middleware to use dataToken instead of token, refactoring the createUser and byEmailUser methods in UserService, fixing error handling in authService and userService, merging pull request #2 from datrujillog/feature/user-repository, refactoring the authRouter.js to improve code readability and error handling, adding the parserUserAuth function to normalizeData.js, updating response.js to use payload instead of user, adding the AuthRepository class, adding the businessRepository with createBusiness and findBusinessById methods, adding authentication and error handling to the business list endpoint, adding the business and user repositories, normalizing data, and updating the signup method, refactoring the BusinessService to extend businessRepository, refactoring the businessService.js to use BusinessRepository, refactoring the businessRepository class and implementing new methods, fixing import and variable names in businessRouter.js, adding VS Code settings and updating businessRouter.js and businessService.js, removing unnecessary blank lines and unused code in BusinessRepository.js, and adding the findUserByBusiness method to UserRepository.