graphqlproductdto

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: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveVariantProduct

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

ActiveVariantProduct is a Product variant that reflects one possible configuration of a configurable

func (ActiveVariantProduct) ActiveVariationSelections

func (avp ActiveVariantProduct) ActiveVariationSelections() []ActiveVariationSelection

ActiveVariationSelections helper to easily access active variant attributes

func (ActiveVariantProduct) Attributes

Attributes of the active variant

func (ActiveVariantProduct) AvailablePrices added in v3.5.0

func (avp ActiveVariantProduct) AvailablePrices() []productDomain.PriceInfo

AvailablePrices of the active variant

func (ActiveVariantProduct) Badges

func (avp ActiveVariantProduct) Badges() ProductBadges

Badges of the active variant

func (ActiveVariantProduct) Categories

func (avp ActiveVariantProduct) Categories() ProductCategories

Categories of the active variant

func (ActiveVariantProduct) Description

func (avp ActiveVariantProduct) Description() string

Description of the active variant

func (ActiveVariantProduct) Identifier

func (avp ActiveVariantProduct) Identifier() string

Identifier of the active variant

func (ActiveVariantProduct) Loyalty

func (avp ActiveVariantProduct) Loyalty() ProductLoyalty

Loyalty contains loyalty information of the active variant

func (ActiveVariantProduct) MarketPlaceCode

func (avp ActiveVariantProduct) MarketPlaceCode() string

MarketPlaceCode of the active variant

func (ActiveVariantProduct) Media

func (avp ActiveVariantProduct) Media() ProductMedia

Media of the active variant

func (ActiveVariantProduct) Meta

func (avp ActiveVariantProduct) Meta() ProductMeta

Meta contains meta information from the active variant

func (ActiveVariantProduct) Price

Price of the active variant

func (ActiveVariantProduct) Product

Product the basic product domain object

func (ActiveVariantProduct) ShortDescription

func (avp ActiveVariantProduct) ShortDescription() string

ShortDescription of the product

func (ActiveVariantProduct) Title

func (avp ActiveVariantProduct) Title() string

Title of the active variant

func (ActiveVariantProduct) Type

func (avp ActiveVariantProduct) Type() string

Type of the product

func (ActiveVariantProduct) VariantMarketPlaceCode

func (avp ActiveVariantProduct) VariantMarketPlaceCode() string

VariantMarketPlaceCode of the active variant

func (ActiveVariantProduct) VariationSelections

func (avp ActiveVariantProduct) VariationSelections() []VariationSelection

VariationSelections contains information about the available variations for the product

type ActiveVariationSelection

type ActiveVariationSelection struct {
	Code     string
	Label    string
	Value    string
	UnitCode string
}

ActiveVariationSelection The variation for the currently active variant

type BundleProduct added in v3.6.0

type BundleProduct struct {
	Choices []Choice
	// contains filtered or unexported fields
}

BundleProduct A bundle Product with options

func (BundleProduct) Attributes added in v3.6.0

func (sp BundleProduct) Attributes() productDomain.Attributes

Attributes of the product

func (BundleProduct) AvailablePrices added in v3.6.0

func (sp BundleProduct) AvailablePrices() []productDomain.PriceInfo

AvailablePrices of the product

func (BundleProduct) Badges added in v3.6.0

func (sp BundleProduct) Badges() ProductBadges

Badges of the product

func (BundleProduct) Categories added in v3.6.0

func (sp BundleProduct) Categories() ProductCategories

Categories of the product

func (BundleProduct) Description added in v3.6.0

func (sp BundleProduct) Description() string

Description of the product

func (BundleProduct) Identifier added in v3.6.0

func (sp BundleProduct) Identifier() string

Identifier of the product

func (BundleProduct) Loyalty added in v3.6.0

func (sp BundleProduct) Loyalty() ProductLoyalty

Loyalty of the product

func (BundleProduct) MarketPlaceCode added in v3.6.0

func (sp BundleProduct) MarketPlaceCode() string

MarketPlaceCode of the product

func (BundleProduct) Media added in v3.6.0

func (sp BundleProduct) Media() ProductMedia

Media of the product

func (BundleProduct) Meta added in v3.6.0

func (sp BundleProduct) Meta() ProductMeta

Meta of the product

func (BundleProduct) Price added in v3.6.0

Price of the product

func (BundleProduct) Product added in v3.6.0

Product the bundle product information

func (BundleProduct) ShortDescription added in v3.6.0

func (sp BundleProduct) ShortDescription() string

ShortDescription of the product

func (BundleProduct) Title added in v3.6.0

func (sp BundleProduct) Title() string

Title of the product

func (BundleProduct) Type added in v3.6.0

func (sp BundleProduct) Type() string

Type the product type

type Choice added in v3.6.0

