AI-Powered logistics and route optimization platform built with Spring Boot 3
A production-ready logistics optimization system demonstrating Clean Architecture, Domain-Driven Design, and SOLID principles.
Test Coverage
Unit Tests
Core Features
API Design
Prevents vehicle overload by validating package weight against remaining capacity before assignment.
totalWeight + currentLoad ≤ capacity
Enforces valid package status transitions to maintain data integrity throughout the delivery lifecycle.
CREATED → LOADED → DELIVERED
Automatically optimizes delivery routes by sorting packages based on delivery deadlines.
sorted(deadline ASC)
/api/vehicles
List all vehicles with capacity and status information
/api/vehicles/{id}
Get specific vehicle details by ID
/api/vehicles
Create a new vehicle with license plate and capacity
/api/packages
List all packages with delivery status and deadlines
/api/packages/unassigned
Get packages that haven't been assigned to any vehicle
/api/packages/{id}/status
Update package status (validates state machine rules)
/api/delivery/assign
Assign packages to vehicle (validates capacity guard)
/api/delivery/routes
Get all active delivery routes with package details
/api/delivery/routes/{id}/complete
Mark a delivery route as completed
POST /api/delivery/assign
Content-Type: application/json
{
"vehicleId": 1,
"packageIds": [4, 2, 5]
}
{
"id": 1,
"vehicleId": 1,
"vehicleLicensePlate": "ABC-1234",
"packages": [
{
"id": 4,
"weightKg": 500.0,
"status": "LOADED",
"deliveryDeadline": "2025-12-10T13:45:06"
},
{
"id": 2,
"weightKg": 250.0,
"status": "LOADED",
"deliveryDeadline": "2025-12-10T14:45:06"
}
],
"totalWeight": 950.0
}
{
"status": 400,
"error": "Vehicle Overload",
"message": "Vehicle 'ABC-1234' cannot load package of 950.00 kg. Remaining capacity: 550.00 kg"
}