Skip to content

Commit

Permalink
Add mermaid flowcharts
Browse files Browse the repository at this point in the history
  • Loading branch information
Isengo1989 committed Sep 20, 2023
1 parent 3425887 commit 9304dd7
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 3 deletions.
Binary file removed .gitbook/assets/order-delivery-state-machine.png
Binary file not shown.
Binary file removed .gitbook/assets/order-payment-state-machine.png
Binary file not shown.
Binary file removed .gitbook/assets/order-state-machine.png
Binary file not shown.
146 changes: 143 additions & 3 deletions concepts/commerce/checkout-concept/orders.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,149 @@ The order state changes in a defined, predictable and configurable way - other s

During the order placement, at least three distinct state machines are started as described in the below diagrams:

![The order state machine](../../../.gitbook/assets/order-state-machine.png)
![The transaction state machine](../../../.gitbook/assets/order-payment-state-machine.png)
![The delivery state machine](../../../.gitbook/assets/order-delivery-state-machine.png)
### Order state flowchart

```mermaid
flowchart TD
START_STATE[Start state] --> 0189e474ee4072da9f23d5fc137f2f58
0189e474ee4072da9f23d5fc137f2f58(Open)
0189e474ee4072da9f23d5fc141c681e(Done)
0189e474ee4072da9f23d5fc141c681e --> FINAL_STATE[Final state]
0189e474ee4072da9f23d5fc1483e83f(In Progress)
0189e474ee4072da9f23d5fc153176d0(Cancelled)
0189e474ee4072da9f23d5fc153176d0 --> FINAL_STATE[Final state]
0189e474ee4072da9f23d5fc137f2f58 -- process --> 0189e474ee4072da9f23d5fc1483e83f
0189e474ee4072da9f23d5fc137f2f58 -- cancel --> 0189e474ee4072da9f23d5fc153176d0
0189e474ee4072da9f23d5fc1483e83f -- cancel --> 0189e474ee4072da9f23d5fc153176d0
0189e474ee4072da9f23d5fc1483e83f -- complete --> 0189e474ee4072da9f23d5fc141c681e
0189e474ee4072da9f23d5fc153176d0 -- reopen --> 0189e474ee4072da9f23d5fc137f2f58
0189e474ee4072da9f23d5fc141c681e -- reopen --> 0189e474ee4072da9f23d5fc137f2f58
```

### Order delivery flowchart

```mermaid
flowchart TD
START_STATE[Start state] --> 0189e474ee557113994b4f678ba7574a
0189e474ee557113994b4f678ba7574a(Open)
0189e474ee557113994b4f678c711eb7(Cancelled)
0189e474ee557113994b4f678c711eb7 --> FINAL_STATE[Final state]
0189e474ee557113994b4f678d696964(Shipped)
0189e474ee557113994b4f678db3c16c(Shipped partially)
0189e474ee557113994b4f678e1eb368(Returned)
0189e474ee557113994b4f678e1eb368 --> FINAL_STATE[Final state]
0189e474ee557113994b4f678e75d0e0(Returned partially)
0189e474ee557113994b4f678ba7574a -- ship --> 0189e474ee557113994b4f678d696964
0189e474ee557113994b4f678ba7574a -- ship_partially --> 0189e474ee557113994b4f678db3c16c
0189e474ee557113994b4f678ba7574a -- cancel --> 0189e474ee557113994b4f678c711eb7
0189e474ee557113994b4f678d696964 -- retour --> 0189e474ee557113994b4f678e1eb368
0189e474ee557113994b4f678d696964 -- retour_partially --> 0189e474ee557113994b4f678e75d0e0
0189e474ee557113994b4f678d696964 -- cancel --> 0189e474ee557113994b4f678c711eb7
0189e474ee557113994b4f678db3c16c -- retour --> 0189e474ee557113994b4f678e1eb368
0189e474ee557113994b4f678db3c16c -- retour_partially --> 0189e474ee557113994b4f678e75d0e0
0189e474ee557113994b4f678db3c16c -- ship --> 0189e474ee557113994b4f678d696964
0189e474ee557113994b4f678db3c16c -- cancel --> 0189e474ee557113994b4f678c711eb7
0189e474ee557113994b4f678c711eb7 -- reopen --> 0189e474ee557113994b4f678ba7574a
0189e474ee557113994b4f678d696964 -- reopen --> 0189e474ee557113994b4f678ba7574a
0189e474ee557113994b4f678db3c16c -- reopen --> 0189e474ee557113994b4f678ba7574a
0189e474ee557113994b4f678e1eb368 -- reopen --> 0189e474ee557113994b4f678ba7574a
0189e474ee557113994b4f678e75d0e0 -- reopen --> 0189e474ee557113994b4f678ba7574a
0189e474ee557113994b4f678e75d0e0 -- retour --> 0189e474ee557113994b4f678e1eb368
```

