saleor-docs icon indicating copy to clipboard operation
saleor-docs copied to clipboard

Add order status graph

Open krzysztofwolski opened this issue 1 year ago • 3 comments

Add documentation on possible status changes in Order object.

Related issue: #870

krzysztofwolski avatar Nov 09 '23 13:11 krzysztofwolski

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
saleor-docs ✅ Ready (Inspect) Visit Preview 5 resolved May 21, 2024 2:05pm

vercel[bot] avatar Nov 09 '23 13:11 vercel[bot]

@krzysztofwolski looking good. Is it consumable as it is right now?

timuric avatar Nov 29 '23 11:11 timuric

Expired orders can be deleted after some time, more details: https://github.com/saleor/saleor/issues/12544 But I think it can be added in a separate PR

szczecha avatar Jan 05 '24 11:01 szczecha

@aniav I added some stuff, I fixed some stuff, I added some todo comments, and I changed some stuff according to my taste. I didn't want to do too much without feedback, so please share it. If all good, I will go through it once again. We still have some Vercel comments to address

peelar avatar May 09 '24 09:05 peelar

"Refactored" order state graph to use flowchart instead of State graph, WDYT? @aniav @peelar

flowchart TD
    CreatedDraft[Draft order created] --> DRAFT(DRAFT)
    CheckoutCompleted[Checkout Completed]

    DRAFT -->|Confirm order| UNFULFILLED(UNFULFILLED)

    CheckoutCompleted --> isAutomated{Is automated \norder confirmation turned on?}
    isAutomated -->|Yes| UNFULFILLED
    isAutomated -->|No| UNCONFIRMED(UNCONFIRMED)


    UNCONFIRMED -->|Expire time overdue| EXPIRED(EXPIRED)
    UNCONFIRMED -->|Confirm order| UNFULFILLED

    UNFULFILLED -->|Create fulfillment| isNotFulfilled{Are there unfulfilled\n order lines?}
    isNotFulfilled -->|Yes| PARTIALLY_FULFILLED(PARTIALLY_FULFILLED)
    isNotFulfilled -->|No| FULFILLED(FULFILLED)
    UNFULFILLED -->|Cancel order| CANCELLED(CANCELLED)

    PARTIALLY_FULFILLED -->|Create fulfillment| isNotFulfilled
    PARTIALLY_FULFILLED -->|Return products| isNotReturned{Are there unreturned\n order lines?}
    
    FULFILLED -->|Return products| isNotReturned
    isNotReturned -->|Yes| PARTIALLY_RETURNED(PARTIALLY_RETURNED)
    isNotReturned -->|No| RETURNED(RETURNED)
  
    PARTIALLY_RETURNED -->|Return products| isNotReturned

krzysztofwolski avatar May 21 '24 12:05 krzysztofwolski

"Refactored" order state graph to use flowchart instead of State graph, WDYT?

its beautiful

peelar avatar May 21 '24 12:05 peelar