The Order Processing System is a backend application designed to handle order processing for an e-commerce platform. It includes functionalities for creating orders, updating order status, and retrieving order history.
- Java 17
- Spring Boot
- Hibernate (JPA)
- H2 Database (for testing purposes)
- Maven
- Java Development Kit (JDK) 8 or higher
- Maven 3.6.0 or higher
- Clone the repository:
git clone https://github.com/SeanXIV/Order-Processing-API.git
- Navigate to the project directory:
cd order-processing-system - Build the project using Maven:
mvn clean install
- Run the Spring Boot application:
mvn spring-boot:run
- The application will start on
http://localhost:8080.
- Method: POST
- URL:
/api/orders - Headers:
Content-Type: application/json
- Body (JSON):
{ "customer": "John Doe", "items": ["item1", "item2"], "status": "PENDING" } - Expected Response:
- Status: 201 Created
- Body:
{ "id": 1, "customer": "John Doe", "items": ["item1", "item2"], "status": "PENDING", "orderDate": "2025-01-10T09:00:00" }
- Method: GET
- URL:
/api/orders - Expected Response:
- Status: 200 OK
- Body:
[ { "id": 1, "customer": "John Doe", "items": ["item1", "item2"], "status": "PENDING", "orderDate": "2025-01-10T09:00:00" } ]
- Method: GET
- URL:
/api/orders/{id} - Expected Response:
- Status: 200 OK
- Body:
{ "id": 1, "customer": "John Doe", "items": ["item1", "item2"], "status": "PENDING", "orderDate": "2025-01-10T09:00:00" }
- Method: PUT
- URL:
/api/orders/{id} - Headers:
Content-Type: application/json
- Body (JSON):
{ "status": "COMPLETED" } - Expected Response:
- Status: 200 OK
- Body:
{ "id": 1, "customer": "John Doe", "items": ["item1", "item2"], "status": "COMPLETED", "orderDate": "2025-01-10T09:00:00" }
- Method: DELETE
- URL:
/api/orders/{id} - Expected Response:
- Status: 200 OK
- Body:
"Order deleted successfully with ID: 1"
- Method: GET
- URL:
/api/orders/history - Query Parameters:
customer - Expected Response:
- Status: 200 OK
- Body:
[ { "id": 1, "customer": "John Doe", "items": ["item1", "item2"], "status": "PENDING", "orderDate": "2025-01-10T09:00:00" } ]
For any questions or feedback, please contact andrewseanego14@gmail.com.