workflow scheduler create booking with a booking execution lot id
This commit is contained in:
parent
7d03676ac2
commit
a098b3797a
@ -21,7 +21,7 @@ import (
|
|||||||
*/
|
*/
|
||||||
type WorkflowExecution struct {
|
type WorkflowExecution struct {
|
||||||
utils.AbstractObject // AbstractObject contains the basic fields of an object (id, name)
|
utils.AbstractObject // AbstractObject contains the basic fields of an object (id, name)
|
||||||
ExecutionID string `json:"execution_id,omitempty" bson:"execution_id,omitempty" validate:"required"`
|
ExecutionsID string `json:"executions_id,omitempty" bson:"executions_id,omitempty" validate:"required"`
|
||||||
ExecDate time.Time `json:"execution_date,omitempty" bson:"execution_date,omitempty" validate:"required"` // ExecDate is the execution date of the workflow, is required
|
ExecDate time.Time `json:"execution_date,omitempty" bson:"execution_date,omitempty" validate:"required"` // ExecDate is the execution date of the workflow, is required
|
||||||
EndDate *time.Time `json:"end_date,omitempty" bson:"end_date,omitempty"` // EndDate is the end date of the workflow
|
EndDate *time.Time `json:"end_date,omitempty" bson:"end_date,omitempty"` // EndDate is the end date of the workflow
|
||||||
State enum.BookingStatus `json:"state" bson:"state" default:"0"` // TEMPORARY TODO DEFAULT 1 -> 0 State is the state of the workflow
|
State enum.BookingStatus `json:"state" bson:"state" default:"0"` // TEMPORARY TODO DEFAULT 1 -> 0 State is the state of the workflow
|
||||||
|
@ -121,7 +121,6 @@ func (ws *WorkflowSchedule) Schedules(wfID string, request *tools.APIRequest) (*
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return ws, nil, []*WorkflowExecution{}, errors.New("purge draft" + fmt.Sprintf("%v", err))
|
return ws, nil, []*WorkflowExecution{}, errors.New("purge draft" + fmt.Sprintf("%v", err))
|
||||||
}
|
}
|
||||||
exec.GenerateID()
|
|
||||||
exec.StoreDraftDefault()
|
exec.StoreDraftDefault()
|
||||||
// Should DELETE the previous execution2
|
// Should DELETE the previous execution2
|
||||||
utils.GenericStoreOne(exec, NewAccessor(request))
|
utils.GenericStoreOne(exec, NewAccessor(request))
|
||||||
@ -153,10 +152,11 @@ func (ws *WorkflowSchedule) getExecutions(workflow *workflow.Workflow) ([]*Workf
|
|||||||
UUID: uuid.New().String(), // set the uuid of the execution
|
UUID: uuid.New().String(), // set the uuid of the execution
|
||||||
Name: workflow.Name + "_execution_" + date.Start.String(), // set the name of the execution
|
Name: workflow.Name + "_execution_" + date.Start.String(), // set the name of the execution
|
||||||
},
|
},
|
||||||
ExecDate: date.Start, // set the execution date
|
ExecutionsID: ws.UUID,
|
||||||
EndDate: date.End, // set the end date
|
ExecDate: date.Start, // set the execution date
|
||||||
State: enum.DRAFT, // set the state to 1 (scheduled)
|
EndDate: date.End, // set the end date
|
||||||
WorkflowID: workflow.GetID(), // set the workflow id dependancy of the execution
|
State: enum.DRAFT, // set the state to 1 (scheduled)
|
||||||
|
WorkflowID: workflow.GetID(), // set the workflow id dependancy of the execution
|
||||||
}
|
}
|
||||||
workflows_executions = append(workflows_executions, obj)
|
workflows_executions = append(workflows_executions, obj)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user