Implement a state machine in Fulfillment
See original GitHub issueWe already have a state machine in Order, Payments and Refunds, I believe that we should implement that in the Fulfillment too so that we can make things like: create labels for shipping, create tracking code (this depends on carrier), notify users of the state of the fulfillment by email and many other things…
Features
- Implement a state machine in Fulfillment. I thought in these states initially:
'Pending' | 'Shipped' | 'Delivered' | 'Cancelled'
- Button in Admin UI to change the Fulfillment state (like Payment and Refunds)
- A way to define how the Fulfillment should work when transiting between states
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (16 by maintainers)
Top Results From Across the Web
Practical Use of Finite-State Machines | Ilya Kaznacheev
This will help to clarify and separate the logic of the different states into distinct modules. Try to describe the states in a...
Read more >State Machine Design pattern —Part 1: When, Why & How
State Machine modeling is one of the most traditional patterns in Computer Science. It's one of those design patterns which impacts our daily...
Read more >Using Finite State Machines to Manage Customer Relations
To create a state machine, we take each one of these stages, and model it as a state. For example, all new customers...
Read more >Hierarchical State Machines in the Automation Process
This article will introduce you to the concept of a Hierarchical State Machine (HSM) and show you how this approach works so well...
Read more >How to use state machines for your modeling (Part 4)
This means that a transition "pulls" not only if the right event is present, but also only if the guard condition is fulfilled....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Status update
The PR implementing the server-side of this is now merged into
next
.Tasks outstanding:
@michaelbromley I little update here, when I started to update the order e2e tests I realize that we will need
PartiallyShipped
order state too. Today If you forget to fulfill an order item, the order state will continue inPartiallyFulfilled
. We need to achieve that in this PR too. So the new order states must be that:PartiallyShipped
To reach this state, the Order must have at least one Fulfillment in
Shipped
state.Shipped
To reach this state all order items must have a Fulfillment and all Fulfillment must be in
Shipped
statePartiallyDelivered
(oldPartiallyFulfilled
)To reach this state, the Order must have at least one Fulfillment in
Delivered
state.Delivered
(oldFulfilled
)To reach this state all order items must have a Fulfillment and all Fulfillment must be in
Delivered
state