Skip to content

Commit

Permalink
Create
Browse files Browse the repository at this point in the history
  • Loading branch information
aliakh committed Jul 9, 2024
1 parent 43ee518 commit 13db5fe
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/main/java/handson/impl/OrderService.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,22 @@ public CompletableFuture<ApiHttpResponse<Order>> changeWorkflowState(
final ApiHttpResponse<Order> orderApiHttpResponse,
final State workflowState) {

return null;
final Order order = orderApiHttpResponse.getBody();

return apiRoot
.orders()
.withId(order.getId())
.post(
OrderUpdateBuilder.of()
.version(order.getVersion())
.actions(
ChangeWorkflowStateActionBuilder.of()
.orderState(workflowState)
.build()
)
.build()
)
.execute();
}

}

0 comments on commit 13db5fe

Please sign in to comment.