microservices-patterns / ftgo-application

Example code for the book Microservice patterns
Other
3.35k stars 1.29k forks source link

OrderHistory gives order status as "APPROVAL_PENDING", but in Order Service it has "CANCELLED" status #56

Closed asn25 closed 4 years ago

asn25 commented 4 years ago

Hi, I'm running End-to-end test (two times), it creates two orders, I see that they have "CANCELLED" status in Order Service table: https://imgur.com/a/i9HSxEZ Then I retrieve data from Order History service with AWS CLI ( aws --region ignored --endpoint-url http://$DOCKER_HOST_IP:8000 dynamodb scan --table-name ftgo-order-history ) and see that order statuses are "APPROVAL_PENDING". I repeated retrieve from DynamoDB some time later, it still gives "APPROVAL_PENDING" statuses.

Is this behavior correct? Expectations for Order History service are, probably, that it's data should contain a chain of order states (history of changes that End-to-end test did with these orders) and final status should be the same as in Order Service.


{ "Items": [ { "creationDate": { "N": "1577020036013" }, "keywords": { "SS": [ "Chicken", "My", "Restaurant", "Vindaloo" ] }, "events.net.chrisrichardson.ftgo.orderservice.domain.Order1": { "S": "0000016f2db8120e-0242ac12000b0000" }, "orderStatus": { "S": "APPROVAL_PENDING" }, "lineItems": { "L": [ { "M": { "menuItemName": { "S": "Chicken Vindaloo" }, "menuItemId": { "S": "1" }, "quantity": { "N": "5" }, "price": { "S": "12.34" } } } ] }, "restaurantName": { "S": "My Restaurant" }, "restaurantId": { "N": "1" }, "orderId": { "S": "1" }, "consumerId": { "S": "1" } }, { "creationDate": { "N": "1577036096341" }, "keywords": { "SS": [ "Chicken", "My", "Restaurant", "Vindaloo" ] }, "events.net.chrisrichardson.ftgo.orderservice.domain.Order2": { "S": "0000016f2ead2316-0242ac12000b0000" }, "orderStatus": { "S": "APPROVAL_PENDING" }, "lineItems": { "L": [ { "M": { "menuItemName": { "S": "Chicken Vindaloo" }, "menuItemId": { "S": "1" }, "quantity": { "N": "5" }, "price": { "S": "12.34" } } } ] }, "restaurantName": { "S": "My Restaurant" }, "restaurantId": { "N": "2" }, "orderId": { "S": "2" }, "consumerId": { "S": "2" } } ], "Count": 2, "ScannedCount": 2, "ConsumedCapacity": null }