sprechstunden-go/models/request.go

23 lines
556 B
Go
Raw Normal View History

// request
package models
2023-01-04 12:06:13 +00:00
type RequestAction int
type Request struct {
Id int
OfficeHour OfficeHour
2023-01-04 12:06:13 +00:00
Action RequestAction
Secret string
}
2023-01-04 12:06:13 +00:00
const (
RequestActivate RequestAction = iota // Fix integer to represent request for activation of an office hour.
RequestDelete // Fix integer to represent request for deletion of an office hour.
)
type RequestRepository interface {
2023-01-04 12:06:13 +00:00
Add(officeHour OfficeHour, action RequestAction) (int, error)
FindBySecret(secret string) (Request, error)
Execute(request Request) error
}