import { DaffCompositeProductFacadeInterface } from '@daffodil/product-composite/state'
A facade for interacting with the composite product state. Exposes many parts of the state for easy access and allows dispatching of actions.
interface DaffCompositeProductFacadeInterface {
getRequiredItemPricesForConfiguration(
id: string
configuration?: Dictionary<DaffCompositeConfigurationItem>
): any
getOptionalItemPricesForConfiguration(
id: string
configuration?: Dictionary<DaffCompositeConfigurationItem>
): any
getPricesAsCurrentlyConfigured(id: string): any
getAppliedOptions(id: string): any
isItemRequired(
id: string
item_id: string
): any
hasDiscount(priceRange: DaffPriceRange): boolean
getDiscountAmount(id: string): any
getDiscountPercent(id: string): any
hasPriceRange(priceRange: DaffPriceRange): boolean
}
anyGet a DaffPriceRange for a composite product based on the configuration provided excluding unselected, optional item prices.
| Parameter | id: string |
|---|---|
| Description | an id for a composite product |
| Parameter | configuration: Dictionary<DaffCompositeConfigurationItem> |
|---|---|
| Description | a Dictionary of DaffCompositeConfigurationItems |
anyGet the broadest possible DaffPriceRange for a composite product based on the configuration provided including optional item prices.
| Parameter | id: string |
|---|---|
| Description | the id of the composite product. |
| Parameter | configuration: Dictionary<DaffCompositeConfigurationItem> |
|---|---|
| Description | a Dictionary of DaffCompositeConfigurationItems |
anyGet the DaffPriceRange for a composite product based on the current configuration of selected item options in redux state and excluding unselected, optional item prices.
| Parameter | id: string |
|---|---|
| Description | the id of the composite product. |
anyReturns the applied options for a composite product.
| Parameter | id: string |
|---|---|
| Description | the id of the composite product. |
anyReturns whether the item of a composite product is required.
| Parameter | id: string |
|---|---|
| Description | the id of the composite product. |
| Parameter | item_id: string |
|---|---|
| Description | the id of the item_id. |
booleanReturns whether a DaffPriceRange has a discount.
| Parameter | priceRange: DaffPriceRange |
|---|---|
| Description | a DaffPriceRange |
anyReturns the discount amount of a composite product based on the current configuration of the selected item options in redux state and excluding unselected, optional item prices. Will return undefined if all required options are not chosen.
| Parameter | id: string |
|---|---|
| Description | the id of the composite product. |
anyReturns the discount percent of a composite product based on the current configuration of the selected item options in redux state and excluding unselected, optional item prices. Will return undefined if all required options are not chosen. Note: This percent is computed client-side and should be treated as an estimate rather than an exact value.
| Parameter | id: string |
|---|---|
| Description | the id of the composite product. |
booleanReturns whether the min and max prices of a DaffPriceRange are different.
| Parameter | priceRange: DaffPriceRange |
|---|---|
| Description | a DaffPriceRange |