package
Version:
v0.0.0-...-54312f5
Opens a new window with list of versions in this module.
Published: Sep 1, 2024
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Coffee struct {
gorm.Model
Name string `gorm:"not null unique index"`
Description string `gorm:"not null"`
Origin string `gorm:"not null"`
Contents pq.StringArray `gorm:"type:text[]"`
Cost int64 `gorm:"not null index"`
}
type CoffeeHouse struct {
gorm.Model
Name string `gorm:"not null unique"`
UserCount int64 `gorm:"not null default:0 index"`
Revenue int64 `gorm:"not null default:0 index"`
AvailableCoffees []Coffee `gorm:"many2many:coffee_house_coffees"`
}
type Payment struct {
gorm.Model
UserID uint `gorm:"not null index"`
HouseID uint `gorm:"not null index"`
Cost int64 `gorm:"not null"`
Date time.Time `gorm:"not null"`
Items []Coffee `gorm:"many2many:payment_items"`
}
type User struct {
gorm.Model
Name string `gorm:"not null"`
Email string `gorm:"not null unique"`
Password string `gorm:"not null unique"`
Orders []Payment `gorm:"foreignKey:UserID"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.