Documentation
¶
Index ¶
- Constants
- Variables
- type ActiveChoice
- type Attribute
- func (at Attribute) GetUnit() Unit
- func (at Attribute) HasMultipleValues() bool
- func (at Attribute) HasUnitCode() bool
- func (at Attribute) IsDisabledValue() bool
- func (at Attribute) IsEnabledValue() bool
- func (at Attribute) Labels() []string
- func (at Attribute) Value() string
- func (at Attribute) Values() []string
- type Attributes
- type Badge
- type Badges
- type BasicProduct
- type BasicProductData
- func (bpd BasicProductData) Attribute(key string) Attribute
- func (bpd BasicProductData) GetListMedia() Media
- func (bpd BasicProductData) GetMedia(usage string) Media
- func (bpd BasicProductData) GetSpecifications() Specifications
- func (bpd BasicProductData) HasAllAttributes(keys []string) bool
- func (bpd BasicProductData) HasAttribute(key string) bool
- func (bpd BasicProductData) IsInStock() bool
- func (bpd BasicProductData) IsInStockForDeliveryCode(deliveryCode string) bool
- type BundleConfiguration
- type BundleProduct
- func (b BundleProduct) BaseData() BasicProductData
- func (b BundleProduct) GetBundleProductWithActiveChoices(bundleConfiguration BundleConfiguration) (BundleProductWithActiveChoices, error)
- func (b BundleProduct) GetIdentifier() string
- func (b BundleProduct) GetMedia(group string, usage string) Media
- func (b BundleProduct) HasMedia(group string, usage string) bool
- func (b BundleProduct) IsSaleable() bool
- func (b BundleProduct) SaleableData() Saleable
- func (b BundleProduct) TeaserData() TeaserData
- func (b BundleProduct) Type() string
- type BundleProductWithActiveChoices
- type CategoryTeaser
- type Choice
- type ChoiceConfiguration
- type Configurable
- type ConfigurableProduct
- func (p ConfigurableProduct) BaseData() BasicProductData
- func (p ConfigurableProduct) GetConfigurableWithActiveVariant(variantMarketplaceCode string) (ConfigurableProductWithActiveVariant, error)
- func (p ConfigurableProduct) GetDefaultVariant() (*Variant, error)
- func (p ConfigurableProduct) GetIdentifier() string
- func (p ConfigurableProduct) GetMedia(group string, usage string) Media
- func (p ConfigurableProduct) HasMedia(group string, usage string) bool
- func (p ConfigurableProduct) HasVariant(variantMarketplaceCode string) bool
- func (p ConfigurableProduct) IsSaleable() bool
- func (p ConfigurableProduct) SaleableData() Saleable
- func (p ConfigurableProduct) TeaserData() TeaserData
- func (p ConfigurableProduct) Type() string
- func (p ConfigurableProduct) Variant(variantMarketplaceCode string) (*Variant, error)
- type ConfigurableProductWithActiveVariant
- func (p ConfigurableProductWithActiveVariant) BaseData() BasicProductData
- func (p ConfigurableProductWithActiveVariant) ConfigurableBaseData() BasicProductData
- func (p ConfigurableProductWithActiveVariant) GetConfigurableWithActiveVariant(variantMarketplaceCode string) (ConfigurableProductWithActiveVariant, error)
- func (p ConfigurableProductWithActiveVariant) GetDefaultVariant() (*Variant, error)
- func (p ConfigurableProductWithActiveVariant) GetIdentifier() string
- func (p ConfigurableProductWithActiveVariant) GetMedia(group string, usage string) Media
- func (p ConfigurableProductWithActiveVariant) HasMedia(group string, usage string) bool
- func (p ConfigurableProductWithActiveVariant) HasVariant(variantMarketplaceCode string) bool
- func (p ConfigurableProductWithActiveVariant) IsSaleable() bool
- func (p ConfigurableProductWithActiveVariant) SaleableData() Saleable
- func (p ConfigurableProductWithActiveVariant) TeaserData() TeaserData
- func (p ConfigurableProductWithActiveVariant) Type() string
- func (p ConfigurableProductWithActiveVariant) Variant(variantMarketplaceCode string) (*Variant, error)
- type Identifier
- type LoyaltyEarningInfo
- type LoyaltyPriceInfo
- type Media
- type Option
- type PriceContext
- type PriceInfo
- type ProductNotFound
- type ProductService
- type Saleable
- func (p Saleable) GetLoyaltyChargeSplit(valuedPriceToPay *priceDomain.Price, loyaltyPointsWishedToPay *WishedToPay, ...) priceDomain.Charges
- func (p Saleable) GetLoyaltyChargeSplitIgnoreMin(valuedPriceToPay *priceDomain.Price, loyaltyPointsWishedToPay *WishedToPay, ...) priceDomain.Charges
- func (p Saleable) GetLoyaltyEarningByType(ltype string) (*LoyaltyEarningInfo, bool)
- func (p Saleable) GetLoyaltyPriceByType(ltype string) (*LoyaltyPriceInfo, bool)
- func (p Saleable) IsSaleableNow() bool
- type SearchResult
- type SearchService
- type SimpleProduct
- func (p SimpleProduct) BaseData() BasicProductData
- func (p SimpleProduct) GetIdentifier() string
- func (p SimpleProduct) GetMedia(group string, usage string) Media
- func (p SimpleProduct) HasMedia(group string, usage string) bool
- func (p SimpleProduct) IsSaleable() bool
- func (p SimpleProduct) SaleableData() Saleable
- func (p SimpleProduct) TeaserData() TeaserData
- func (p SimpleProduct) Type() string
- type SpecificationEntry
- type SpecificationGroup
- type Specifications
- type Stock
- type TeaserData
- type Unit
- type Variant
- type WishedToPay
Constants ¶
const ( MediaUsageList = "list" MediaUsageDetail = "detail" MediaUsageThumbnail = "thumbnail" )
Media usage constants
const ( StockLevelOutOfStock = "out" StockLevelInStock = "in" StockLevelLowStock = "low" )
Stock Level values
const ( // TypeBundle denotes bundle products TypeBundle = "bundle" TypeBundleWithActiveChoices = "bundle_with_active_choices" )
const ( // TypeConfigurable denotes configurable products TypeConfigurable = "configurable" // TypeConfigurableWithActiveVariant denotes configurable products that has a variant selected TypeConfigurableWithActiveVariant = "configurable_with_activevariant" )
const ( // Area Units SQUARE_MILLIMETER = "SQUARE_MILLIMETER" SQUARE_CENTIMETER = "SQUARE_CENTIMETER" SQUARE_DECIMETER = "SQUARE_DECIMETER" SQUARE_METER = "SQUARE_METER" CENTIARE = "CENTIARE" SQUARE_DEKAMETER = "SQUARE_DEKAMETER" ARE = "ARE" SQUARE_HECTOMETER = "SQUARE_HECTOMETER" HECTARE = "HECTARE" SQUARE_KILOMETER = "SQUARE_KILOMETER" SQUARE_MIL = "SQUARE_MIL" SQUARE_INCH = "SQUARE_INCH" SQUARE_FOOT = "SQUARE_FOOT" SQUARE_YARD = "SQUARE_YARD" ARPENT = "ARPENT" ACRE = "ACRE" SQUARE_FURLONG = "SQUARE_FURLONG" SQUARE_MILE = "SQUARE_MILE" // Binary Units BIT = "BIT" BYTE = "BYTE" KILOBYTE = "KILOBYTE" MEGABYTE = "MEGABYTE" GIGABYTE = "GIGABYTE" TERABYTE = "TERABYTE" // Loudness Units DECIBEL = "DECIBEL" // Frequency Units HERTZ = "HERTZ" KILOHERTZ = "KILOHERTZ" MEGAHERTZ = "MEGAHERTZ" GIGAHERTZ = "GIGAHERTZ" TERAHERTZ = "TERAHERTZ" // Length Unit MILLIMETER = "MILLIMETER" CENTIMETER = "CENTIMETER" DECIMETER = "DECIMETER" METER = "METER" DEKAMETER = "DEKAMETER" HECTOMETER = "HECTOMETER" KILOMETER = "KILOMETER" MIL = "MIL" INCH = "INCH" FEET = "FEET" YARD = "YARD" CHAIN = "CHAIN" FURLONG = "FURLONG" MILE = "MILE" // Power Units WATT = "WATT" KILOWATT = "KILOWATT" MEGAWATT = "MEGAWATT" GIGAWATT = "GIGAWATT" TERAWATT = "TERAWATT" // Voltage Units MILLIVOLT = "MILLIVOLT" CENTIVOLT = "CENTIVOLT" DECIVOLT = "DECIVOLT" VOLT = "VOLT" DEKAVOLT = "DEKAVOLT" HECTOVOLT = "HECTOVOLT" KILOVOLT = "KILOVOLT" // Intensity MILLIAMPERE = "MILLIAMPERE" CENTIAMPERE = "CENTIAMPERE" DECIAMPERE = "DECIAMPERE" AMPERE = "AMPERE" DEKAMPERE = "DEKAMPERE" HECTOAMPERE = "HECTOAMPERE" KILOAMPERE = "KILOAMPERE" // Resistance MILLIOHM = "MILLIOHM" CENTIOHM = "CENTIOHM" DECIOHM = "DECIOHM" OHM = "OHM" DEKAOHM = "DEKAOHM" HECTOHM = "HECTOHM" KILOHM = "KILOHM" MEGOHM = "MEGOHM" // Speed METER_PER_SECOND = "METER_PER_SECOND" METER_PER_MINUTE = "METER_PER_MINUTE" METER_PER_HOUR = "METER_PER_HOUR" KILOMETER_PER_HOUR = "KILOMETER_PER_HOUR" FOOT_PER_SECOND = "FOOT_PER_SECOND" FOOT_PER_HOUR = "FOOT_PER_HOUR" YARD_PER_HOUR = "YARD_PER_HOUR" MILE_PER_HOUR = "MILE_PER_HOUR" // Electric Charge MILLIAMPEREHOUR = "MILLIAMPEREHOUR" AMPEREHOUR = "AMPEREHOUR" MILLICOULOMB = "MILLICOULOMB" CENTICOULOMB = "CENTICOULOMB" DECICOULOMB = "DECICOULOMB" COULOMB = "COULOMB" DEKACOULOMB = "DEKACOULOMB" HECTOCOULOMB = "HECTOCOULOMB" KILOCOULOMB = "KILOCOULOMB" // Duration MILLISECOND = "MILLISECOND" SECOND = "SECOND" MINUTE = "MINUTE" HOUR = "HOUR" DAY = "DAY" WEEK = "WEEK" MONTH = "MONTH" YEAR = "YEAR" // Temperature CELSIUS = "CELSIUS" FAHRENHEIT = "FAHRENHEIT" KELVIN = "KELVIN" RANKINE = "RANKINE" REAUMUR = "REAUMUR" // Volume Units CUBIC_MILLIMETER = "CUBIC_MILLIMETER" CUBIC_CENTIMETER = "CUBIC_CENTIMETER" MILLILITER = "MILLILITER" CENTILITER = "CENTILITER" DECILITER = "DECILITER" CUBIC_DECIMETER = "CUBIC_DECIMETER" LITER = "LITER" CUBIC_METER = "CUBIC_METER" OUNCE = "OUNCE" PINT = "PINT" BARREL = "BARREL" GALLON = "GALLON" CUBIC_FOOT = "CUBIC_FOOT" CUBIC_INCH = "CUBIC_INCH" CUBIC_YARD = "CUBIC_YARD" // Weigt Units MILLIGRAM = "MILLIGRAM" GRAM = "GRAM" KILOGRAM = "KILOGRAM" TON = "TON" GRAIN = "GRAIN" DENIER = "DENIER" POUND = "POUND" MARC = "MARC" LIVRE = "LIVRE" // Pressure BAR = "BAR" PASCAL = "PASCAL" HECTOPASCAL = "HECTOPASCAL" MILLIBAR = "MILLIBAR" ATM = "ATM" PSI = "PSI" TORR = "TORR" MMHG = "MMHG" // Energy JOULE = "JOULE" CALORIE = "CALORIE" KILOCALORIE = "KILOCALORIE" KILOJOULE = "KILOJOULE" // Piece / CaseBox Units PCS = "PCS" PIECE = "PIECE" DOZEN = "DOZEN" )
Constants of the unit codes See also the PIM unit codes on which these are based (and no other will get into this system)
const (
// TypeSimple denotes simple products
TypeSimple = "simple"
)
Variables ¶
var ( ErrRequiredChoicesAreNotSelected = errors.New("required choices are not selected") ErrSelectedQuantityOutOfRange = errors.New("selected quantity is out of range") ErrMarketplaceCodeDoNotExists = errors.New("selected marketplace code does not exist") )
var (
ErrProductNotFound = fmt.Errorf("product not found")
)
var Units = map[string]Unit{}/* 140 elements not displayed */
Units provides the unit map
Functions ¶
This section is empty.
Types ¶
type ActiveChoice ¶ added in v3.6.0
type ActiveChoice struct {
Identifier string
Required bool
Label string
Product BasicProduct
Qty int
}
type Attribute ¶
type Attribute struct {
// Code is the internal attribute identifier
Code string
// CodeLabel is the human-readable (perhaps localized) attribute name
CodeLabel string
// Label is the human-readable (perhaps localized) attribute value
Label string
// RawValue is the untouched original value of the attribute
RawValue interface{}
// UnitCode is the internal code of the attribute values measuring unit
UnitCode string
} // @name ProductAttribute
Attribute for product attributes Example:
Attribute{
Code: "my-attribute",
CodeLabel: "My Attribute",
Label: "My attribute value",
RawValue: 2,
UnitCode: "PCS",
}
func (Attribute) HasMultipleValues ¶
HasMultipleValues checks for multiple raw values
func (Attribute) HasUnitCode ¶
HasUnitCode checks if a unit code is set on the attribute
func (Attribute) IsDisabledValue ¶
IsDisabledValue returns true if the value can be seen as a disable toggle/switch value
func (Attribute) IsEnabledValue ¶
IsEnabledValue returns true if the value can be seen as a toggle and is enabled
type Attributes ¶
Attributes describe a product attributes map
func (Attributes) Attribute ¶
func (a Attributes) Attribute(key string) Attribute
Attribute returns a specified attribute
func (Attributes) AttributeKeys ¶
func (a Attributes) AttributeKeys() []string
AttributeKeys lists all available keys
func (Attributes) Attributes ¶
func (a Attributes) Attributes() []Attribute
Attributes lists all attributes
func (Attributes) AttributesByKey ¶ added in v3.2.0
func (a Attributes) AttributesByKey(keys []string) []Attribute
AttributesByKey returns slice of attributes by given attribute keys
func (Attributes) HasAttribute ¶
func (a Attributes) HasAttribute(key string) bool
HasAttribute checks if an attribute is available
type Badge ¶ added in v3.4.0
Badge for a product Example:
Badge {
Code: "new",
Label: "New Product",
}
type BasicProduct ¶
type BasicProduct interface {
// BaseData gives you basic product information
// like attributes, title, media, marketplacecode etc
BaseData() BasicProductData
TeaserData() TeaserData
// GetSpecifications return grouped specifications - typically used for comparisons
GetSpecifications() Specifications
// IsSaleable indicates if that product type can be purchased in general
IsSaleable() bool
// SaleableData returns information required to purchase - like the definite price information
// makes only sense to call if IsSaleable() returns true
SaleableData() Saleable
// Type returns product type
Type() string
// GetIdentifier returns an identifier for the product instance
GetIdentifier() string
HasMedia(group string, usage string) bool
GetMedia(group string, usage string) Media
}
BasicProduct interface need to be implemented by all Product Types!
type BasicProductData ¶
type BasicProductData struct {
Title string
Attributes Attributes
ShortDescription string
Description string
Media []Media
Badges Badges
MarketPlaceCode string
RetailerCode string
RetailerSku string
RetailerName string
CreatedAt time.Time
UpdatedAt time.Time
VisibleFrom time.Time
VisibleTo time.Time
Categories []CategoryTeaser
MainCategory CategoryTeaser
CategoryToCodeMapping []string
// Deprecated: use Stock[x].Level instead
StockLevel string
Stock []Stock
Keywords []string
IsNew bool
}
BasicProductData is the basic product model
func (BasicProductData) Attribute ¶
func (bpd BasicProductData) Attribute(key string) Attribute
Attribute get Attribute by key
func (BasicProductData) GetListMedia ¶
func (bpd BasicProductData) GetListMedia() Media
GetListMedia returns the product media for listing
func (BasicProductData) GetMedia ¶
func (bpd BasicProductData) GetMedia(usage string) Media
GetMedia returns the FIRST found product media by usage
func (BasicProductData) GetSpecifications ¶
func (bpd BasicProductData) GetSpecifications() Specifications
GetSpecifications getter
func (BasicProductData) HasAllAttributes ¶ added in v3.4.0
func (bpd BasicProductData) HasAllAttributes(keys []string) bool
HasAllAttributes returns true, if all attributes are set
func (BasicProductData) HasAttribute ¶
func (bpd BasicProductData) HasAttribute(key string) bool
HasAttribute check
func (BasicProductData) IsInStock ¶
func (bpd BasicProductData) IsInStock() bool
IsInStock returns information if current product whether in stock or not
func (BasicProductData) IsInStockForDeliveryCode ¶ added in v3.6.0
func (bpd BasicProductData) IsInStockForDeliveryCode(deliveryCode string) bool
IsInStockForDeliveryCode returns information if current product whether in stock or not for provided delivery code
type BundleConfiguration ¶ added in v3.6.0
type BundleConfiguration map[Identifier]ChoiceConfiguration
func (BundleConfiguration) Equals ¶ added in v3.7.0
func (bc BundleConfiguration) Equals(other BundleConfiguration) bool
Equals compares the marketplace codes of all choices
type BundleProduct ¶ added in v3.6.0
type BundleProduct struct {
Identifier string
Choices []Choice
BasicProductData
Saleable
}
func (BundleProduct) BaseData ¶ added in v3.6.0
func (b BundleProduct) BaseData() BasicProductData
func (BundleProduct) GetBundleProductWithActiveChoices ¶ added in v3.6.0
func (b BundleProduct) GetBundleProductWithActiveChoices(bundleConfiguration BundleConfiguration) (BundleProductWithActiveChoices, error)
func (BundleProduct) GetIdentifier ¶ added in v3.6.0
func (b BundleProduct) GetIdentifier() string
func (BundleProduct) GetMedia ¶ added in v3.6.0
func (b BundleProduct) GetMedia(group string, usage string) Media
func (BundleProduct) HasMedia ¶ added in v3.6.0
func (b BundleProduct) HasMedia(group string, usage string) bool
func (BundleProduct) IsSaleable ¶ added in v3.6.0
func (b BundleProduct) IsSaleable() bool
func (BundleProduct) SaleableData ¶ added in v3.6.0
func (b BundleProduct) SaleableData() Saleable
func (BundleProduct) TeaserData ¶ added in v3.6.0
func (b BundleProduct) TeaserData() TeaserData
func (BundleProduct) Type ¶ added in v3.6.0
func (b BundleProduct) Type() string
type BundleProductWithActiveChoices ¶ added in v3.6.0
type BundleProductWithActiveChoices struct {
BundleProduct
ActiveChoices map[Identifier]ActiveChoice
}
BundleProductWithActiveChoices - A product with preselected choices
func (BundleProductWithActiveChoices) ExtractBundleConfig ¶ added in v3.6.0
func (b BundleProductWithActiveChoices) ExtractBundleConfig() BundleConfiguration
func (BundleProductWithActiveChoices) Type ¶ added in v3.6.0
func (b BundleProductWithActiveChoices) Type() string
type CategoryTeaser ¶
type CategoryTeaser struct {
Code string
Path string
Name string
Parent *CategoryTeaser `swaggerignore:"true"`
}
CategoryTeaser represents some Teaser infos for Category
func (*CategoryTeaser) CPath ¶ added in v3.4.0
func (c *CategoryTeaser) CPath() string
CPath returns the constructed Path from this category to the root - splitted by /
type ChoiceConfiguration ¶ added in v3.6.0
type Configurable ¶
type Configurable interface {
GetConfigurableWithActiveVariant(variantMarketplaceCode string) (ConfigurableProductWithActiveVariant, error)
Variant(variantMarketplaceCode string) (*Variant, error)
GetDefaultVariant() (*Variant, error)
HasVariant(variantMarketplaceCode string) bool
}
Configurable - interface that is implemented by ConfigurableProduct and ConfigurableProductWithActiveVariant
type ConfigurableProduct ¶
type ConfigurableProduct struct {
Identifier string
BasicProductData
VariantVariationAttributes []string
Variants []Variant
VariantVariationAttributesSorting map[string][]string
}
ConfigurableProduct - A product that can be teasered and that has Sellable Variants Aggregated
func (ConfigurableProduct) BaseData ¶
func (p ConfigurableProduct) BaseData() BasicProductData
BaseData interface implementation for ConfigurableProduct
func (ConfigurableProduct) GetConfigurableWithActiveVariant ¶
func (p ConfigurableProduct) GetConfigurableWithActiveVariant(variantMarketplaceCode string) (ConfigurableProductWithActiveVariant, error)
GetConfigurableWithActiveVariant getter
func (ConfigurableProduct) GetDefaultVariant ¶
func (p ConfigurableProduct) GetDefaultVariant() (*Variant, error)
GetDefaultVariant getter
func (ConfigurableProduct) GetIdentifier ¶
func (p ConfigurableProduct) GetIdentifier() string
GetIdentifier interface implementation for SimpleProduct
func (ConfigurableProduct) GetMedia ¶
func (p ConfigurableProduct) GetMedia(group string, usage string) Media
GetMedia for ConfigurableProduct
func (ConfigurableProduct) HasMedia ¶
func (p ConfigurableProduct) HasMedia(group string, usage string) bool
HasMedia for ConfigurableProduct
func (ConfigurableProduct) HasVariant ¶
func (p ConfigurableProduct) HasVariant(variantMarketplaceCode string) bool
HasVariant for ConfigurableProduct
func (ConfigurableProduct) IsSaleable ¶
func (p ConfigurableProduct) IsSaleable() bool
IsSaleable defaults to false
func (ConfigurableProduct) SaleableData ¶
func (p ConfigurableProduct) SaleableData() Saleable
SaleableData getter for ConfigurableProduct - Configurable is NOT Salable
func (ConfigurableProduct) TeaserData ¶
func (p ConfigurableProduct) TeaserData() TeaserData
TeaserData interface implementation for SimpleProduct
func (ConfigurableProduct) Type ¶
func (p ConfigurableProduct) Type() string
Type interface implementation for SimpleProduct
type ConfigurableProductWithActiveVariant ¶
type ConfigurableProductWithActiveVariant struct {
Identifier string
BasicProductData
VariantVariationAttributes []string
Variants []Variant
VariantVariationAttributesSorting map[string][]string
ActiveVariant Variant
}
ConfigurableProductWithActiveVariant - A product that can be teasered and that has Sellable Variants Aggregated, One Variant is Active
func (ConfigurableProductWithActiveVariant) BaseData ¶
func (p ConfigurableProductWithActiveVariant) BaseData() BasicProductData
BaseData returns only BaseData for Active Variant. If you need the BaseData of the Configurable - use ConfigurableBaseData()
func (ConfigurableProductWithActiveVariant) ConfigurableBaseData ¶
func (p ConfigurableProductWithActiveVariant) ConfigurableBaseData() BasicProductData
ConfigurableBaseData getter
func (ConfigurableProductWithActiveVariant) GetConfigurableWithActiveVariant ¶
func (p ConfigurableProductWithActiveVariant) GetConfigurableWithActiveVariant(variantMarketplaceCode string) (ConfigurableProductWithActiveVariant, error)
GetConfigurableWithActiveVariant getter
func (ConfigurableProductWithActiveVariant) GetDefaultVariant ¶
func (p ConfigurableProductWithActiveVariant) GetDefaultVariant() (*Variant, error)
GetDefaultVariant getter
func (ConfigurableProductWithActiveVariant) GetIdentifier ¶
func (p ConfigurableProductWithActiveVariant) GetIdentifier() string
GetIdentifier getter
func (ConfigurableProductWithActiveVariant) GetMedia ¶
func (p ConfigurableProductWithActiveVariant) GetMedia(group string, usage string) Media
GetMedia for ConfigurableProduct
func (ConfigurableProductWithActiveVariant) HasMedia ¶
func (p ConfigurableProductWithActiveVariant) HasMedia(group string, usage string) bool
HasMedia for ConfigurableProduct
func (ConfigurableProductWithActiveVariant) HasVariant ¶
func (p ConfigurableProductWithActiveVariant) HasVariant(variantMarketplaceCode string) bool
HasVariant for ConfigurableProduct
func (ConfigurableProductWithActiveVariant) IsSaleable ¶
func (p ConfigurableProductWithActiveVariant) IsSaleable() bool
IsSaleable is true
func (ConfigurableProductWithActiveVariant) SaleableData ¶
func (p ConfigurableProductWithActiveVariant) SaleableData() Saleable
SaleableData getter for ConfigurableProduct Gets either the first or the active variants saleableData
func (ConfigurableProductWithActiveVariant) TeaserData ¶
func (p ConfigurableProductWithActiveVariant) TeaserData() TeaserData
TeaserData interface implementation for SimpleProduct
func (ConfigurableProductWithActiveVariant) Type ¶
func (p ConfigurableProductWithActiveVariant) Type() string
Type getter
type Identifier ¶ added in v3.6.0
type Identifier string
type LoyaltyEarningInfo ¶ added in v3.3.0
type LoyaltyEarningInfo struct {
Type string
Default priceDomain.Price
}
LoyaltyEarningInfo contains earning infos
type LoyaltyPriceInfo ¶
type LoyaltyPriceInfo struct {
// Type or Name of the Loyalty program
Type string
Default priceDomain.Price
IsDiscounted bool
Discounted priceDomain.Price
DiscountText string
MinPointsToSpent big.Float `swaggertype:"string"`
MaxPointsToSpent *big.Float `swaggertype:"string"`
Context PriceContext
}
LoyaltyPriceInfo contains info used for product with
func (LoyaltyPriceInfo) GetFinalPrice ¶
func (l LoyaltyPriceInfo) GetFinalPrice() priceDomain.Price
GetFinalPrice gets either the Default or the Discounted Loyaltyprice
func (LoyaltyPriceInfo) GetRate ¶
func (l LoyaltyPriceInfo) GetRate(valuedPrice priceDomain.Price) big.Float
GetRate returns the currency conversion rate of the current loyaltyprice final price in relation to the passed value
func (LoyaltyPriceInfo) HasMax ¶
func (l LoyaltyPriceInfo) HasMax() bool
HasMax checks if product has a maximum (points to spend) restriction
type Media ¶
type Media struct {
Type string
MimeType string
Usage string
Title string
Reference string
} // @name ProductMedia
Media holds product media information
type Option ¶ added in v3.6.0
type Option struct {
Product BasicProduct
MinQty int
MaxQty int
}
func (*Option) UnmarshalJSON ¶ added in v3.6.0
type PriceContext ¶
type PriceContext struct {
DeliveryCode string
CustomerGroup string
ChannelCode string
Locale string
}
PriceContext defines the scope in which the price was calculated
type PriceInfo ¶
type PriceInfo struct {
Default priceDomain.Price
Discounted priceDomain.Price
DiscountText string
ActiveBase big.Float `swaggertype:"string"`
ActiveBaseAmount big.Float `swaggertype:"string"`
ActiveBaseUnit string
IsDiscounted bool
CampaignRules []string
DenyMoreDiscounts bool
Context PriceContext
TaxClass string
}
PriceInfo holds product price information
func (PriceInfo) GetFinalPrice ¶
func (p PriceInfo) GetFinalPrice() priceDomain.Price
GetFinalPrice getter for price that should be used in calculations (either discounted or default)
type ProductNotFound ¶
type ProductNotFound struct {
MarketplaceCode string
}
ProductNotFound is an error Deprecated: please use var ErrProductNotFound
func (ProductNotFound) Error ¶
func (err ProductNotFound) Error() string
Error implements the error interface
type ProductService ¶
type ProductService interface {
// Get a product
Get(ctx context.Context, marketplaceCode string) (BasicProduct, error)
}
ProductService interface
type Saleable ¶
type Saleable struct {
IsSaleable bool
SaleableFrom time.Time
SaleableTo time.Time
ActivePrice PriceInfo
AvailablePrices []PriceInfo
ActiveLoyaltyPrice *LoyaltyPriceInfo
// LoyaltyPrices holds optional infos for products that can be paid in a loyalty program
LoyaltyPrices []LoyaltyPriceInfo
// LoyaltyEarnings holds optional infos about potential loyalty earnings
LoyaltyEarnings []LoyaltyEarningInfo
}
Saleable are properties required for being selled
func (Saleable) GetLoyaltyChargeSplit ¶
func (p Saleable) GetLoyaltyChargeSplit(valuedPriceToPay *priceDomain.Price, loyaltyPointsWishedToPay *WishedToPay, qty int) priceDomain.Charges
GetLoyaltyChargeSplit gets the Charges that need to be paid by type: Type "main" is the remaining charge in the main currency and the other charges returned are the loyalty price charges that need to be paid. The method takes the min, max and the calculated loyalty conversion rate into account
* valuedPriceToPay Optional the price that need to be paid - if not given the products final price will be used * loyaltyPointsWishedToPay Optional a list of loyaltyPrices that the (customer) wants to spend. Its used as a wish and may not be fulfilled because of min, max properties on the products loyaltyPrices * qty the quantity of the current item affects min max loyalty charge
func (Saleable) GetLoyaltyChargeSplitIgnoreMin ¶
func (p Saleable) GetLoyaltyChargeSplitIgnoreMin(valuedPriceToPay *priceDomain.Price, loyaltyPointsWishedToPay *WishedToPay, qty int) priceDomain.Charges
GetLoyaltyChargeSplitIgnoreMin same as GetLoyaltyChargeSplit but ignoring the min points to spend
func (Saleable) GetLoyaltyEarningByType ¶ added in v3.3.0
func (p Saleable) GetLoyaltyEarningByType(ltype string) (*LoyaltyEarningInfo, bool)
GetLoyaltyEarningByType returns the loyalty earning infos for a specific loyalty type
func (Saleable) GetLoyaltyPriceByType ¶
func (p Saleable) GetLoyaltyPriceByType(ltype string) (*LoyaltyPriceInfo, bool)
GetLoyaltyPriceByType returns first encountered loyalty price with this type
func (Saleable) IsSaleableNow ¶
IsSaleableNow checks flag and time
type SearchResult ¶
type SearchResult struct {
searchDomain.Result
Hits []BasicProduct
}
SearchResult returns product hits
type SearchService ¶
type SearchService interface {
// Search returns Products based on given Filters
Search(ctx context.Context, filter ...searchDomain.Filter) (*SearchResult, error)
// SearchBy returns Products prefiltered by the given attribute (also based on additional given Filters)
// e.g. SearchBy(ctx,"brandCode","apple")
SearchBy(ctx context.Context, attribute string, values []string, filter ...searchDomain.Filter) (*SearchResult, error)
}
SearchService is a typed search for products when search operation does not found anything preferably return empty result over an error
type SimpleProduct ¶
type SimpleProduct struct {
Identifier string
BasicProductData
Saleable
}
SimpleProduct - A product without Variants that can be teasered and being sold
func (SimpleProduct) BaseData ¶
func (p SimpleProduct) BaseData() BasicProductData
BaseData interface implementation for SimpleProduct
func (SimpleProduct) GetIdentifier ¶
func (p SimpleProduct) GetIdentifier() string
GetIdentifier interface implementation for SimpleProduct
func (SimpleProduct) GetMedia ¶
func (p SimpleProduct) GetMedia(group string, usage string) Media
GetMedia for SimpleProduct
func (SimpleProduct) HasMedia ¶
func (p SimpleProduct) HasMedia(group string, usage string) bool
HasMedia for SimpleProduct
func (SimpleProduct) SaleableData ¶
func (p SimpleProduct) SaleableData() Saleable
SaleableData getter for SimpleProduct
func (SimpleProduct) TeaserData ¶
func (p SimpleProduct) TeaserData() TeaserData
TeaserData interface implementation for SimpleProduct
func (SimpleProduct) Type ¶
func (p SimpleProduct) Type() string
Type interface implementation for SimpleProduct
type SpecificationEntry ¶
SpecificationEntry data
type SpecificationGroup ¶
type SpecificationGroup struct {
Title string
Entries []SpecificationEntry
}
SpecificationGroup groups specifications
type Specifications ¶
type Specifications struct {
Groups []SpecificationGroup
}
Specifications of a product
type TeaserData ¶
type TeaserData struct {
TeaserPrice PriceInfo
TeaserPriceIsFromPrice bool
PreSelectedVariantSku string
Media []Media
// The sku that should be used to link from Teasers
TeaserLoyaltyPriceInfo *LoyaltyPriceInfo
TeaserLoyaltyEarningInfo *LoyaltyEarningInfo
Badges Badges
}
TeaserData is the teaser-information for product previews
type Variant ¶
type Variant struct {
BasicProductData
Saleable
}
Variant is a concrete kind of a product
func (Variant) BaseData ¶
func (v Variant) BaseData() BasicProductData
BaseData getter for BasicProductData
func (Variant) SaleableData ¶
SaleableData getter for Saleable
type WishedToPay ¶
type WishedToPay struct {
// contains filtered or unexported fields
}
WishedToPay is the list of prices by type
func NewWishedToPay ¶
func NewWishedToPay() WishedToPay
NewWishedToPay returns a new WishedToPay struct
func (WishedToPay) Add ¶
func (w WishedToPay) Add(ctype string, price priceDomain.Price) WishedToPay
Add returns new WishedToPay instance with the given wish added
func (WishedToPay) GetByType ¶
func (w WishedToPay) GetByType(ctype string) *priceDomain.Price
GetByType returns the wished price for the given type or nil
func (WishedToPay) Split ¶
func (w WishedToPay) Split(count int) []WishedToPay
Split splits the given WishedToPay in payable childs