question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement a state machine in Fulfillment

See original GitHub issue

We 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:closed
  • Created 3 years ago
  • Comments:17 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
michaelbromleycommented, Oct 2, 2020

Status update

The PR implementing the server-side of this is now merged into next.

Tasks outstanding:

  • Admin UI parts to interact with Fulfillment state
  • Documentation
1reaction
jonyw4commented, Sep 2, 2020

@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 in PartiallyFulfilled. 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 state

PartiallyDelivered (old PartiallyFulfilled)

To reach this state, the Order must have at least one Fulfillment in Delivered state.

Delivered (old Fulfilled)

To reach this state all order items must have a Fulfillment and all Fulfillment must be in Delivered state

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found