Spring Boot application designed to manage orders and centers. It includes functionalities for creating orders, allocating them to centers, and managing center capacities. This project was build for the INDITEX Java Backend challenge, UI maded in Vue with Nuxt and Mapbox for fun just to have a more friendly way to test the api.
UI LINK: https://github.com/CoderAnchel/Logistics-UI
- Create and manage orders
- Allocate orders to the nearest available center
- Manage center capacities and statuses
- RESTful API with endpoints for orders and centers
- Clone the repository:
git clone https://github.com/CoderAnchel/magic-eagle-learning.git
- Navigate to the project directory:
cd magic-eagle-learning
- Build the project using Maven:
mvn clean install
- Run the application:
mvn spring-boot:run
Once the application is running, you can access the API at http://localhost:8080
.
-
Create Order
POST /orders/create
Request Body:
{ "customerId": 1, "size": "large", "coordinates": { "latitude": 42.3601, "longitude": -71.0589 } }
-
Allocate Orders
GET /orders/allocation
-
Get All Orders
GET /orders/all
-
Get All Centers
GET /centers
-
Create Center
POST /centers
Request Body:
{ "name": "Center 1", "status": "Available", "capacity": "large", "maxCapacity": 100, "currentLoad": 0, "coordinates": { "latitude": 42.3601, "longitude": -71.0589 } }
-
Get Center Distance
POST /centers/distance/all
Request Body:
{ "latitude": 42.3601, "longitude": -71.0589 }
-
Get Nearest Center
POST /centers/distance/nearest
Request Body:
{ "latitude": 42.3601, "longitude": -71.0589 }
-
Update Center
PATCH /centers/update/{id}
Request Body:
{ "name": "Updated Center", "status": "Full", "capacity": "medium", "maxCapacity": 150, "currentLoad": 75, "coordinates": { "latitude": 42.3601, "longitude": -71.0589 } }