projects/congarevenuecloud/ecommerce/src/lib/modules/constraint-rules/services/constraint-rule.service.ts
This service is work in progress Constraint rules are a powerful feature when configuring products. They allow you to include, excludes, recommend, validate and replace products based on business logic.
AObjectService
Properties |
|
Methods |
getConstraintRuleByIds | |||||||||||||||
getConstraintRuleByIds(ruleIds: Array
|
|||||||||||||||
Decorators :
@MemoizeWithHash()
|
|||||||||||||||
The method fetches all the constraint rules based on the constraint rule Id's passed.
Parameters :
Returns :
Observable<Array<ConstraintRule>>
an Observable of list of constraint rules. |
getConstraintRulesForProducts | ||||||||||||||||||||
getConstraintRulesForProducts(productList: Array<string> | Array<Product>, matchInPrimaryLines: boolean, matchInOptions: boolean)
|
||||||||||||||||||||
Decorators :
@MemoizeAll()
|
||||||||||||||||||||
This method can be used to fetch the list of constraint rules for the given list of productIds. It will return all the configurations of a constraint rules with constraint rule conditon and constraint rule action. Example:Example :
This method is a work in progress.
Parameters :
Returns :
Observable<Array<ConstraintRule>>
Observable<Array |
getProductsWithAssetLineItems | ||||||||
getProductsWithAssetLineItems(productIds: Array
|
||||||||
This method retrieves products along with their associated asset line items.
Parameters :
Returns :
Observable<Array<ItemRequest>>
observable list of products with assetlineitems. |
getRecommendationsForCart |
getRecommendationsForCart()
|
This method can be used to fetch the list of product for the given cart which has recommended rules set. Example:Example :
Returns :
Observable<Array<ItemRequest>>
observable list of products matching the recommended rule sets. |
getRecommendationsForProduct | ||||||||
getRecommendationsForProduct(productId: string)
|
||||||||
This method can be used to fetch the list of product which has recommended rules set for the list of product passed as argument. Example:Example :
Parameters :
Returns :
Observable<Array<ItemRequest>>
observable list of products matching the recommended rule sets. |
getRuleByProductId | ||||||||
getRuleByProductId(productId: string)
|
||||||||
This method can be used to fetch the list of ConstraintRule records for given product identifier. It do not fetch the constraint rule record if SkipRule flag is true. Example:Example :
This method is a work in progress.
Parameters :
Returns :
Observable<Array<ConstraintRule>>
Observable<Array |
hasPendingErrors | ||||||||
hasPendingErrors(cart?: Cart)
|
||||||||
This method returns boolean value for active cart's applied rule action record based on pending flag. Example:Example :
Parameters :
Returns :
Observable<boolean>
Observable |
Protected araiService |
Type : AppliedRuleActionInfoService
|
Default value : this.injector.get(AppliedRuleActionInfoService)
|
Protected assetService |
Default value : this.injector.get(AssetService)
|
Protected cartService |
Type : CartService
|
Default value : this.injector.get(CartService)
|
Protected configService |
Default value : this.injector.get(ConfigurationService)
|
Protected constraintRuleActionService |
Default value : this.injector.get(ConstraintRuleActionService)
|
onConstraintRuleError |
Type : EventEmitter<string>
|
Default value : new EventEmitter<string>()
|
Protected pliService |
Type : PriceListItemService
|
Default value : this.injector.get(PriceListItemService)
|
Protected productOptionService |
Type : ProductOptionService
|
Default value : this.injector.get(ProductOptionService)
|
Protected productService |
Type : ProductService
|
Default value : this.injector.get(ProductService)
|
Protected secondaryCartService |
Type : SecondaryCartService
|
Default value : this.injector.get(SecondaryCartService)
|
Protected storefrontService |
Default value : this.injector.get(StorefrontService)
|
type |
Default value : ConstraintRule
|
Protected userService |
Type : UserService
|
Default value : this.injector.get(UserService)
|