nil except

This commit is contained in:
mr 2024-08-02 11:43:59 +02:00
parent 9da3a7c3e6
commit d0e2778246
2 changed files with 7 additions and 7 deletions

View File

@ -51,7 +51,7 @@ func (wfa *workflowMongoAccessor) execution(realData *Workflow, delete bool) (in
obj := &workflow_execution.WorkflowExecution{
ExecDate: &s,
EndDate: realData.Schedule.End,
State: workflow_execution.SCHEDULED,
State: workflow_execution.SCHEDULED.EnumIndex(),
WorkflowID: realData.UUID,
}
accessor.StoreOne(obj)
@ -61,7 +61,7 @@ func (wfa *workflowMongoAccessor) execution(realData *Workflow, delete bool) (in
obj := &workflow_execution.WorkflowExecution{
ExecDate: realData.Schedule.Start,
EndDate: realData.Schedule.End,
State: workflow_execution.SCHEDULED,
State: workflow_execution.SCHEDULED.EnumIndex(),
WorkflowID: realData.UUID,
}
accessor.StoreOne(obj)

View File

@ -38,11 +38,11 @@ func (d ScheduledType) EnumIndex() int {
}
type WorkflowExecution struct {
UUID string `json:"id,omitempty" bson:"id,omitempty" validate:"required"`
ExecDate *time.Time `json:"execution_date,omitempty" bson:"execution_date,omitempty" validate:"required"`
EndDate *time.Time `json:"end_date,omitempty" bson:"end_date,omitempty"`
State ScheduledType `json:"state,omitempty" bson:"state,omitempty" `
WorkflowID string `json:"workflow_id" bson:"workflow_id,omitempty"`
UUID string `json:"id,omitempty" bson:"id,omitempty" validate:"required"`
ExecDate *time.Time `json:"execution_date,omitempty" bson:"execution_date,omitempty" validate:"required"`
EndDate *time.Time `json:"end_date,omitempty" bson:"end_date,omitempty"`
State int `json:"state,omitempty" bson:"state,omitempty" `
WorkflowID string `json:"workflow_id" bson:"workflow_id,omitempty"`
}
func (ao *WorkflowExecution) GetID() string {