Summary:
This pull request adds the user model to the application, which will be used to store user information in the database. The user model includes fields for basic user information, authentication, and password reset functionality.
Changes Made:
Created a new user schema using Mongoose to define the structure of the user document.
Added fields for user ID, name, username, profile picture, email, password, date of birth, address, phone number, role, registration date, last login date, reset password token, and reset password expiration.
Implemented appropriate validation and constraints for required fields and uniqueness of certain fields (e.g., username, email).
Included functionality for generating and storing a unique password reset token and managing its expiration date.
Add User Model
Summary: This pull request adds the user model to the application, which will be used to store user information in the database. The user model includes fields for basic user information, authentication, and password reset functionality.
Changes Made:
Created a new user schema using Mongoose to define the structure of the user document.
Added fields for user ID, name, username, profile picture, email, password, date of birth, address, phone number, role, registration date, last login date, reset password token, and reset password expiration.
Implemented appropriate validation and constraints for required fields and uniqueness of certain fields (e.g., username, email).
Included functionality for generating and storing a unique password reset token and managing its expiration date.