- To track corporate assets such as phones, tablets, laptops and other gears handed out to employees.
- 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
I have used Django Rest Framework for creating the API's.
I have used SQLITE3 database for this project.
I have used Django ORM for database operations.
I have used Django Serializer for creating the serializers.
I have used Django Rest Framework Spectacular for creating the API documentation.
I have used Pytest for creating the tests.
I have used Postman & swagger for testing the API's.
-
Run the following commands:
- py manage.py makemigrations
- py manage.py migrate
- py manage.py createsuperuser
- py manage.py runserver
-
Following url for performing API testing in swagger:
-
You can also run the tests using the following command:
- pytest
-
API documentation using the following url:
This implementation has 4 main models: Company, Device, Employee, and DeviceAssign.
Companystores information about the companies using the app.Employeerepresents the company's staff, with a one-to-one relationship to a Django user and employee belongs to the company.Devicerepresents the corporate assets, with information such as their name, description, serial number, condition, and which company they belong to.DeviceAssignrepresents the assignments of devices to employees, with a foreign key to both the Device and Employee models, as well as the assignment and return dates with device conditions
Compaines API Routes
Devices API Routes
Employess API Routes