dto

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapBundleConfigToDomain

func MapBundleConfigToDomain(graphqlBundleConfig []ChoiceConfiguration) productDomain.BundleConfiguration

Types

type AddToCart

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

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

CartAppliedDiscounts DTO for cart.AppliedDiscounts

func (*CartAppliedDiscounts) ByCampaignCode

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

ByCampaignCode getter and wrapper

func (*CartAppliedDiscounts) ByType

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

ByType getter and wrapper

func (*CartAppliedDiscounts) Items

Items getter

type CartAppliedDiscountsResolver

type CartAppliedDiscountsResolver struct{}

CartAppliedDiscountsResolver resolves discounts for items

func (*CartAppliedDiscountsResolver) ForItem

ForItem resolves for cart Items

func (*CartAppliedDiscountsResolver) ForShippingItem

ForShippingItem resolves for shipping Items

type CartSummary

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

CartSummary provides custom graphql interface methods

func (*CartSummary) Discounts

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

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

GrandTotalWithGiftCards sums grand total with gift cards

func (*CartSummary) HasAppliedDiscounts

func (cs *CartSummary) HasAppliedDiscounts() bool

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

func (CartSummary) SumPaymentSelectionCartSplitValueAmountByMethods

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

SumPaymentSelectionCartSplitValueAmountByMethods sum

func (CartSummary) SumTaxes

func (cs CartSummary) SumTaxes() *Taxes

SumTaxes sums taxes

func (*CartSummary) SumTotalDiscountWithGiftCardsAmount

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

SumTotalDiscountWithGiftCardsAmount returns sum price of total discounts with applied gift cards

func (CartSummary) TotalDiscountAmount

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

TotalDiscountAmount returns the sum of the applied values of the AppliedDiscounts

func (CartSummary) TotalGiftCardAmount

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

TotalGiftCardAmount sums applied gift cards

type ChoiceConfiguration

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

type CustomAttributes

type CustomAttributes struct {
	Attributes map[string]string
}

CustomAttributes represents map of custom attributes of cart and delivery info

func (*CustomAttributes) Get

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

Get attribute by key

type DecoratedCart

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

DecoratedCart – provides custom graphql interface methods

func NewDecoratedCart

func NewDecoratedCart(dc *decorator.DecoratedCart) *DecoratedCart

NewDecoratedCart – factory method

func (DecoratedCart) Cart

func (dc DecoratedCart) Cart() cart.Cart

Cart – provides the cart

func (*DecoratedCart) CartSummary

func (dc *DecoratedCart) CartSummary() CartSummary

CartSummary – returns cart summary

func (DecoratedCart) DecoratedCart

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

DecoratedCart – provides the cart

func (DecoratedCart) DecoratedDeliveries

func (dc DecoratedCart) DecoratedDeliveries() []DecoratedDelivery

DecoratedDeliveries – returns decorated deliveries

func (*DecoratedCart) GetAllPaymentRequiredItems

func (dc *DecoratedCart) GetAllPaymentRequiredItems() PricedItems

GetAllPaymentRequiredItems – returns all payment required items

func (*DecoratedCart) GetDecoratedDeliveryByCode

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

GetDecoratedDeliveryByCode – returns decorated delivery filtered by code

type DecoratedCartItem

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

DecoratedCartItem Decorates a CartItem with its Product

type DecoratedDelivery

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

DecoratedDelivery Decorates a CartItem with its Product

type DeliveryAdditionalData

type DeliveryAdditionalData struct {
	DeliveryCode   string
	AdditionalData []KeyValue
}

DeliveryAdditionalData of delivery

type DeliveryAddressForm

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

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

type KeyValue struct {
	Key   string
	Value string
}

KeyValue for cart and delivery

type PaymentSelectionSplit

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

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

type PricedCartItem

type PricedCartItem struct {
	Amount domain.Price
	ItemID string
}

PricedCartItem – cart item with price

type PricedItems

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

PricedItems – provides custom graphql interface methods

func (PricedItems) CartItems

func (pr PricedItems) CartItems() []PricedCartItem

CartItems – return all cart items

func (PricedItems) ShippingItems

func (pr PricedItems) ShippingItems() []PricedShippingItem

ShippingItems – return all shipping items

func (PricedItems) TotalItems

func (pr PricedItems) TotalItems() []PricedTotalItem

TotalItems – return all total items

type PricedShippingItem

type PricedShippingItem struct {
	Amount           domain.Price
	DeliveryInfoCode string
}

PricedShippingItem – shipping item with price

type PricedTotalItem

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

type Taxes struct {
	Items []cart.Tax
}

Taxes – provides custom graphql interface methods

func (Taxes) GetByType

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

GetByType - returns tax by given type

type UpdateShippingOptionsResult

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