type Choice struct {
	Identifier string
	Required   bool
	Label      string
	Options    []Option

	// Deprecated: ActiveOption provides the product and quantity of the active choice
	Active       Product
	ActiveOption *Option
}

type ChoiceConfiguration added in v3.6.0

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

Product contains normalized Product information regardless of being a variant or simple Product

type ConfigurableProduct

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

ConfigurableProduct is a configurable without active variant

func (ConfigurableProduct) Attributes

Attributes of the configurable

func (ConfigurableProduct) AvailablePrices added in v3.5.0

func (cp ConfigurableProduct) AvailablePrices() []productDomain.PriceInfo

AvailablePrices of the configurable

func (ConfigurableProduct) Badges

func (cp ConfigurableProduct) Badges() ProductBadges

Badges of the configurable product

func (ConfigurableProduct) Categories

func (cp ConfigurableProduct) Categories() ProductCategories

Categories of the configurable

func (ConfigurableProduct) Description

func (cp ConfigurableProduct) Description() string

Description of the configurable

func (ConfigurableProduct) Identifier

func (cp ConfigurableProduct) Identifier() string

Identifier of the configurable

func (ConfigurableProduct) Loyalty

func (cp ConfigurableProduct) Loyalty() ProductLoyalty

Loyalty information about the configurable

func (ConfigurableProduct) MarketPlaceCode

func (cp ConfigurableProduct) MarketPlaceCode() string

MarketPlaceCode of the configurable

func (ConfigurableProduct) Media

func (cp ConfigurableProduct) Media() ProductMedia

Media of the configurable

func (ConfigurableProduct) Meta

func (cp ConfigurableProduct) Meta() ProductMeta

Meta metadata of the configurable

func (ConfigurableProduct) Price

Price of the configurable

func (ConfigurableProduct) Product

Product the base product

func (ConfigurableProduct) ShortDescription

func (cp ConfigurableProduct) ShortDescription() string

ShortDescription of the product

func (ConfigurableProduct) Title

func (cp ConfigurableProduct) Title() string

Title of the configurable

func (ConfigurableProduct) Type

func (cp ConfigurableProduct) Type() string

Type of the configurable

func (ConfigurableProduct) VariantSelection added in v3.6.0

func (cp ConfigurableProduct) VariantSelection() VariantSelection

VariantSelection contains possible combinations of variation attributes

type Option added in v3.6.0

type Option struct {
	Product Product
	Qty     int
}

type OtherAttributesRestriction added in v3.6.0

type OtherAttributesRestriction struct {
	Code             string
	AvailableOptions []string
}

Product contains normalized Product information regardless of being a variant or simple Product

type Product

type Product interface {
	Product() productDomain.BasicProduct
	Type() string
	MarketPlaceCode() string
	Identifier() string
	Media() ProductMedia
	Price() productDomain.PriceInfo
	AvailablePrices() []productDomain.PriceInfo
	Title() string
	Categories() ProductCategories
	Description() string
	ShortDescription() string
	Meta() ProductMeta
	Loyalty() ProductLoyalty
	Attributes() productDomain.Attributes
	Badges() ProductBadges
}

Product interface - needs to be implemented by SimpleProducts and ConfigurableProducts

func NewGraphqlProductDto

func NewGraphqlProductDto(product productDomain.BasicProduct, preSelectedVariantSku *string, bundleConfiguration productDomain.BundleConfiguration) Product

NewGraphqlProductDto returns a new Product dto

type ProductBadges

type ProductBadges struct {
	All []productDomain.Badge
}

ProductBadges wrapper for badges of the product

func (*ProductBadges) First

func (b *ProductBadges) First() *productDomain.Badge

First badge of all badges, returns nil if there is no first badge

type ProductCategories

type ProductCategories struct {
	Main productDomain.CategoryTeaser
	All  []productDomain.CategoryTeaser
}

ProductCategories wrapper for categories

type ProductLoyalty

type ProductLoyalty struct {
	Price           *productDomain.LoyaltyPriceInfo
	AvailablePrices []productDomain.LoyaltyPriceInfo
	Earning         *productDomain.LoyaltyEarningInfo
}

ProductLoyalty contains all loyalty related information

type ProductMedia

type ProductMedia struct {
	All []productDomain.Media
}

ProductMedia returns media for the product

func (ProductMedia) GetMedia

func (pm ProductMedia) GetMedia(usage string) *productDomain.Media

GetMedia returns the FIRST found Product media by usage

type ProductMeta

type ProductMeta struct {
	Keywords []string
}

ProductMeta contains meta information about the product

type SimpleProduct

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

SimpleProduct A simple Product without variants

func (SimpleProduct) Attributes

func (sp SimpleProduct) Attributes() productDomain.Attributes

Attributes of the product

func (SimpleProduct) AvailablePrices added in v3.5.0

func (sp SimpleProduct) AvailablePrices() []productDomain.PriceInfo

AvailablePrices of the product

