models/testgroup.go
Vyacheslav1557 b2d7f4e1c5 fix:
2024-10-05 20:19:02 +05:00

34 lines
611 B
Go

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
}
return ErrBadTestingStrategy
}