Skip to content

omelinb/hr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

      Application for creating, retrieving, listing and deleting employees inside company.
      After creating employee will get email with login and password.
      Each employee with department HR will get staff status.

Installing

$ pip install -r requirments.txt  
$ python3 manage.py makemigrations  
$ python3 manage.py migrate  
$ python3 manage.py loaddata fixtures.json  
$ python3 manage.py runserver  

      It will create a database with following employees:

  • login: admin, password: admin123
  • login: HRUser, password: LDJ7LZ59
  • login: Buyer, password: CGP7RNGG

Endpoints

  • /api/employees/ GET list of employees
  • /api/employees/ POST create employee (staff only)
  • /api/employees/:id/ GET retrieve employee
  • /api/employees/:id/ PUT update employee (staff only)
  • /api/employees/:id/ PATCH partial update (owner only)
  • /api/employees/:id/ DELETE delete employee (staff only)

Usage with curl

      Create new employee with
           username "NewUser"
           rank "Senior
           department "Digital"
           email "[email protected]":

curl -u HRUser -d "username=NewUser&rank=S&department=DG&[email protected]" -X POST http://localhost:8000/api/employees/

      Get list of employees:

curl http://localhost:8000/api/employees/  

      Retrieve data of employee with id 3:

curl http://localhost:8000/api/employees/3/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages