package
Version:
v0.0.0-...-f330cb9
Opens a new window with list of versions in this module.
Published: Nov 9, 2021
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type BaseModel struct {
ID uint `json:"id" gorm:"primary_key"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
}
type Booking struct {
BaseModel
Customer string `json:"customer"`
StartDate time.Time `json:"start_date" binding:"required" gorm:"not null"`
EndDate time.Time `json:"end_date" binding:"required" gorm:"not null"`
Notes string `json:"notes"`
RoomID uint `json:"room_id" gorm:"not null"`
ServiceIDs []uint `json:"service_ids" gorm:"-"`
Services []Service `json:"-" gorm:"many2many:booking_services"`
}
type Room struct {
BaseModel
Name string `json:"name" binding:"required" gorm:"not null"`
MaxGuests uint8 `json:"max_guests" binding:"required" gorm:"not null"`
Price float32 `json:"price"`
Notes string `json:"notes"`
Bookings []Booking `json:"-"`
}
type Service struct {
BaseModel
Name string `json:"name" binding:"required" gorm:"not null"`
Price float32 `json:"price"`
}
type User struct {
BaseModel
Email string `json:"email" gorm:"not null;unique;index"`
Password string `json:"password" gorm:"not null"`
Level string `json:"level" gorm:"not null"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.