Repository navigation
Feature(CS/2020/007): Order service project initialize - #1
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds the initial Spring Boot–based Order Service, including persistence (JPA/PostgreSQL), REST endpoints for orders and a sample product catalog, OpenAPI/Swagger documentation, and basic exception handling/configuration to support local development.
Changes:
- Added core domain model (Order/OrderItem/OrderStatus), repository, service workflow, and mapping to API DTOs.
- Introduced REST controllers for creating orders and browsing a sample in-memory product catalog, with global exception handling and OpenAPI config.
- Added PostgreSQL + Spring Data JPA + Springdoc + dotenv dependencies and local dev infra via Docker Compose and environment variable examples.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/resources/application.yml | Adds datasource/JPA and springdoc configuration. |
| src/main/java/com/example/orderservice/service/OrderServiceImpl.java | Implements order creation workflow (catalog lookup → totals → persistence). |
| src/main/java/com/example/orderservice/service/OrderService.java | Defines order creation service contract. |
| src/main/java/com/example/orderservice/repository/OrderRepository.java | Adds JPA repository for Order persistence. |
| src/main/java/com/example/orderservice/mapper/OrderMapper.java | Maps persisted Order entity to OrderResponse DTO. |
| src/main/java/com/example/orderservice/exception/ProductNotFoundException.java | Introduces domain exception for missing products. |
| src/main/java/com/example/orderservice/exception/GlobalExceptionHandler.java | Adds centralized REST exception handling with ErrorResponse. |
| src/main/java/com/example/orderservice/entity/OrderStatus.java | Defines order lifecycle status enum. |
| src/main/java/com/example/orderservice/entity/OrderItem.java | Adds JPA entity for order line items. |
| src/main/java/com/example/orderservice/entity/Order.java | Adds JPA aggregate root for orders with item relationship. |
| src/main/java/com/example/orderservice/dto/ProductResponse.java | DTO for sample product catalog responses. |
| src/main/java/com/example/orderservice/dto/OrderResponse.java | DTO for created order responses. |
| src/main/java/com/example/orderservice/dto/OrderItemResponse.java | DTO for order item response lines. |
| src/main/java/com/example/orderservice/dto/OrderItemRequest.java | DTO + validation for incoming order line requests. |
| src/main/java/com/example/orderservice/dto/ErrorResponse.java | Standardized error payload DTO. |
| src/main/java/com/example/orderservice/dto/CreateOrderRequest.java | DTO + validation for create-order requests. |
| src/main/java/com/example/orderservice/controller/ProductController.java | Adds product catalog REST endpoints. |
| src/main/java/com/example/orderservice/controller/OrderController.java | Adds create-order REST endpoint with OpenAPI annotations. |
| src/main/java/com/example/orderservice/config/OpenApiConfig.java | Configures OpenAPI metadata for the service. |
| src/main/java/com/example/orderservice/catalog/ProductCatalogSample.java | Implements in-memory sample product catalog. |
| src/main/java/com/example/orderservice/catalog/ProductCatalog.java | Defines product catalog abstraction. |
| pom.xml | Adds JPA/PostgreSQL/springdoc/dotenv dependencies and updates Spring Boot parent. |
| docker-compose.yml | Adds local Postgres service with healthcheck/volume. |
| .env.example | Provides example env vars for local Postgres configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
GLRandula
reviewed
Jun 28, 2026
GLRandula
left a comment
Contributor
There was a problem hiding this comment.
Initial code was reviewed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces the initial implementation of the Order Service, including a sample product catalog, REST API endpoints, PostgreSQL integration, and essential supporting infrastructure. The changes add core domain entities, DTOs, controllers, exception handling, and configuration for development and documentation.
Backend and Database Integration
.env.examplefor environment variables, and relevant dependencies (spring-boot-starter-data-jpa,postgresql,spring-dotenv) for database connectivity and configuration. (docker-compose.yml[1].env.example[2]pom.xml[3] [4]Order,OrderItem, andOrderStatusto represent orders and their items in the database. (Order.java[1]OrderItem.java[2]OrderStatus.java[3]API Endpoints and Controllers
OrderControllerfor order creation andProductControllerfor exposing the sample product catalog, both with OpenAPI annotations for documentation. (OrderController.java[1]ProductController.java[2]Domain and DTO Layer
CreateOrderRequest,OrderItemRequest,OrderResponse,OrderItemResponse,ProductResponse, andErrorResponsefor consistent API communication. (CreateOrderRequest.java[1]OrderItemRequest.java[2]OrderResponse.java[3]OrderItemResponse.java[4]ProductResponse.java[5]ErrorResponse.java[6]ProductCatalogand its implementation to simulate product lookups. (ProductCatalog.java[1]ProductCatalogSample.java[2]Supporting Infrastructure
GlobalExceptionHandler.java[1]ProductNotFoundException.java[2]OpenApiConfig.java[1]OrderMapper.java[2]Dependency and Version Management
pom.xmlto 3.5.16 for compatibility with the chosen dependencies. (pom.xmlpom.xmlL8-R8)