A new device, upon enrolling, will be assigned to one of the employees. The details of the assigned device will be shared to the employee via email.
Whenever an employee is created he/she is allocated an EMPLOYEE_ID, for the inputs taken as FIRST_NAME, LAST_NAME, E_MAIL, and MOBILE_NUMBER.
Each employee can be assigned more that one device that is identified by an DEVICE_ID.
Create a flask app to replicate CRUD operations:
- Create an Employee
- Update Employee details
- Create Device
- Update Device Details
- Assign a device to an employee
Whenever a device is assigned or unassigned send out the details of the same to the corresponding employee as an e-mail.
git clone https://github.com/akshaybabu09/employee-device-manager.git
cd employee-device-manager
sudo apt-get update
sudo apt-get install python3.6
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
export HOST_EMAIL='yourmail@gmail.com'
export HOST_PASSWORD='yourpassword'
export APP_SETTINGS="config.ProductionConfig"
export DATABASE_NAME='manager_db'
export DATABASE_USER='manager'
export DATABASE_PASSWORD='manager*1243'
export DATABASE_HOST='localhost'
export DATABASE_URL="postgresql://manager:manager*1243@localhost:5433/manager_db"
python manage.py db init
python manage.py db migrate
python manage.py db upgrade
python manage.py runserver
export HOST_EMAIL='yourmail@gmail.com'
export HOST_PASSWORD='yourpassword'
export APP_SETTINGS="config.ProductionConfig"
export DATABASE_NAME='manager_db'
export DATABASE_USER='manager'
export DATABASE_PASSWORD='manager*1243'
export DATABASE_HOST='localhost'
export DATABASE_URL="postgresql://manager:manager*1243@localhost:5433/manager_db"
celery -A manage.celery worker -l info
URL: /api/v1/employee/enroll
FIRST_NAME:
LAST_NAME:
CONTACT:
EMAIL:
A unique 6 digit EMPLOYEE_ID will be generated & the PASSWORD will be set as contact.
URL: /api/v1/employee/login
EMP_ID:
PASSWORD:
Receives a Token.
URL: /api/v1/employee/update
Header: {access-token : <token received upon Login>
CONTACT:
EMAIL:
ADDRESS:
PINCODE:
URL: /api/v1/employee/details
Header: {access-token : <token received upon Login>
URL: /api/v1/employee/
Header: {access-token : <token received upon Login>
URL: /api/v1/employee/remove
Header: {access-token : <token received upon Login>
EMP_ID:
URL: /api/v1/device/enroll
Header: {access-token : <token received upon Login>
NAME:
MANUFACTURER:
MODEL:
DEVICE_ID:
EMP_ID:
Device ID should be unique.
Once the device is successfully enrolled the device details will be shared to the employee via Email.
URL: /api/v1/device/update
Header: {access-token : <token received upon Login>
NAME:
MANUFACTURER:
MODEL:
DEVICE_ID: (To fetch the device object.)
URL: /api/v1/device/details
Header: {access-token : <token received upon Login>
URL: /api/v1/device/details?device_id=DEVICE_ID
Header: {access-token : <token received upon Login>
URL: /api/v1/device/remove
Header: {access-token : <token received upon Login>
DEVICE_ID:
Once the device is successfully removed (soft delete) the device details will be shared to the employee
via Email.