dto

package
v3.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapBundleConfigToDomain added in v3.6.0

func MapBundleConfigToDomain(graphqlBundleConfig []ChoiceConfiguration) productDomain.BundleConfiguration

Types

type AddToCart added in v3.6.0

type AddToCart struct {
	MarketplaceCode        string
	Qty                    int
	DeliveryCode           string
	VariantMarketplaceCode string
	BundleConfiguration    []ChoiceConfiguration
}

type BillingAddressForm

type BillingAddressForm struct {
	FormData       forms.AddressForm
	Processed      bool
	ValidationInfo ValidationInfo
}

BillingAddressForm is the GraphQL representation of the billing form

type CartAppliedDiscounts added in v3.3.0

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

CartAppliedDiscounts DTO for cart.AppliedDiscounts

func (*CartAppliedDiscounts) ByCampaignCode added in v3.3.0

func (d *CartAppliedDiscounts) ByCampaignCode(campaignCode string) *CartAppliedDiscounts

ByCampaignCode getter and wrapper

func (*CartAppliedDiscounts) ByType added in v3.3.0

func (d *CartAppliedDiscounts) ByType(filterType string) *CartAppliedDiscounts

ByType getter and wrapper

func (*CartAppliedDiscounts) Items added in v3.3.0

Items getter

type CartAppliedDiscountsResolver added in v3.3.0

type CartAppliedDiscountsResolver struct{}

CartAppliedDiscountsResolver resolves discounts for items

func (*CartAppliedDiscountsResolver) ForItem added in v3.3.0

ForItem resolves for cart Items

func (*CartAppliedDiscountsResolver) ForShippingItem added in v3.3.0

ForShippingItem resolves for shipping Items

type CartSummary added in v3.0.1

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

CartSummary provides custom graphql interface methods

func (*CartSummary) Discounts added in v3.0.1

func (cs *CartSummary) Discounts() *CartAppliedDiscounts

Discounts collects up discounts of cart based on its deliveries All discounts with the same campaign code are aggregated and returned as one with a summed price

func (CartSummary) GrandTotalWithGiftCards added in v3.6.0

func (cs CartSummary) GrandTotalWithGiftCards() *domain.Price

GrandTotalWithGiftCards sums grand total with gift cards

func (*CartSummary) HasAppliedDiscounts added in v3.0.1

func (cs *CartSummary) HasAppliedDiscounts() bool

HasAppliedDiscounts check whether there are any discounts currently applied to the cart

func (CartSummary) SumPaymentSelectionCartSplitValueAmountByMethods added in v3.3.0

func (cs CartSummary) SumPaymentSelectionCartSplitValueAmountByMethods(methods []string) *domain.Price

SumPaymentSelectionCartSplitValueAmountByMethods sum

func (CartSummary) SumTaxes added in v3.0.1

func (cs CartSummary) SumTaxes() *Taxes

SumTaxes sums taxes

func (*CartSummary) SumTotalDiscountWithGiftCardsAmount added in v3.0.1

func (cs *CartSummary) SumTotalDiscountWithGiftCardsAmount() domain.Price

SumTotalDiscountWithGiftCardsAmount returns sum price of total discounts with applied gift cards

func (CartSummary) TotalDiscountAmount added in v3.6.0

func (cs CartSummary) TotalDiscountAmount() *domain.Price

TotalDiscountAmount returns the sum of the applied values of the AppliedDiscounts

func (CartSummary) TotalGiftCardAmount added in v3.6.0

func (cs CartSummary) TotalGiftCardAmount() *domain.Price

TotalGiftCardAmount sums applied gift cards

type ChoiceConfiguration added in v3.6.0

type ChoiceConfiguration struct {
	Identifier             string
	MarketplaceCode        string
	VariantMarketplaceCode *string
	Qty                    int
}

type CustomAttributes added in v3.5.0

type CustomAttributes struct {
	Attributes map[string]string
}

CustomAttributes represents map of custom attributes of cart and delivery info

func (*CustomAttributes) Get added in v3.5.0

func (c *CustomAttributes) Get(key string) *KeyValue

Get attribute by key

type DecoratedCart added in v3.0.1

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

DecoratedCart – provides custom graphql interface methods

func NewDecoratedCart added in v3.0.1

func NewDecoratedCart(dc *decorator.DecoratedCart) *DecoratedCart

NewDecoratedCart – factory method

func (DecoratedCart) Cart added in v3.0.1

func (dc DecoratedCart) Cart() cart.Cart

Cart – provides the cart

func (*DecoratedCart) CartSummary added in v3.0.1

func (dc *DecoratedCart) CartSummary() CartSummary

CartSummary – returns cart summary

func (DecoratedCart) DecoratedCart added in v3.9.0

