test booking
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package workflow_execution
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -141,13 +142,16 @@ func (d *WorkflowExecution) buyEach(bs pricing.BillingStrategy, executionsID str
|
||||
if s := priced.GetLocationStart(); s != nil {
|
||||
start = *s
|
||||
}
|
||||
var m map[string]interface{}
|
||||
b, _ := json.Marshal(priced)
|
||||
json.Unmarshal(b, &m)
|
||||
end := start.Add(time.Duration(priced.GetExplicitDurationInS()) * time.Second)
|
||||
bookingItem := &purchase_resource.PurchaseResource{
|
||||
AbstractObject: utils.AbstractObject{
|
||||
UUID: uuid.New().String(),
|
||||
Name: d.GetName() + "_" + executionsID + "_" + wfID,
|
||||
},
|
||||
PricedItem: priced,
|
||||
PricedItem: m,
|
||||
ExecutionsID: executionsID,
|
||||
DestPeerID: priced.GetCreatorID(),
|
||||
ResourceID: priced.GetID(),
|
||||
@@ -189,12 +193,15 @@ func (d *WorkflowExecution) bookEach(executionsID string, wfID string, dt tools.
|
||||
start = *s
|
||||
}
|
||||
end := start.Add(time.Duration(priced.GetExplicitDurationInS()) * time.Second)
|
||||
var m map[string]interface{}
|
||||
b, _ := json.Marshal(priced)
|
||||
json.Unmarshal(b, &m)
|
||||
bookingItem := &booking.Booking{
|
||||
AbstractObject: utils.AbstractObject{
|
||||
UUID: uuid.New().String(),
|
||||
Name: d.GetName() + "_" + executionsID + "_" + wfID,
|
||||
},
|
||||
PricedItem: priced,
|
||||
PricedItem: m,
|
||||
ExecutionsID: executionsID,
|
||||
State: enum.SCHEDULED,
|
||||
ResourceID: priced.GetID(),
|
||||
|
||||
Reference in New Issue
Block a user