workflow scheduler create booking with a booking execution lot id
This commit is contained in:
parent
3e85fdc779
commit
c0e6247fb8
@ -1,6 +1,7 @@
|
|||||||
package booking
|
package booking
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"cloud.o-forge.io/core/oc-lib/dbs"
|
"cloud.o-forge.io/core/oc-lib/dbs"
|
||||||
@ -33,7 +34,11 @@ func (a *bookingMongoAccessor) DeleteOne(id string) (utils.DBObject, int, error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *bookingMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils.DBObject, int, error) {
|
func (a *bookingMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils.DBObject, int, error) {
|
||||||
return utils.GenericUpdateOne(set, id, a, &Booking{})
|
if set.(*Booking).State == 0 {
|
||||||
|
return nil, 400, errors.New("state is required")
|
||||||
|
}
|
||||||
|
realSet := &Booking{State: set.(*Booking).State}
|
||||||
|
return utils.GenericUpdateOne(realSet, id, a, &Booking{})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *bookingMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, int, error) {
|
func (a *bookingMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, int, error) {
|
||||||
|
@ -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)
|
||||||
ExecutionsID string `json:"executions_id,omitempty" bson:"executions_id,omitempty" validate:"required"`
|
ExecutionsID string `json:"executions_id,omitempty" bson:"executions_id,omitempty"`
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user