105 lines
3.6 KiB
Go
105 lines
3.6 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type Room struct {
|
|
ID int `json:"id" db:"id"`
|
|
Name string `json:"name" db:"name"`
|
|
Capacity int `json:"capacity" db:"capacity"`
|
|
Color string `json:"color" db:"color"`
|
|
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
|
}
|
|
|
|
type Table struct {
|
|
ID int `json:"id" db:"id"`
|
|
RoomID int `json:"room_id" db:"room_id"`
|
|
X int `json:"x" db:"x"`
|
|
Y int `json:"y" db:"y"`
|
|
Width int `json:"width" db:"width"`
|
|
Height int `json:"height" db:"height"`
|
|
MaxGuests int `json:"max_guests" db:"max_guests"`
|
|
Shape string `json:"shape" db:"shape"`
|
|
Status string `json:"status" db:"status"`
|
|
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
|
RoomName string `json:"room_name,omitempty" db:"-"`
|
|
}
|
|
|
|
type Reservation struct {
|
|
ID int `json:"id" db:"id"`
|
|
TableID int `json:"table_id" db:"table_id"`
|
|
Date string `json:"date" db:"date"`
|
|
TimeFrom string `json:"time_from" db:"time_from"`
|
|
TimeTo string `json:"time_to" db:"time_to"`
|
|
Guests int `json:"guests" db:"guests"`
|
|
Name string `json:"name" db:"name"`
|
|
Phone string `json:"phone" db:"phone"`
|
|
Email string `json:"email" db:"email"`
|
|
Source string `json:"source" db:"source"`
|
|
Notes string `json:"notes" db:"notes"`
|
|
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
|
TableName string `json:"table_name,omitempty" db:"-"`
|
|
}
|
|
|
|
// NEW: RoomBooking for entire room reservations
|
|
type RoomBooking struct {
|
|
ID int `json:"id" db:"id"`
|
|
RoomID int `json:"room_id" db:"room_id"`
|
|
Date string `json:"date" db:"date"`
|
|
TimeFrom string `json:"time_from" db:"time_from"`
|
|
TimeTo string `json:"time_to" db:"time_to"`
|
|
Guests int `json:"guests" db:"guests"`
|
|
Name string `json:"name" db:"name"`
|
|
Phone string `json:"phone" db:"phone"`
|
|
Email string `json:"email" db:"email"`
|
|
EventType string `json:"event_type" db:"event_type"`
|
|
Notes string `json:"notes" db:"notes"`
|
|
Status string `json:"status" db:"status"` // confirmed, cancelled, pending
|
|
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
|
RoomName string `json:"room_name,omitempty" db:"-"`
|
|
}
|
|
|
|
type TableMerge struct {
|
|
ID int `json:"id" db:"id"`
|
|
ParentTableID int `json:"parent_table_id" db:"parent_table_id"`
|
|
ChildTableID int `json:"child_table_id" db:"child_table_id"`
|
|
MergedName string `json:"merged_name" db:"merged_name"`
|
|
Active bool `json:"active" db:"active"`
|
|
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
|
}
|
|
|
|
type EmailConfig struct {
|
|
ID int `json:"id" db:"id"`
|
|
Host string `json:"host" db:"host"`
|
|
Port int `json:"port" db:"port"`
|
|
Username string `json:"user" db:"user"`
|
|
Password string `json:"password" db:"password"`
|
|
SSL bool `json:"ssl" db:"ssl"`
|
|
Folder string `json:"folder" db:"folder"`
|
|
}
|
|
|
|
type User struct {
|
|
ID int `json:"id" db:"id"`
|
|
Username string `json:"username" db:"username"`
|
|
Password string `json:"password" db:"password"`
|
|
IsAdmin bool `json:"is_admin" db:"is_admin"`
|
|
}
|
|
|
|
type Availability struct {
|
|
TableID int `json:"table_id"`
|
|
Date string `json:"date"`
|
|
TimeFrom string `json:"time_from"`
|
|
TimeTo string `json:"time_to"`
|
|
Status string `json:"status"`
|
|
}
|
|
|
|
// NEW: RoomAvailability for checking room availability
|
|
type RoomAvailability struct {
|
|
RoomID int `json:"room_id"`
|
|
Date string `json:"date"`
|
|
TimeFrom string `json:"time_from"`
|
|
TimeTo string `json:"time_to"`
|
|
Status string `json:"status"`
|
|
}
|