order

package
v0.0.0-...-0948bf3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOptions

func NewOptions() *options

NewOptions new options struct

func PrintOptions

func PrintOptions(packageName string)

Types

type CreateCmd

type CreateCmd struct {
	Items Items
	Off   uint8
}

func (*CreateCmd) Handle

func (c *CreateCmd) Handle(ctx context.Context, o *Order) error

type Item

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

func NewItem

func NewItem(productID dgo.ID, price types.Fen, count uint32) *Item

func (*Item) Count

func (e *Item) Count() uint32

func (*Item) Price

func (e *Item) Price() types.Fen

func (*Item) ProductID

func (e *Item) ProductID() dgo.ID

func (*Item) TotalPrice

func (e *Item) TotalPrice() types.Fen

type Items

type Items []*Item

func (Items) TotalPrice

func (i Items) TotalPrice() types.Fen

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option option interface

func SkipOption

func SkipOption() Option

func WithDeduction

func WithDeduction(deduction types.Fen) Option

WithDeduction deduction option of Order

func WithItems

func WithItems(items Items) Option

WithItems items option of Order

func WithOptions

func WithOptions(o *options) Option

func WithTotalPrice

func WithTotalPrice(totalPrice types.Fen) Option

WithTotalPrice totalPrice option of Order

type Order

type Order struct {
	dgo.AggBase
	// contains filtered or unexported fields
}

func New

func New(aggBase dgo.AggBase, _opts ...Option) *Order

New constructor

func (*Order) AggName

func (o *Order) AggName() string

func (*Order) Deduction

func (o *Order) Deduction() types.Fen

func (*Order) Items

func (o *Order) Items() Items

func (*Order) PaymentPrice

func (o *Order) PaymentPrice() types.Fen

func (*Order) SetOptions

func (_o *Order) SetOptions(_opts ...Option) *Order

func (*Order) TotalPrice

func (o *Order) TotalPrice() types.Fen

Jump to

Keyboard shortcuts

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