Users Model

The users model has the following endpoints:

ActionMethodResourceDescription
Get users GET/usersGet all users of the project.
Get user GET/users/user_idGet user with id user_id.
Create POST/usersCreate a new user.
Update POST/users/user_idUpdate user with id user_id.
Delete DELETE/users/user_idDelete user with id user_id.

The users model has the following attributes:

AttributeTypeRequiredDescriptionWhereable
name stringnoThe user's first and/or middle name.Yes
middle_namestringnoThe user's middle nameYes
lastname stringnoThe user's last name.Yes
second_lastnamestringnoThe user's second lastname
email stringno, required to create.The user's email.Yes
password stringno, required to create.The user's password, minimum 8 characteres.No
photo base64 string, url image or file imagenoThe user's photo.No
birthdate datenoThe user's birthdate, with format MM/DD/YYYY (e.g. "12/31/2018")Yes
cellphone stringnoThe user's cellphone, minimum 10 characteres.Yes
country_phone_codeintegernoNo
address stringnoThe user's address.Yes
address_notes stringnoThe user's address notes. (e.g "Second floor")No
zipcode stringnoThe user's zip code/postal code.Yes
location jsonnoThe user's position. (e.g. "{"lat": 10, "lng": 10}").No
levelintegernoThe user's role.Yes
busy booleannoThe user's status (e.g. if the driver is busy with an assigned order).Yes
available booleannoThe user's status (e.g. if the driver is available to assign order).Yes
enabled booleannoThe user's status.Yes

User levels

User level is used to control the access to the different functionalities by discriminating by the type of user. Users levels are listed bellow:

LevelType of userDescription
0Administrator- Full user-level access to all API endpoints.
Example: The administrator can see all the users, businesses, orders and settings.
1City managerFunctionality coming soon
2Business owner- Access to some Admin API endpoints.
- Access to all the Store Front API endpoints.
Example: The store owner can see all the businesses assigned to his account and all the orders placed to any of his businesses.
3Customer- Access to all the Store Front API endpoints.
Example: The customer can see all the orders placed by him.
4Driver- Access to some Admin API endpoints.
- Access to all the Store Front API endpoints.
Example: The driver can see all the orders assigned to his user.
5Driver managerFunctionality coming soon