@startuml
!pragma layout smetana
set separator none
hide empty description
hide stereotype
skinparam state {
  BackgroundColor white
  BorderColor #94a3b8
  BorderThickness 1
  FontName Inter
  FontSize 9
  FontStyle bold
  RoundCorner 20
  Padding 1
}
skinparam shadowing false
skinparam ArrowFontName JetBrains Mono
skinparam ArrowFontSize 8
skinparam ArrowColor #cbd5e1
skinparam ArrowThickness 1
skinparam dpi 110
skinparam svgLinkTarget _self

[*] --> NEW

state CHECK_AVAILABILITY <<choice>>

NEW -[#1E90FF,bold]-> CHECK_AVAILABILITY <<external>> : PLACE_ORDER
CHECK_AVAILABILITY -[#FF6347,bold]-> PENDING_PAYMENT <<choice_type>> : [λ] (order=0)
CHECK_AVAILABILITY -[#FF6347,bold]-> CANCELLED <<choice_type>> : (order=1)
PENDING_PAYMENT -[#1E90FF,bold]-> PAID <<external>> : PAY_ORDER
PAID -[#1E90FF,bold]-> SHIPPED <<external>> : SHIP_ORDER
SHIPPED -[#1E90FF,bold]-> DELIVERED <<external>> : FINALIZE
PAID -[#1E90FF,bold]-> CANCELLED <<external>> : CANCEL_ORDER
DELIVERED -[#1E90FF,bold]-> RETURNED <<external>> : RETURN_ORDER

CANCELLED --> [*]
DELIVERED --> [*]
RETURNED --> [*]
@enduml

