Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OVERVIEW

  • You have been hired as a developer for a new project where,
  • You will write a Django app to track corporate assets such as phones, tablets, laptops and other gears handed out to employees.

GOALS

  • The application might be used by several companies
  • Each company might add all or some of its employees
  • Each company and its staff might delegate one or more devices to employees for a certain period of time
  • Each company should be able to see when a Device was checked out and returned
  • Each device should have a log of what condition it was handed out and returned

DESIGN

A class rough diagram of the implementation:

Class Diagram

USAGE

  1. create venv inside root folder
  2. activate source
  3. makemigrations and migrate
  4. runserver

APIs and URLs

Root URL

Company URLs

Device URLs

  • Add new Devices to logged in company: http://127.0.0.1:8000/api/devices/add

    • POST Format
      [
          { "device_name": "iphone 11 pro max - 786", "status" : "used" },
          { "device_name": "iphone 12 pro max - 921", "status" : "broken" },
          { "device_name": "iphone 13 pro max - 101", "status" : "new" },
          { "device_name": "iphone 14 pro max - 211", "status" : "new" },
          { "device_name": "iphone 15 pro max - 311", "status" : "new" }
      ]
      
  • List all devices of logged in company: http://127.0.0.1:8000/api/devices/list

Employee URLs

DeviceLog URLs

  • Delegate devices to employees to employees of logged in company: http://127.0.0.1:8000/api/devices/delegate

    • POST Format (Assumption: Front-end will display list of selectable valid Devices and Employees)
      [
          { "device_name": "iphone 11 pro max - 786", "employee_name" : "blu" },
          { "device_name": "iphone 12 pro max - 921", "employee_name" : "blu" },
          { "device_name": "iphone 13 pro max - 101", "employee_name" : "saif" },
          { "device_name": "iphone 14 pro max - 211", "employee_name" : "saif" },
          { "device_name": "iphone 15 pro max - 311", "employee_name" : "purba" }
      ]        
      
  • Return a device delegated to an employee: http://127.0.0.1:8000/api/devices/return

    • POST Format (Assumption: Returns are made one by one)
      {
          "device_name": "iphone 11 pro max - 786",
          "employee_name": "blu",
          "return_condition": "broken"
      }        
      
  • List all delegations of company devices: http://127.0.0.1:8000/api/devices/delegations

About

A Django app (DRF Backend only) to track corporate assets such as phones, tablets, laptops and other gears handed out to employees.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages