MCPcopy Create free account
hub / github.com/compozy/agh / Validate

Method Validate

internal/task/validate.go:939–974  ·  view source on GitHub ↗

Validate reports whether the task-query filters are internally consistent.

(path string)

Source from the content-addressed store, hash-verified

937
938// Validate reports whether the task-query filters are internally consistent.
939func (q Query) Validate(path string) error {
940 if q.Scope.Normalize() != "" {
941 if err := ValidateScopeBinding(q.Scope, q.WorkspaceID, path, "workspace_id"); err != nil {
942 return err
943 }
944 }
945 if q.Status.Normalize() != "" {
946 if err := q.Status.Validate(nestedPath(path, "status")); err != nil {
947 return err
948 }
949 }
950 if q.Priority.Normalize() != "" {
951 if err := q.Priority.Validate(nestedPath(path, "priority")); err != nil {
952 return err
953 }
954 }
955 if q.ApprovalState.Normalize() != "" {
956 if err := q.ApprovalState.Validate(nestedPath(path, "approval_state")); err != nil {
957 return err
958 }
959 }
960 if q.OwnerKind.Normalize() != "" {
961 if err := q.OwnerKind.Validate(nestedPath(path, "owner_kind")); err != nil {
962 return err
963 }
964 }
965 if q.CreatedByKind.Normalize() != "" {
966 if err := q.CreatedByKind.Validate(nestedPath(path, "created_by_kind")); err != nil {
967 return err
968 }
969 }
970 if q.Limit < 0 {
971 return fmt.Errorf("%w: %s must be zero or positive: %d", ErrValidation, nestedPath(path, "limit"), q.Limit)
972 }
973 return nil
974}
975
976// Validate reports whether the scheduler backlog filters are internally consistent.
977func (q SchedulerBacklogQuery) Validate(path string) error {

Callers 2

taskListDomainQueryMethod · 0.95
taskQueryFromParamsMethod · 0.95

Calls 4

ValidateScopeBindingFunction · 0.70
nestedPathFunction · 0.70
ValidateMethod · 0.65
NormalizeMethod · 0.45

Tested by

no test coverage detected