func (dc DecoratedCart) DecoratedCart() *decorator.DecoratedCart

DecoratedCart – provides the cart

func (DecoratedCart) DecoratedDeliveries added in v3.0.1

func (dc DecoratedCart) DecoratedDeliveries() []DecoratedDelivery

DecoratedDeliveries – returns decorated deliveries

func (*DecoratedCart) GetAllPaymentRequiredItems added in v3.0.1

func (dc *DecoratedCart) GetAllPaymentRequiredItems() PricedItems

GetAllPaymentRequiredItems – returns all payment required items

func (*DecoratedCart) GetDecoratedDeliveryByCode added in v3.0.1

func (dc *DecoratedCart) GetDecoratedDeliveryByCode(deliveryCode string) *DecoratedDelivery

GetDecoratedDeliveryByCode – returns decorated delivery filtered by code

type DecoratedCartItem added in v3.4.0

type DecoratedCartItem struct {
	Item    cart.Item
	Product graphqlProductDto.Product
}

DecoratedCartItem Decorates a CartItem with its Product

type DecoratedDelivery added in v3.4.0

type DecoratedDelivery struct {
	Delivery       cart.Delivery
	DecoratedItems []DecoratedCartItem
}

DecoratedDelivery Decorates a CartItem with its Product

type DeliveryAdditionalData added in v3.5.0

type DeliveryAdditionalData struct {
	DeliveryCode   string
	AdditionalData []KeyValue
}

DeliveryAdditionalData of delivery

type DeliveryAddressForm added in v3.3.0

type DeliveryAddressForm struct {
	FormData          forms.AddressForm
	Processed         bool
	ValidationInfo    ValidationInfo
	UseBillingAddress bool
	DeliveryCode      string
	Method            string
	Carrier           string
	DesiredTime       time.Time
}

DeliveryAddressForm is the GraphQL representation of the delivery form

type DeliveryShippingOption added in v3.3.0

type DeliveryShippingOption struct {
	DeliveryCode string
	Method       string
	Carrier      string
}

DeliveryShippingOption used to update shipping method/carrier for a specific delivery

type FieldError

type FieldError struct {
	// MessageKey - a key of the error message. Often used to pass to translation func in the template
	MessageKey string
	// DefaultLabel - a speaking error label. OFten used to show to end user - in case no translation exists
	DefaultLabel string
	// FieldName
	FieldName string
}

FieldError contains field related errors

type KeyValue added in v3.5.0

type KeyValue struct {
	Key   string
	Value string
}

KeyValue for cart and delivery

type PaymentSelectionSplit added in v3.3.0

type PaymentSelectionSplit struct {
	Qualifier cart.SplitQualifier
	Charge    domain.Charge
}

PaymentSelectionSplit is a GraphQL specific representation of `cart.PaymentSplit`

type PricedCartItem added in v3.0.1

type PricedCartItem struct {
	Amount domain.Price
	ItemID string
}

PricedCartItem – cart item with price

type PricedItems added in v3.0.1

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

PricedItems – provides custom graphql interface methods

func (PricedItems) CartItems added in v3.0.1

func (pr PricedItems) CartItems() []PricedCartItem

CartItems – return all cart items

func (PricedItems) ShippingItems added in v3.0.1

func (pr PricedItems) ShippingItems() []PricedShippingItem

ShippingItems – return all shipping items

func (PricedItems) TotalItems added in v3.0.1

func (pr PricedItems) TotalItems() []PricedTotalItem

TotalItems – return all total items

type PricedShippingItem added in v3.0.1

type PricedShippingItem struct {
	Amount           domain.Price
	DeliveryInfoCode string
}

PricedShippingItem – shipping item with price

type PricedTotalItem added in v3.0.1

type PricedTotalItem struct {
	Amount domain.Price
	Code   string
}

PricedTotalItem – total item with price

type SelectedPaymentResult

type SelectedPaymentResult struct {
	Processed      bool
	ValidationInfo ValidationInfo
}

SelectedPaymentResult represents the selected payment

type Taxes added in v3.0.1

type Taxes struct {
	Items []cart.Tax
}

Taxes – provides custom graphql interface methods

func (Taxes) GetByType added in v3.0.1

func (t Taxes) GetByType(taxType string) cart.Tax

GetByType - returns tax by given type

type UpdateShippingOptionsResult added in v3.5.0

type UpdateShippingOptionsResult struct {
	Processed bool
}

UpdateShippingOptionsResult definition

type ValidationInfo

type ValidationInfo struct {
	GeneralErrors []formDomain.Error
	FieldErrors   []FieldError
}

ValidationInfo contains form related validation information

Jump to

Keyboard shortcuts

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