2022-09-05 15:55:08 +00:00
|
|
|
// request
|
|
|
|
package models
|
|
|
|
|
2023-01-04 12:06:13 +00:00
|
|
|
type RequestAction int
|
|
|
|
|
2022-09-05 15:55:08 +00:00
|
|
|
type Request struct {
|
|
|
|
Id int
|
|
|
|
OfficeHour OfficeHour
|
2023-01-04 12:06:13 +00:00
|
|
|
Action RequestAction
|
2022-09-05 15:55:08 +00:00
|
|
|
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.
|
|
|
|
)
|
2022-09-05 15:55:08 +00:00
|
|
|
|
|
|
|
type RequestRepository interface {
|
2023-01-04 12:06:13 +00:00
|
|
|
Add(officeHour OfficeHour, action RequestAction) (int, error)
|
2022-09-05 15:55:08 +00:00
|
|
|
FindBySecret(secret string) (Request, error)
|
|
|
|
Execute(request Request) error
|
|
|
|
}
|