-
Notifications
You must be signed in to change notification settings - Fork 1
/
model.go
28 lines (23 loc) · 810 Bytes
/
model.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package appointment
import "time"
type AppointmentStatus string
const (
Open AppointmentStatus = "OPEN"
Booked AppointmentStatus = "BOOKED"
Unavailable AppointmentStatus = "UNAVAILABLE"
)
// Appointment holds relevant appointment information
type Appointment struct {
ID int64 `json:"id"`
TrainerID int64 `json:"trainer_id"`
UserID *int64 `json:"user_id"`
StartsAt time.Time `json:"starts_at"`
EndsAt time.Time `json:"ends_at"`
Status AppointmentStatus `json:"appointment_status"`
}
// Request represents a minimal body for booking an appointmeent.
// Only the appointmentI ID and UserID are needed to attempt a booking.
type Request struct {
AppointmentID int64 `json:"id"`
UserID int64 `json:"user_id"`
}