A brief description of what this project does and who it's for
-
Employee Management:
- Add, update, and remove employee records.
- Ensure unique employee IDs through MongoDB indexes.
- Retrieve detailed information about each employee.
-
Vehicle Management:
- Create, update, and delete vehicle records.
- Ensure unique vehicle IDs and plate numbers using MongoDB indexes.
- Retrieve detailed information about each vehicle.
-
Vehicle Allocation:
- Allocate vehicles to employees for specific dates.
- Allow vehicle allocations only for today's date or future dates, preventing allocations for past dates.
- Ensure that each vehicle can only be allocated to one employee at a time.
- Ensure that an employee can only have one active vehicle allocation.
- Update vehicle allocations before the allocated date. Updates are restricted on or after the allocation date.
-
Allocation History:
- Track vehicle allocation history, storing past allocations for reporting purposes.
- Generate reports based on allocation history.
-
Expired Allocated Vehicle Cleanup:
- Added a feature which will automatically delete the vehicle allocations after 30 days so that the vehicle can be allocated to the another employee.
Clone the project
git clone https://github.com/sin1ter/Vehicle-Allocation-System.gitGo to the project directory
cd Vehicle-Allocation-System python -m venv env
env\Scripts\activate python3 -m venv env
source env/bin/activateInstall dependencies
pip install -r requirements.txtStart the server
uvicorn main:app --reloadOpen http://127.0.0.1:8000/docs in your browser to view the interactive API documentation.
| HTTP | Endpoints | Action |
|---|---|---|
| POST | /api/employees |
To create a new employee record |
| GET | /api/employees |
To retrieve all employees |
| GET | /api/employees/:employeeId |
To retrieve details of a single employee |
| PUT | /api/employees/:employeeId |
To update the details of a single employee |
| DELETE | /api/employees/:employeeId |
To delete a single employee |
| HTTP | Endpoints | Action |
|---|---|---|
| POST | /api/vehicles |
To create a new vehicle record |
| GET | /api/vehicles |
To retrieve all vehicles |
| GET | /api/vehicles/:vehicleId |
To retrieve details of a single vehicle |
| PUT | /api/vehicles/:vehicleId |
To update the details of a single vehicle |
| DELETE | /api/vehicles/:vehicleId |
To delete a single vehicle |
| HTTP | Endpoints | Action |
|---|---|---|
| POST | /api/allocate-vehicle |
To allocate a vehicle to an employee |
| GET | /api/allocations |
To retrieve all vehicle allocations |
| GET | /api/allocations/:allocationId |
To retrieve details of a specific vehicle allocation |
| PUT | /api/allocations/:allocationId |
To update an existing vehicle allocation before the allocated date |
| DELETE | /api/allocations/:allocationId |
To delete a vehicle allocation before the allocated date |
| HTTP | Endpoints | Action |
|---|---|---|
| GET | /api/allocation-history |
To retrieve the allocation history which are presently allocated |
| GET | /api/old-allocation-history |
To retrieve all the allocation history which were many before |
👤 Symon
- Github: @sin1ter