-
-
Notifications
You must be signed in to change notification settings - Fork 285
Expand file tree
/
Copy pathsend_schedule.go
More file actions
26 lines (22 loc) · 1.14 KB
/
send_schedule.go
File metadata and controls
26 lines (22 loc) · 1.14 KB
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
package entities
import (
"time"
"github.com/google/uuid"
)
// SendScheduleWindow represents a single availability window for a day of the week.
type SendScheduleWindow struct {
DayOfWeek int `json:"day_of_week" example:"1"`
StartMinute int `json:"start_minute" example:"540"`
EndMinute int `json:"end_minute" example:"1020"`
}
// SendSchedule controls when a phone is allowed to send outgoing SMS messages.
type SendSchedule struct {
ID uuid.UUID `json:"id" gorm:"primaryKey;type:uuid;" example:"32343a19-da5e-4b1b-a767-3298a73703cb"`
UserID UserID `json:"user_id" example:"WB7DRDWrJZRGbYrv2CKGkqbzvqdC"`
Name string `json:"name" example:"Business Hours"`
Timezone string `json:"timezone" example:"Europe/Tallinn"`
IsActive bool `json:"is_active" gorm:"default:true" example:"true"`
Windows []SendScheduleWindow `json:"windows" gorm:"type:jsonb;serializer:json"`
CreatedAt time.Time `json:"created_at" example:"2022-06-05T14:26:02.302718+03:00"`
UpdatedAt time.Time `json:"updated_at" example:"2022-06-05T14:26:10.303278+03:00"`
}