-
Notifications
You must be signed in to change notification settings - Fork 1
/
models.go
54 lines (48 loc) · 1.51 KB
/
models.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package main
import (
"time"
)
type Restaurant struct {
ID int
Name string `gorm:"size:99; not null; unique"`
DateCreated time.Time `gorm:"not null" sql:"DEFAULT:current_timestamp"`
}
type Buzzer struct {
ID int
RestaurantID int `sql:"DEFAULT:null"`
BuzzerName string `gorm:"size:45; not null; unique"`
LastHeartbeat time.Time
IsActive bool `gorm:"not null"`
}
type ActiveParty struct {
ID int
RestaurantID int `gorm:"not null"`
PartyName string `gorm:"size:50; not null"`
PartySize int `gorm:"not null"`
TimeCreated time.Time `gorm:"not null" sql:"DEFAULT:current_timestamp"`
PhoneAhead bool `gorm:"not null"`
IsTableReady bool `gorm:"not null" sql:"DEFAULT:false`
WaitTimeExpected int
WaitTimeCalculated int
BuzzerID int `sql:"DEFAULT:null"`
PartyNotes string `gorm:"size:150"`
}
type HistoricalParty struct {
ID int
RestaurantID int `gorm:"not null"`
PartyName string `gorm:"size:50;not null"`
PartySize int `gorm:"not null"`
TimeCreated time.Time `gorm:"not null"`
TimeSeated time.Time `gorm:"not null"`
WaitTimeExpected int `gorm:"not null"`
WaitTimeCalculated int `gorm:"not null"`
WasPartySeated bool `gorm:"not null"`
}
type User struct {
ID int
RestaurantID int `gorm:"not null"`
Username string `gorm:"size:100;not null unique"`
Password string `gorm:"size:100; not null"`
PassSalt string `gorm:"size:50; not null"`
DateCreated time.Time `gorm:"not null" sql:"DEFAULT:current_timestamp"`
}