Bug on Format date

This commit is contained in:
mr
2024-08-22 08:45:26 +02:00
parent b8b62dc2c8
commit 11c55d422f
2 changed files with 9 additions and 22 deletions

View File

@@ -17,7 +17,7 @@ type Booking struct {
DatacenterResourceID string `json:"datacenter_resource_id,omitempty" bson:"datacenter_resource_id,omitempty" validate:"required"`
}
func (wfa *Booking) CheckBooking(start time.Time, end *time.Time) (bool, error) {
func (wfa *Booking) CheckBooking(id string, start time.Time, end *time.Time) (bool, error) {
// check if
if end == nil {
// if no end... then Book like a savage
@@ -27,6 +27,7 @@ func (wfa *Booking) CheckBooking(start time.Time, end *time.Time) (bool, error)
accessor := wfa.GetAccessor(nil)
res, code, err := accessor.Search(&dbs.Filters{
And: map[string][]dbs.Filter{
"datacenter_resource_id": {{Operator: dbs.EQUAL.String(), Value: id}},
"workflowexecution.state": {{Operator: dbs.EQUAL.String(), Value: workflow_execution.SCHEDULED.EnumIndex()}},
"workflowexecution.execution_date": {
{Operator: dbs.LTE.String(), Value: primitive.NewDateTimeFromTime(e)},