workflow scheduler create booking with a booking execution lot id
This commit is contained in:
@@ -68,10 +68,10 @@ func (o *Order) Pay(scheduler *workflow_execution.WorkflowSchedule, request *too
|
||||
} else {
|
||||
o.IsDraft = false
|
||||
}
|
||||
for _, exec := range scheduler.WorkflowExecutions {
|
||||
for _, exec := range scheduler.WorkflowExecution {
|
||||
exec.IsDraft = false
|
||||
_, code, err := utils.GenericUpdateOne(exec, exec.GetID(),
|
||||
workflow_execution.NewAccessor(request), &workflow_execution.WorkflowExecutions{})
|
||||
workflow_execution.NewAccessor(request), &workflow_execution.WorkflowExecution{})
|
||||
if code != 200 || err != nil {
|
||||
return errors.New("could not update the workflow execution" + fmt.Sprintf("%v", err))
|
||||
}
|
||||
@@ -100,7 +100,7 @@ func (o *Order) draftStoreFromModel(scheduler *workflow_execution.WorkflowSchedu
|
||||
o.IsDraft = true
|
||||
o.OrderBy = request.PeerID
|
||||
o.WorkflowExecutionIDs = []string{} // create an array of ids
|
||||
for _, exec := range scheduler.WorkflowExecutions {
|
||||
for _, exec := range scheduler.WorkflowExecution {
|
||||
o.WorkflowExecutionIDs = append(o.WorkflowExecutionIDs, exec.GetID())
|
||||
}
|
||||
// set the name of the order
|
||||
@@ -166,12 +166,12 @@ func (o *Order) draftBookOrder(scheduler *workflow_execution.WorkflowSchedule, r
|
||||
if request == nil {
|
||||
return draftedBookings, errors.New("no request found")
|
||||
}
|
||||
for _, exec := range scheduler.WorkflowExecutions {
|
||||
for _, exec := range scheduler.WorkflowExecution {
|
||||
_, priceds, _, err := scheduler.Workflow.Planify(exec.ExecDate, exec.EndDate, request)
|
||||
if err != nil {
|
||||
return draftedBookings, errors.New("could not planify the workflow" + fmt.Sprintf("%v", err))
|
||||
}
|
||||
bookings := exec.Book(scheduler.Workflow.UUID, priceds)
|
||||
bookings := exec.Book(scheduler.UUID, scheduler.Workflow.UUID, priceds)
|
||||
for _, booking := range bookings {
|
||||
_, err := (&peer.Peer{}).LaunchPeerExecution(booking.DestPeerID, "",
|
||||
tools.BOOKING, tools.POST, booking.Serialize(booking), request.Caller)
|
||||
|
Reference in New Issue
Block a user