entities

package
v0.0.0-...-54312f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coffee

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

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

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

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL