model

package
v0.0.0-...-5e1236a Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cart

type Cart struct {
	UserID    uuid.UUID `json:"user_id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`

	Cartlines []*CartLine
}

Represents how the cart structure is stored in the database

func (*Cart) ToProto

func (cart *Cart) ToProto() *pbCart.CartResponse

type CartLine

type CartLine struct {
	UserID    uuid.UUID `json:"user_id"`
	ProductID uuid.UUID `json:"product_id"`
	Quantity  int64     `json:"quantity" validate:"min=0,max=10000000"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

Represents one line with a product in a shopping cart in the database

func (*CartLine) ToProto

func (cartline *CartLine) ToProto() *pbCart.CartlineResponse

func (*CartLine) Validate

func (cartline *CartLine) Validate() error

type CartTask

type CartTask struct {
	UserID    uuid.UUID `json:"user_id"`
	Timestamp int64     `json:"timestamp"`
}

func (*CartTask) MarshalBinary

func (task *CartTask) MarshalBinary() ([]byte, error)

func (*CartTask) UnmarshalBinary

func (task *CartTask) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

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