### Order payment flowchart


```mermaid
flowchart TD
START_STATE[Start state] --> 0189e474ee7170f9a3b4784c451d92e5
0189e474ee7170f9a3b4784c451d92e5(Open)
0189e474ee7170f9a3b4784c456e69c5(Paid)
0189e474ee7170f9a3b4784c462f8cea(Paid partially)
0189e474ee7170f9a3b4784c46cce7d0(Cancelled)
0189e474ee7170f9a3b4784c4758e283(Reminded)
0189e474ee7170f9a3b4784c47d5e500(Refunded)
0189e474ee7170f9a3b4784c47d5e500 --> FINAL_STATE[Final state]
0189e474ee7170f9a3b4784c47f33a43(Refunded partially)
0189e474f98173008b1388158d6dc34d(In Progress)
0189e474f98173008b1388158de8ed2c(Failed)
0189e474ffa1732b887606170be549b0(Authorized)
0189e474ffad72fa9ea23fdbaa2139ad(Chargeback)
0189e47510ae70de9997b0559de079fb(Unconfirmed)
0189e474ee7170f9a3b4784c451d92e5 -- pay --> 0189e474ee7170f9a3b4784c456e69c5
0189e474ee7170f9a3b4784c451d92e5 -- pay_partially --> 0189e474ee7170f9a3b4784c462f8cea
0189e474ee7170f9a3b4784c451d92e5 -- cancel --> 0189e474ee7170f9a3b4784c46cce7d0
0189e474ee7170f9a3b4784c451d92e5 -- remind --> 0189e474ee7170f9a3b4784c4758e283
0189e474ee7170f9a3b4784c4758e283 -- pay --> 0189e474ee7170f9a3b4784c456e69c5
0189e474ee7170f9a3b4784c4758e283 -- pay_partially --> 0189e474ee7170f9a3b4784c462f8cea
0189e474ee7170f9a3b4784c4758e283 -- cancel --> 0189e474ee7170f9a3b4784c46cce7d0
0189e474ee7170f9a3b4784c462f8cea -- remind --> 0189e474ee7170f9a3b4784c4758e283
0189e474ee7170f9a3b4784c462f8cea -- pay --> 0189e474ee7170f9a3b4784c456e69c5
0189e474ee7170f9a3b4784c462f8cea -- refund_partially --> 0189e474ee7170f9a3b4784c47f33a43
0189e474ee7170f9a3b4784c462f8cea -- refund --> 0189e474ee7170f9a3b4784c47d5e500
0189e474ee7170f9a3b4784c462f8cea -- cancel --> 0189e474ee7170f9a3b4784c46cce7d0
0189e474ee7170f9a3b4784c456e69c5 -- refund_partially --> 0189e474ee7170f9a3b4784c47f33a43
0189e474ee7170f9a3b4784c456e69c5 -- refund --> 0189e474ee7170f9a3b4784c47d5e500
0189e474ee7170f9a3b4784c456e69c5 -- cancel --> 0189e474ee7170f9a3b4784c46cce7d0
0189e474ee7170f9a3b4784c47f33a43 -- refund --> 0189e474ee7170f9a3b4784c47d5e500
0189e474ee7170f9a3b4784c47f33a43 -- cancel --> 0189e474ee7170f9a3b4784c46cce7d0
0189e474ee7170f9a3b4784c46cce7d0 -- reopen --> 0189e474ee7170f9a3b4784c451d92e5
0189e474ee7170f9a3b4784c46cce7d0 -- refund --> 0189e474ee7170f9a3b4784c47d5e500
0189e474ee7170f9a3b4784c46cce7d0 -- refund_partially --> 0189e474ee7170f9a3b4784c47f33a43
0189e474f98173008b1388158d6dc34d -- reopen --> 0189e474ee7170f9a3b4784c451d92e5
0189e474f98173008b1388158d6dc34d -- fail --> 0189e474f98173008b1388158de8ed2c
0189e474f98173008b1388158d6dc34d -- cancel --> 0189e474ee7170f9a3b4784c46cce7d0
0189e474f98173008b1388158d6dc34d -- paid --> 0189e474ee7170f9a3b4784c456e69c5
0189e474f98173008b1388158d6dc34d -- paid_partially --> 0189e474ee7170f9a3b4784c462f8cea
0189e474f98173008b1388158d6dc34d -- pay_partially --> 0189e474ee7170f9a3b4784c462f8cea
0189e474f98173008b1388158de8ed2c -- reopen --> 0189e474ee7170f9a3b4784c451d92e5
0189e474f98173008b1388158de8ed2c -- do_pay --> 0189e474f98173008b1388158d6dc34d
0189e474f98173008b1388158de8ed2c -- pay --> 0189e474ee7170f9a3b4784c456e69c5
0189e474f98173008b1388158de8ed2c -- fail --> 0189e474f98173008b1388158de8ed2c
0189e474f98173008b1388158de8ed2c -- paid --> 0189e474ee7170f9a3b4784c456e69c5
0189e474f98173008b1388158de8ed2c -- paid_partially --> 0189e474ee7170f9a3b4784c462f8cea
0189e474f98173008b1388158de8ed2c -- pay_partially --> 0189e474ee7170f9a3b4784c462f8cea
0189e474ee7170f9a3b4784c451d92e5 -- do_pay --> 0189e474f98173008b1388158d6dc34d
0189e474ee7170f9a3b4784c451d92e5 -- fail --> 0189e474f98173008b1388158de8ed2c
0189e474ee7170f9a3b4784c4758e283 -- reopen --> 0189e474ee7170f9a3b4784c451d92e5
0189e474ee7170f9a3b4784c4758e283 -- do_pay --> 0189e474f98173008b1388158d6dc34d
0189e474ee7170f9a3b4784c462f8cea -- reopen --> 0189e474ee7170f9a3b4784c451d92e5
0189e474ee7170f9a3b4784c462f8cea -- do_pay --> 0189e474f98173008b1388158d6dc34d
0189e474ee7170f9a3b4784c456e69c5 -- reopen --> 0189e474ee7170f9a3b4784c451d92e5
0189e474ee7170f9a3b4784c47f33a43 -- reopen --> 0189e474ee7170f9a3b4784c451d92e5
0189e474ee7170f9a3b4784c451d92e5 -- paid --> 0189e474ee7170f9a3b4784c456e69c5
0189e474ee7170f9a3b4784c451d92e5 -- paid_partially --> 0189e474ee7170f9a3b4784c462f8cea
0189e474f98173008b1388158d6dc34d -- authorize --> 0189e474ffa1732b887606170be549b0
0189e474ee7170f9a3b4784c451d92e5 -- authorize --> 0189e474ffa1732b887606170be549b0
0189e474ee7170f9a3b4784c4758e283 -- authorize --> 0189e474ffa1732b887606170be549b0
0189e474ffa1732b887606170be549b0 -- paid --> 0189e474ee7170f9a3b4784c456e69c5
0189e474ffa1732b887606170be549b0 -- paid_partially --> 0189e474ee7170f9a3b4784c462f8cea
0189e474ffa1732b887606170be549b0 -- fail --> 0189e474f98173008b1388158de8ed2c
0189e474ffa1732b887606170be549b0 -- cancel --> 0189e474ee7170f9a3b4784c46cce7d0
0189e474ee7170f9a3b4784c456e69c5 -- chargeback --> 0189e474ffad72fa9ea23fdbaa2139ad
0189e474ee7170f9a3b4784c462f8cea -- chargeback --> 0189e474ffad72fa9ea23fdbaa2139ad
0189e474ffad72fa9ea23fdbaa2139ad -- paid --> 0189e474ee7170f9a3b4784c456e69c5
0189e474ffad72fa9ea23fdbaa2139ad -- paid_partially --> 0189e474ee7170f9a3b4784c462f8cea
0189e474ffad72fa9ea23fdbaa2139ad -- cancel --> 0189e474ee7170f9a3b4784c46cce7d0
0189e474ee7170f9a3b4784c46cce7d0 -- paid --> 0189e474ee7170f9a3b4784c456e69c5
0189e474ee7170f9a3b4784c451d92e5 -- process_unconfirmed --> 0189e47510ae70de9997b0559de079fb
0189e474ee7170f9a3b4784c4758e283 -- process_unconfirmed --> 0189e47510ae70de9997b0559de079fb
0189e474f98173008b1388158de8ed2c -- process_unconfirmed --> 0189e47510ae70de9997b0559de079fb
0189e474ee7170f9a3b4784c46cce7d0 -- process_unconfirmed --> 0189e47510ae70de9997b0559de079fb
0189e474ee7170f9a3b4784c462f8cea -- process_unconfirmed --> 0189e47510ae70de9997b0559de079fb
0189e47510ae70de9997b0559de079fb -- paid --> 0189e474ee7170f9a3b4784c456e69c5
0189e47510ae70de9997b0559de079fb -- paid_partially --> 0189e474ee7170f9a3b4784c462f8cea
0189e47510ae70de9997b0559de079fb -- fail --> 0189e474f98173008b1388158de8ed2c
0189e47510ae70de9997b0559de079fb -- cancel --> 0189e474ee7170f9a3b4784c46cce7d0
0189e47510ae70de9997b0559de079fb -- authorize --> 0189e474ffa1732b887606170be549b0
0189e47510ae70de9997b0559de079fb -- reopen --> 0189e474ee7170f9a3b4784c451d92e5
```

::: tip
The state machines displayed in the following sections can actually be modified through the API, this is just the default setup.
Expand Down

0 comments on commit 9304dd7

Please sign in to comment.