order

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Product   *product.Product
	CreatedAt time.Time
}

type Order

type Order struct {
	ID        uint
	Type      *Type
	Status    *Status
	Items     []*Item
	CreatedAt time.Time
}

type Repository

type Repository interface {
	GetPaginated(ctx context.Context, limit, offset int, sortBy []string) ([]*Order, error)
	Count(ctx context.Context) (int64, error)
	GetAll(ctx context.Context) ([]*Order, error)
	GetByID(ctx context.Context, id uint) (*Order, error)
	Create(ctx context.Context, data *Order) error
	Update(ctx context.Context, data *Order) error
	Delete(ctx context.Context, id uint) error
}

type Status

type Status struct {
	// contains filtered or unexported fields
}

func NewStatus

func NewStatus(value string) (*Status, error)

func (Status) Get

func (s Status) Get() StatusEnum

func (Status) Is

func (s Status) Is(value StatusEnum) bool

func (Status) String

func (s Status) String() string

type StatusEnum

type StatusEnum string
const (
	Pending  StatusEnum = "pending"
	Complete StatusEnum = "complete"
)

func (StatusEnum) IsValid

func (s StatusEnum) IsValid() bool

type Type

type Type struct {
	// contains filtered or unexported fields
}

func NewType

func NewType(value string) (*Type, error)

func (Type) Get

func (t Type) Get() TypeEnum

func (Type) Is

func (t Type) Is(value TypeEnum) bool

func (Type) String

func (t Type) String() string

type TypeEnum

type TypeEnum string
const (
	TypeIn  TypeEnum = "in"
	TypeOut TypeEnum = "out"
)

func (TypeEnum) IsValid

func (t TypeEnum) IsValid() bool

Jump to

Keyboard shortcuts

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