This is a simple microservice project that was created to practice my DHL E-Commerce interview. It takes an order and returns the rate of the package. This project sets some good standards of Java 21, SpringBoot, JPA, and Docker.
- Java 21 (or your project's required version)
- Gradle 7.x+
- Docker & Docker Compose
- (Optional) Kotlin plugin for your IDE
git clone https://github.com/machine88/order.git
cd your-repo./gradlew clean build./gradlew bootRun./gradlew testdocker-compose up --builddocker-compose downdocker-compose logs -f-
POST
/api/orders -
Request Body (JSON):
{ "customerName": "John Doe", "destinationCountry": "DE", "serviceLevel": "EXPRESS", "packages": [ { "weightKg": 2.5, "lengthCm": 30.0, "widthCm": 20.0, "heightCm": 10.0 }, { "weightKg": 1.2, "lengthCm": 15.0, "widthCm": 10.0, "heightCm": 5.0 } ] } -
GET
/api/orders/{orderId} -
Response (
200 OK):{ "orderId": 123, "customerName": "John Doe", "destinationCountry": "DE", "serviceLevel": "EXPRESS", "packages": [ { "weightKg": 2.5, "lengthCm": 30.0, "widthCm": 20.0, "heightCm": 10.0 }, { "weightKg": 1.2, "lengthCm": 15.0, "widthCm": 10.0, "heightCm": 5.0 } ], "rate": 12.99, "currency": "EUR", "status": "CREATED" }