Jun 21, 2024
application.properties
.Product
class annotated with @Document
for MongoDB, fields: id, name, description, price.ProductRepository
interface extending MongoRepository<Product, String>
.ProductService
with methods to create products and transform ProductRequest
DTO to Product
entity.ProductController
with REST endpoints to create and view products.Postman
to manually test endpoints, implement integration tests using JUnit5, MockMvc, and Testcontainers for MongoDB.application.properties
.Order
class with OrderLineItems
, establish one-to-many relationship, annotate with JPA annotations.OrderRepository
interface extending JpaRepository<Order, Long>
.OrderService
for business logic to place orders, map DTOs to entities.OrderController
with REST endpoint to place orders.Postman
to create orders and confirm through the console.application.properties
.Inventory
class annotated with JPA, fields: id, skuCode, quantity.InventoryRepository
interface extending JpaRepository<Inventory, Long>
.InventoryService
for business logic to check product stock.InventoryController
with REST endpoint to check stock status.Postman
.Postman
and automated tests.