models

package
v0.0.0-...-288c1ed Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderStatusPending   = "pending"
	OrderStatusCompleted = "completed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	ID        uuid.UUID `gorm:"type:uuid;primary_key"`
	CreatedAt time.Time
}

func (*Base) BeforeCreate

func (b *Base) BeforeCreate(tx *gorm.DB) (err error)

type Item

type Item struct {
	Base
	Name        string
	Description *string
	Price       float64
}

type Order

type Order struct {
	Base
	UserID string
	Items  []*Item `gorm:"many2many:order_items;"`
	Total  float64
	Status string
}

type User

type User struct {
	ID    string `gorm:"primary_key"`
	Email string
	Name  string
}

Jump to

Keyboard shortcuts

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