models/testgroup.go

34 lines
611 B
Go
Raw Normal View History

2024-09-23 18:38:34 +00:00
package models
import (
"errors"
)
type TestingStrategy int32
const (
EachTestTS TestingStrategy = 1
CompleteGroupTS TestingStrategy = 2
)
type Testgroup struct {
Id *int32 `db:"id"`
ProblemId *int32 `db:"problem_id"`
TestingStrategy *TestingStrategy `db:"testing_strategy"`
}
type TestGroupData struct {
Ts TestingStrategy
TestAmount int32
}
var ErrBadTestingStrategy = errors.New("bad testing strategy")
func (ts TestingStrategy) Valid() error {
switch ts {
case EachTestTS, CompleteGroupTS:
return nil
}
2024-10-05 15:19:02 +00:00
return ErrBadTestingStrategy
2024-09-23 18:38:34 +00:00
}