Skip to content

Commit

Permalink
Merge branch 'interuss:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
barroco authored Sep 6, 2024
2 parents 7bfcb3b + 83bc148 commit f4b67b2
Show file tree
Hide file tree
Showing 2 changed files with 270 additions and 219 deletions.
21 changes: 0 additions & 21 deletions pkg/scd/models/operational_intents.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import (

"github.com/golang/geo/s2"
restapi "github.com/interuss/dss/pkg/api/scdv1"
dsserr "github.com/interuss/dss/pkg/errors"
dssmodels "github.com/interuss/dss/pkg/models"
"github.com/interuss/stacktrace"
)

// Aggregates constants for operational intents.
Expand Down Expand Up @@ -128,25 +126,6 @@ func (o *OperationalIntent) ToRest() *restapi.OperationalIntentReference {
return result
}

// ValidateTimeRange validates the time range of o.
func (o *OperationalIntent) ValidateTimeRange() error {
if o.StartTime == nil {
return stacktrace.NewErrorWithCode(dsserr.BadRequest, "Operation must have an time_start")
}

// EndTime cannot be omitted for new Operational Intents.
if o.EndTime == nil {
return stacktrace.NewErrorWithCode(dsserr.BadRequest, "Operation must have an time_end")
}

// EndTime cannot be before StartTime.
if o.EndTime.Sub(*o.StartTime) < 0 {
return stacktrace.NewErrorWithCode(dsserr.BadRequest, "Operation time_end must be after time_start")
}

return nil
}

// SetCells is a convenience function that accepts an int64 array and converts
// to s2.CellUnion.
// TODO: wrap s2.CellUnion in a custom type that embeds the struct such that
Expand Down
Loading

0 comments on commit f4b67b2

Please sign in to comment.