workflow execution evolved

This commit is contained in:
mr 2025-02-06 09:56:00 +01:00
parent e646cfef0b
commit 3ffff7d32c

View File

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