model

package
v0.0.0-...-f76ff00 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	domain.Base
	Country string    `json:"country"`
	City    string    `json:"city"`
	Street  string    `json:"street"`
	Phone   string    `json:"phone"`
	UserID  uuid.UUID `json:"user_id"`
	User    domain.User
}

Address represent address

func (*Address) Preloads

func (t *Address) Preloads() []string

func (*Address) Prepare

func (t *Address) Prepare(ctx context.Context) error

func (*Address) ResourceName

func (t *Address) ResourceName() string

func (*Address) SetUserID

func (t *Address) SetUserID(userID uuid.UUID)

func (*Address) Validate

func (t *Address) Validate(ctx context.Context) error

Validate checks structure consistency

type Category

type Category struct {
	domain.Base
	Name string `json:"name"`
}

Category represent category

func (*Category) IsGlobal

func (t *Category) IsGlobal() bool

func (*Category) Prepare

func (t *Category) Prepare(ctx context.Context) error

func (*Category) ResourceName

func (t *Category) ResourceName() string

func (*Category) Validate

func (t *Category) Validate(ctx context.Context) error

Validate checks structure consistency

type Meal

type Meal struct {
	domain.Base
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Cost        float32   `json:"cost"`
	CategoryID  uuid.UUID `json:"category_id"`
	Category    Category
}

Meal represent meal

func (*Meal) Preloads

func (t *Meal) Preloads() []string

func (*Meal) Prepare

func (t *Meal) Prepare(ctx context.Context) error

func (*Meal) ResourceName

func (t *Meal) ResourceName() string

func (*Meal) Validate

func (t *Meal) Validate(ctx context.Context) error

Validate checks structure consistency

type Order

type Order struct {
	domain.Base
	Price  float32   `json:"price"`
	Status string    `json:"status"`
	UserID uuid.UUID `json:"user_id"`
	User   domain.User
}

Order represent order

func (*Order) Preloads

func (o *Order) Preloads() []string

func (*Order) Prepare

func (o *Order) Prepare(ctx context.Context) error

func (*Order) ResourceName

func (o *Order) ResourceName() string

func (*Order) SetUserID

func (o *Order) SetUserID(userID uuid.UUID)

func (*Order) Validate

func (o *Order) Validate(ctx context.Context) error

Validate checks structure consistency

type OrderItem

type OrderItem struct {
	domain.Base
	Amount  int       `json:"amount"`
	Comment string    `json:"comment"`
	MealID  uuid.UUID `json:"meal_id"`
	Meal    Meal
	OrderID uuid.UUID `json:"order_id"`
	Order   Order
	UserID  uuid.UUID `json:"user_id"`
	User    domain.User
}

OrderItem represent order item

func (*OrderItem) Preloads

func (o *OrderItem) Preloads() []string

func (*OrderItem) Prepare

func (o *OrderItem) Prepare(ctx context.Context) error

func (*OrderItem) ResourceName

func (o *OrderItem) ResourceName() string

func (*OrderItem) SetUserID

func (o *OrderItem) SetUserID(userID uuid.UUID)

func (*OrderItem) Validate

func (o *OrderItem) Validate(ctx context.Context) error

Validate checks structure consistency

Jump to

Keyboard shortcuts

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