sprechstunden-go/models/request.go

23 lines
563 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.
2024-01-03 16:04:38 +00:00
RequestDelete // Fix integer to represent request for deletion of an office hour.
2023-01-04 12:06:13 +00:00
)
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
}