func (SimpleProduct) Badges

func (sp SimpleProduct) Badges() ProductBadges

Badges of the product

func (SimpleProduct) Categories

func (sp SimpleProduct) Categories() ProductCategories

Categories of the product

func (SimpleProduct) Description

func (sp SimpleProduct) Description() string

Description of the product

func (SimpleProduct) Identifier

func (sp SimpleProduct) Identifier() string

Identifier of the product

func (SimpleProduct) Loyalty

func (sp SimpleProduct) Loyalty() ProductLoyalty

Loyalty of the product

func (SimpleProduct) MarketPlaceCode

func (sp SimpleProduct) MarketPlaceCode() string

MarketPlaceCode of the product

func (SimpleProduct) Media

func (sp SimpleProduct) Media() ProductMedia

Media of the product

func (SimpleProduct) Meta

func (sp SimpleProduct) Meta() ProductMeta

Meta of the product

func (SimpleProduct) Price

Price of the product

func (SimpleProduct) Product

Product the basic product information

func (SimpleProduct) ShortDescription

func (sp SimpleProduct) ShortDescription() string

ShortDescription of the product

func (SimpleProduct) Title

func (sp SimpleProduct) Title() string

Title of the product

func (SimpleProduct) Type

func (sp SimpleProduct) Type() string

Type the product type

type VariantSelection added in v3.6.0

type VariantSelection struct {
	Attributes []VariantSelectionAttribute
	Variants   []VariantSelectionMatch
}

VariantSelection contains information about all possible variant selections

func MapVariantSelections added in v3.6.0

func MapVariantSelections(configurable domain.ConfigurableProduct) VariantSelection

type VariantSelectionAttribute added in v3.6.0

type VariantSelectionAttribute struct {
	Label   string
	Code    string
	Options []VariantSelectionAttributeOption
}

Product contains normalized Product information regardless of being a variant or simple Product

type VariantSelectionAttributeOption added in v3.6.0

type VariantSelectionAttributeOption struct {
	Label                       string
	UnitCode                    string
	OtherAttributesRestrictions []OtherAttributesRestriction
}

Product contains normalized Product information regardless of being a variant or simple Product

type VariantSelectionMatch added in v3.6.0

type VariantSelectionMatch struct {
	Attributes []VariantSelectionMatchAttributes
	Variant    VariantSelectionMatchVariant
}

Product contains normalized Product information regardless of being a variant or simple Product

type VariantSelectionMatchAttributes added in v3.6.0

type VariantSelectionMatchAttributes struct {
	Key   string
	Value string
}

Product contains normalized Product information regardless of being a variant or simple Product

type VariantSelectionMatchVariant added in v3.6.0

type VariantSelectionMatchVariant struct {
	MarketplaceCode string
	VariantData     productDomain.Variant
}

Product contains normalized Product information regardless of being a variant or simple Product

type VariationSelection

type VariationSelection struct {
	Code    string
	Label   string
	Options []VariationSelectionOption
}

VariationSelection represents possible combinations for attached variants

func NewVariantsToVariationSelections

func NewVariantsToVariationSelections(p domain.BasicProduct) []VariationSelection

NewVariantsToVariationSelections Converts a product to variation selections

type VariationSelectionOption

type VariationSelectionOption struct {
	Label    string
	UnitCode string
	State    VariationSelectionOptionState
	Variant  VariationSelectionOptionVariant
}

VariationSelectionOption one possible variation option

type VariationSelectionOptionState

type VariationSelectionOptionState string

VariationSelectionOptionState state of the option

const (
	// VariationSelectionOptionStateActive signals, that option is currently active because the active product has this attribute
	VariationSelectionOptionStateActive VariationSelectionOptionState = "ACTIVE"
	// VariationSelectionOptionStateMatch signals, that product exists for this option but is not the active variant
	VariationSelectionOptionStateMatch VariationSelectionOptionState = "MATCH"
	// VariationSelectionOptionStateNoMatch signals, that product does not exists for this option, fallback is used
	VariationSelectionOptionStateNoMatch VariationSelectionOptionState = "NO_MATCH"
)

type VariationSelectionOptionVariant

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

VariationSelectionOptionVariant Information about the underlying variant

func NewVariationSelectionOptionVariant

func NewVariationSelectionOptionVariant(variant productDomain.Variant) VariationSelectionOptionVariant

NewVariationSelectionOptionVariant Creates a new option variant from the domain variant

func (*VariationSelectionOptionVariant) BaseData

BaseData of the variant

func (*VariationSelectionOptionVariant) MarketPlaceCode

func (v *VariationSelectionOptionVariant) MarketPlaceCode() string

MarketPlaceCode returns the marketPlaceCode of the variant

func (*VariationSelectionOptionVariant) Variant added in v3.6.0

Variant of the variant

Jump to

Keyboard shortcuts

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