domain

package
v3.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute interface{}

Attribute interface

type Attributes

type Attributes map[string]Attribute

Attributes map

type CustomerIdentityOrderService added in v3.3.0

type CustomerIdentityOrderService interface {
	// Get all orders for a customer
	Get(ctx context.Context, identity auth.Identity) ([]*Order, error)
	// GetByID returns a single order for a customer
	GetByID(ctx context.Context, identity auth.Identity, orderID string) (*Order, error)
}

CustomerIdentityOrderService loads orders for an authenticated user

type DecoratedOrder

type DecoratedOrder struct {
	Order          *Order
	DecoratedItems []*DecoratedOrderItem
}

DecoratedOrder struct

func (*DecoratedOrder) GetGroupedBy

func (rd *DecoratedOrder) GetGroupedBy(group string, sortGroup bool) *GroupedDecoratedOrder

GetGroupedBy groups the decorated order into a *GroupedDecoratedOrder

type DecoratedOrderItem

type DecoratedOrderItem struct {
	Item    *OrderItem
	Product domain.BasicProduct
}

DecoratedOrderItem struct

func (DecoratedOrderItem) GetDisplayMarketplaceCode

func (doi DecoratedOrderItem) GetDisplayMarketplaceCode() string

GetDisplayMarketplaceCode getter

func (DecoratedOrderItem) GetDisplayTitle

func (doi DecoratedOrderItem) GetDisplayTitle() string

GetDisplayTitle getter

func (DecoratedOrderItem) GetVariant

func (doi DecoratedOrderItem) GetVariant() (*domain.Variant, error)

GetVariant getter

func (DecoratedOrderItem) GetVariantsVariationAttributeCodes

func (doi DecoratedOrderItem) GetVariantsVariationAttributeCodes() []string

GetVariantsVariationAttributeCodes gets the decorated order item variant variation attributes

func (DecoratedOrderItem) GetVariantsVariationAttributes

func (doi DecoratedOrderItem) GetVariantsVariationAttributes() domain.Attributes

GetVariantsVariationAttributes gets the decorated order item variant attributes

func (DecoratedOrderItem) IsConfigurable

func (doi DecoratedOrderItem) IsConfigurable() bool

IsConfigurable - checks if current order item is a configurable product

type GroupedDecoratedOrder

type GroupedDecoratedOrder struct {
	Order  *DecoratedOrder
	Groups []*GroupedDecoratedOrderItems
}

GroupedDecoratedOrder struct

type GroupedDecoratedOrderItems

type GroupedDecoratedOrderItems struct {
	DecoratedItems []*DecoratedOrderItem
	Group          string
}

GroupedDecoratedOrderItems struct

func (*GroupedDecoratedOrderItems) GetSourceIds

func (i *GroupedDecoratedOrderItems) GetSourceIds() []string

GetSourceIds collects the source ids of the items of the group

type Order

type Order struct {
	ID           string
	CreationTime time.Time
	UpdateTime   time.Time
	OrderItems   []*OrderItem
	Status       string
	Total        float64
	CurrencyCode string
	Attributes   Attributes
}

Order struct

type OrderDecorator

type OrderDecorator struct {
	ProductService domain.ProductService `inject:""`
	Logger         flamingo.Logger       `inject:""`
}

OrderDecorator struct defines the order decorator

func (*OrderDecorator) Create

func (rd *OrderDecorator) Create(ctx context.Context, order *Order) *DecoratedOrder

Create creates a new decorated order

type OrderDecoratorInterface

type OrderDecoratorInterface interface {
	Create(context.Context, *Order) *DecoratedOrder
}

OrderDecoratorInterface defines the interface of the order decorator

type OrderItem

type OrderItem struct {
	// DEPRECATED
	Sku string

	MarketplaceCode        string
	VariantMarketplaceCode string

	Qty float64

	CurrencyCode       string
	SinglePrice        float64
	SinglePriceInclTax float64
	RowTotal           float64
	TaxAmount          float64
	RowTotalInclTax    float64

	Name         string
	Price        float64
	PriceInclTax float64

	// Source Id where the item should be picked
	SourceID string

	Attributes Attributes
}

OrderItem struct

Jump to

Keyboard shortcuts

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