ayan-biswas0412 / gssoc2021-HotelOnTouch

👨‍🔧👨‍🔧Manage your all hotel services at one place - This is the project repository for HotelOnTouch Project and this project is actively looking for new contributors👨‍🔧👩‍🏫
https://hotelontouch.netlify.app
GNU General Public License v3.0
70 stars 82 forks source link

[Backend] Basic user endpoints added #112

Closed singhayushh closed 3 years ago

singhayushh commented 3 years ago

Fixes #101

Changes done

Screenshots of the changes (If any) -

User Registration - other routes have been tested as well register

API Documentation - as seen under /docs route image

Note: Please check Allow edits from maintainers. if you would like us to assist in the PR.

✅️ By submitting this PR, I have verified the following

singhayushh commented 3 years ago
1. employee can't be created using same phone or email

@ayan-biswas0412 yes, I have added a check for that. Line 17 -> for customers and line 31 -> for employees in controller/user.controller.js

singhayushh commented 3 years ago

@singhayushh I will merge your PR with first priority , please resolve the thing I have commented and ask for a review I will merge it

To make sure that no user registers as employee or customer with same phone number or email twice, I have set the email and phone number key to be unique in the mongo schema as well as provided a check whether the email or phone number exists in the database under the registering controller. I hope the raised issue is resolved.

For the check that is failing, variables from request body are needed for verifying the password and logging in the user. I have no clue why the check fails for using variables passed by the user.

aniketsingh98571 commented 3 years ago

@singhayushh You can check at the particular checks by clicking on details link it will show you where your checks are failing, please look into it....

singhayushh commented 3 years ago

@aniketsingh98571 Yes I did that. Only after checking the details, I came to know that the checking is failing because I'm using parameters that the user will pass.

And not knowing why such a check causes failure, I commented the above.

aniketsingh98571 commented 3 years ago

@singhayushh you can check on StackOverflow for the issue.

singhayushh commented 3 years ago

@aniketsingh98571 All checks have passed. I hope the PR is all good now.