model

package
v0.0.0-...-d552a0f Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	CategoryID  int64  `boil:"category_id" json:"category_id" toml:"category_id" yaml:"category_id"`
	Description string `boil:"description" json:"description" toml:"description" yaml:"description"`
}

func FromOrmCategory

func FromOrmCategory(category *orm.Category) Category

func (Category) ToOrmCategory

func (category Category) ToOrmCategory() *orm.Category

type Order

type Order struct {
	OrderID         util.UUIDString `boil:"order_id" json:"order_id" toml:"order_id" yaml:"order_id"`
	UserID          util.UUIDString `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	TotalAmount     int64           `boil:"total_amount" json:"total_amount" toml:"total_amount" yaml:"total_amount"`
	ShippingAddress string          `boil:"shipping_address" json:"shipping_address" toml:"shipping_address" yaml:"shipping_address"`
	Status          Status          `boil:"status" json:"status" toml:"status" yaml:"status"`
	CreatedAt       time.Time       `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt       time.Time       `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`
}

type OrderItem

type OrderItem struct {
	OrderID   util.UUIDString `boil:"order_id" json:"order_id" toml:"order_id" yaml:"order_id"`
	ProductID util.UUIDString `boil:"product_id" json:"product_id" toml:"product_id" yaml:"product_id"`
	Quantity  int64           `boil:"quantity" json:"quantity" toml:"quantity" yaml:"quantity"`
}

type Product

type Product struct {
	ProductID   util.UUIDString `boil:"product_id" json:"product_id" toml:"product_id" yaml:"product_id"`
	Name        string          `boil:"name" json:"name" toml:"name" yaml:"name"`
	Description string          `boil:"description" json:"description" toml:"description" yaml:"description"`
	Price       float32         `boil:"price" json:"price" toml:"price" yaml:"price"`
	Stock       int64           `boil:"stock" json:"stock" toml:"stock" yaml:"stock"`
	CategoryID  int64           `boil:"category_id" json:"category_id" toml:"category_id" yaml:"category_id"`
	CreatedAt   time.Time       `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UpdatedAt   time.Time       `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`
}

func FromOrmProduct

func FromOrmProduct(product *orm.Product) Product

func (Product) ToOrmProduct

func (p Product) ToOrmProduct() *orm.Product

type Status

type Status string
const (
	StatusProcessed Status = "processed"
	StatusShipped   Status = "shipped"
	StatusDelivered Status = "delivered"
)

Enum values for Status

type User

type User struct {
	UserID       util.UUIDString `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	Username     string          `boil:"username" json:"username" toml:"username" yaml:"username"`
	Email        string          `boil:"email" json:"email" toml:"email" yaml:"email"`
	PasswordHash string          `boil:"password_hash" json:"password_hash" toml:"password_hash" yaml:"password_hash"`
	CreatedAt    time.Time       `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
}

func FromOrmUser

func FromOrmUser(user *orm.User) User

func (User) ToOrmUser

func (u User) ToOrmUser() *orm.User

Jump to

Keyboard shortcuts

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