# HRSpace User Stories Update
#### HRSpace is a human resources platform that supports HR in the employees' database management and paperwork process with an ease.
### User Story
HRSpace's target users are Human Resources employees who have to deal with a huge amount of paperwork and employee's information accumulation. With just a name, an email, a password, and a company name, each user can register an account as the admin for the company. Email and company are unique among the users of the platforms.
There are 3 user roles in the platform: Admin, Manager, and Staff. While the ADMIN can access all tabs, the other roles can access the allowed information.
| No. | Manager| Employee|
| -------- | -------- | -------- |
| Employees List| Can see employees' list under manager's management| Can not |
| Information| Can see employees' info under manager's management | Can see employee's info only |
| Review| Can see employees' reviews under manager's management | Can see employee's review only |
| Paperwork| Can not | Can see employee's paperwork only |
After logging in HRSpace, based on their roles, users can see a list of employees that created in the database and paginate among the list. Besides, users can search employees by name or filter by status, department, employment type.
If there's no employee yet, admin users can create a new employee by providing the requested information like name, onboarding date, department, etc.
By accessing employee detailed page, admin users can view or edit employees information. Paperwork section is the place for users to check paperwork status and generate a new paperwork in accordance with provided employee's data.
When any paperwork created successfully, a related review for that paperwork will be automatically generated. This Review section is all for paperwork renew consideration. Related persons (manager, employee, admin) will be informed about the paperwork end date at least 1-month in advance (except internship and probation paperwork will be 2 weeks)
##### AUTHENTICATION
- [x] As a user, I can sign in with my email and password.
- [x] As a user, I can sign up a new account with name, email, password, and company name
- [ ] As a user, I can stay sign in after page refresh
##### EMPLOYEES - ADMIN
- [ ] As an admin, I can see lists of employees database that I created.
- [ ] As an admin, I can search employees by name and filter by department, status, employment types
- [ ] As an admin, I can create and update employees' info
##### EMPLOYEES - MANAGER
- [ ] As a manager, I can see lists of the employees under my management.
- [ ] As a manager, I can search my employees by name and filter by department, status, employment types
- [ ] As a manager, I can see my employees' detailed information.
##### EMPLOYEES - STAFF
- [ ] As a staff, I can see my detailed information.
##### PAPERWORKS
- [ ] As a admin, I can see the paperwork list of a specific employee
- [ ] As a admin, I can update paperwork status
- [ ] As a admin, I can generate a paperwork with needed info and download it
- [ ] As a staff, I can see all my paperwork
##### REVIEWS
- [ ] As a user, I can see the list of conducted review
- [ ] As a user, I can see the review form template
- [ ] As a user, I can send the form to reviewer to collect result
- [ ] As a manager, I can see all the reviews of my employees
- [ ] As a staff, I can see my all my reviews
### API Endpoints
##### AUTH APIs
````javascript
* @route POST /auth/login
* @description Login with username and password
* @body {email, passsword}
* @access Public
````
##### USERS APIs
````javascript
* @route POST /users/register
* @description Register a new user
* @body {name, email, password, companyName}
* @access Public
````
##### EMPLOYEES APIs
````javascript
* @route POST /employees/:id
* @description Create an employee
* @body {name, onboardDate, workingEmail, employmentType, department, gender, birthday, phone, email, permanentAddress, city,... }
* @access Login Required, Admin Only
````
````javascript
* @route GET /employees&page=1&limit=10
* @description Get list of employees based on current employee role
* @query {page, limit, name, department, status, employment_types }
* @header {accessToken}
* @access Login Required, Admin & Manager Only
````
````javascript
* @route GET /employees/:id
* @description See an employee details
* @query {id}
* @header {accessToken}
* @access Login Required, Admin, Manager, Employee
````
````javascript
* @route PUT /employees/:id
* @description Update an employee profile
* @body {name, onboardDate, workingEmail, employmentType, department, gender, birthday, phone, email, permanentAddress, city,... }
* @access Login Required, Admin Only
````
##### PAPERWORKS APIs
````javascript
* @route POST /employees/:id/paperwork
* @description Create a paperwork
* @header {accessToken}
* @access Login Required, Admin Only
````
````javascript
* @route PUT /employees/:id/paperwork/:idPaper
* @description Update paperwork
* @header {accessToken}
* @access Login Required, Admin Only
````
````javascript
* @route GET /employees/:id/paperwork
* @description Get list of paperwork of a specific employee
* @header {accessToken}
* @access Login Required, Admin & Employee Only
````
##### REVIEWS
````javascript
* @route POST /employees/:id/review
* @description Create a review
* @header {accessToken}
* @access Login Required, Admin Only
````
````javascript
* @route GET /employees/:id/review
* @description Get all the review list of one employees
* @header {accessToken}
* @access Login Required, Admin, Manager, Employee
````
````javascript
* @route GET /employees/:id/review/:reviewID
* @description View a review
* @query {reviewID}
* @header {accessToken}
* @access Login Required, Admin, Manager, Employee
````
````javascript
* @route PUT /employees/:id/review/:reviewID
* @description Update a review
* @query {reviewID}
* @header {accessToken}
* @access Login Required, Admin and Manager
````
REMOVE
````javascript
* @route GET /users/:id/review/:reviewID
* @description Get review result
* @body {paperworkID}
* @access Login Required
````
### Diagram Entity
