diff --git a/models/order/order.go b/models/order/order.go index ec268ee..37e41e2 100644 --- a/models/order/order.go +++ b/models/order/order.go @@ -90,7 +90,8 @@ func (o *Order) draftStoreFromModel(scheduler *workflow_execution.WorkflowSchedu if request == nil { return errors.New("no request found") } - if scheduler.Workflow.Graph == nil { // if the workflow has no graph, return an error + fmt.Println("Drafting order", scheduler.Workflow) + if scheduler.Workflow == nil || scheduler.Workflow.Graph == nil { // if the workflow has no graph, return an error return errors.New("no graph found") } o.SetName() @@ -321,4 +322,5 @@ func (d *PeerItemOrder) GetPrice(request *tools.APIRequest) (float64, error) { return p * float64(d.Quantity), nil } +// WTF HOW TO SELECT THE RIGHT PRICE ??? // SHOULD SET A BUYING STATUS WHEN PAYMENT IS VALIDATED