Customer create an order with total. The new order will be processed automaticaly via a payment service with total, if total is odd number (2,4,6,8), it will be approved and sent to Deliver department after 3 seconds. If total order is even numbers (1,3,5,7), the order will be canceled.
Customers can see all their orders if an order still is not delivered they can cancel it.
The method to create a common sharing knowleage about business domain between developer and domain experts. The problem when building a large software in enterprise is developer have a little understand the business words, business processes. They will describe the business into thier own language. By the limitation of programming language, OOP, DB nomalization to describe the business, the output by developer does not reflect the real world. Using or applying DDD from spec creatation to coding we can create a common language, understandable for both domain experts and developer
Use DDD methodology to identify AggregateRoot, Enities, Domain Events, Bounded Context and Context map.
Apply Event Sourcing and CQRS architect parttern
Use Event Driven to make mircroservers loosing couple.
$ npm install
$ docker-compose up -d
cd order
# development
$ npm run start
# watch mode
$ npm run start:dev
# Replay all history events and update query side
$ npm run start:viewdb
$ cd payment
# development
$ npm run start
# unit tests
$ npm run test
Create Order POST
http://localhost:3000/order/
{
"user_id": "test_user",
"total": 2
}
Cancel Order PUT
http://localhost:3000/order/cancel
{
"id": "56f9222e-f731-47b8-aeb7-66112ca511d0",
}
- Make Dokerfile
- Deploy to Kubernestes environment (Helm chart)
- Make service mesh (Istio) and log monitering
- Make CloudFomation file with EKS
Nest is MIT licensed.