Interface TmaPoService
- All Known Implementing Classes:
DefaultTmaPoService
public interface TmaPoService
Service handling business logic around
TmaProductOfferingModel.- Since:
- 6.7
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a newTmaProductOfferingModelchild to aTmaBundledProductOfferingModelparent.getAllParents(TmaProductOfferingModel poModel) Returns all parents for the given product offering.getBpoForCode(String code) Returns aTmaBundledProductOfferingModelfor the given code.getBundledProdOfferOptionFor(TmaBundledProductOfferingModel bundledProductOffering, TmaProductOfferingModel productOffering) Returns the bundled product offering option part of the provided bpo which is referred to the provided product offering.getConfigurableProductSpecCharacteristics(TmaProductOfferingModel productOffering) Computes and returns the configurableTmaProductSpecCharacteristicModelof a given product.getConfigurableProductSpecCharValueUses(TmaProductOfferingModel productOffering) Gets the configurable product spec characteristics value uses.Searches for the the group next to the group which contains the PO given as parameter; It returns: the group with index 0, if PO given as parameter is in a group with index higher than 0 or, the group with index 1, if PO given as parameter is in a group with index 0 or, emptyOptionalif no group is found.getIntermediateBpos(TmaProductOfferingModel currentPo, TmaBundledProductOfferingModel targetBpo) Returns the list of BPOs between the provided PO and the target BPO.getOfferingGroupForPoAndBpo(TmaProductOfferingModel productOffering, TmaBundledProductOfferingModel parent) Retrieves theTmaProductOfferingGroupModelfor a given product inside the givenTmaBundledProductOfferingModelparent.Returns the operational product corresponding to the specified action.getParentIdsFrom(TmaProductOfferingModel productOffering) Returns the set of all parents product offering ids for a given product offering.getPoForCode(String code) Returns aTmaProductOfferingModelfor the given code.getPoForCodeAndPriceContext(String code, TmaPriceContext priceContext) Returns aTmaProductOfferingModelfor the given code and prices of theTmaProductOfferingModelbased on theTmaPriceContextDatagetProductOffering(String productCode, TmaSubscribedProductAction cartAction) Returns a product offering for the given product code and cart action.getProductOfferingGroupsByProperties(Map<String, String> propertyPattern) Returns the set of @{link TmaProductOfferingGroupModel} based on key and value in map where key is the property name and the value is the pattern value of the propertygetProductOfferings(CatalogVersionModel catalogVersion) Returns product offering list for corresponding catalog versiongetProductOfferings(Collection<CatalogVersionModel> catalogVersions, TmaProductOfferingSearchContext productOfferingSearchContext) Deprecated, for removal: This API element is subject to removal in a future version.since 1911 - use getAllProducts method of ExportProductService insteadgetProductOfferingsByProperties(Map<String, String> propertyPattern) Returns the set ofTmaProductOfferingModelbased on key and value in map where key is the property name and the value is the pattern value of the propertygetProductsForCode(String code) Return the list ofTmaProductOfferingModelbased on product codegetSpoListForBpo(TmaBundledProductOfferingModel bundleProductOffering) Returns the list of all child product offeringTmaSimpleProductOfferingModelfor a given bundled product offering.getSposAndFixedBposFor(TmaBundledProductOfferingModel bundledProductOffering) Returns the list of all children product offeringsTmaSimpleProductOfferingModelandTmaFixedBundledProductOfferingModelfor a given bundled product offering.booleanisPoEligibleForProcessType(TmaProcessType processType, TmaProductOfferingModel product, TmaBundledProductOfferingModel bpo) Verifies if the given product is eligible for the given process type.booleanThis method checks if the given cart action requires an operational product.booleanisValidChild(TmaProductOfferingModel child, TmaBundledProductOfferingModel parent) Verifies if the given child is eligible to be attached on the given parent.booleanisValidParent(TmaProductOfferingModel product, TmaBundledProductOfferingModel parent) Verifies if the givenTmaBundledProductOfferingModelparent is a valid parent for the given product offering.voidRemoves the link betweenTmaProductOfferingModelchild andTmaBundledProductOfferingModelparent.voidRemoves the product offering by id.
-
Method Details
-
getPoForCode
Returns aTmaProductOfferingModelfor the given code.- Parameters:
code- identifier ofTmaProductOfferingModel- Returns:
TmaProductOfferingModel
-
addPoChildToParent
Adds a newTmaProductOfferingModelchild to aTmaBundledProductOfferingModelparent.- Parameters:
parent- bundled product offering under which the child is addedchild- child to be added
-
removePoChildFromParent
Removes the link betweenTmaProductOfferingModelchild andTmaBundledProductOfferingModelparent.- Parameters:
parent- bundled product offering from which the child is removedchild- product offering child to be removed
-
getAllParents
Returns all parents for the given product offering.- Parameters:
poModel- product offering- Returns:
CollectionofTmaBundledProductOfferingModel
-
getGroupNextToProductGroup
Optional<TmaProductOfferingGroupModel> getGroupNextToProductGroup(TmaBundledProductOfferingModel bpo, TmaProductOfferingModel po) Searches for the the group next to the group which contains the PO given as parameter; It returns: the group with index 0, if PO given as parameter is in a group with index higher than 0 or, the group with index 1, if PO given as parameter is in a group with index 0 or, emptyOptionalif no group is found.- Parameters:
bpo- theTmaBundledProductOfferingModelpo- theTmaProductOfferingModel- Returns:
OptionalofTmaProductOfferingGroupModel
-
isValidParent
Verifies if the givenTmaBundledProductOfferingModelparent is a valid parent for the given product offering. A valid parent it not necessary a first direct parent, it can also be a parent of one of product parents.- Parameters:
product- the given product offering against the checks are madeparent- the given parent to be check if is valid- Returns:
- true if all Set elements are valid product parents codes, false otherwise
-
getBpoForCode
Returns aTmaBundledProductOfferingModelfor the given code.- Parameters:
code- identifier ofTmaBundledProductOfferingModel- Returns:
TmaBundledProductOfferingModel
-
getOfferingGroupForPoAndBpo
Optional<TmaProductOfferingGroupModel> getOfferingGroupForPoAndBpo(TmaProductOfferingModel productOffering, TmaBundledProductOfferingModel parent) Retrieves theTmaProductOfferingGroupModelfor a given product inside the givenTmaBundledProductOfferingModelparent.- Parameters:
productOffering- theTmaProductOfferingModelwhose product offering group will be identifiedparent- theTmaBundledProductOfferingModelused for filtering the product offering groups- Returns:
- the
TmaProductOfferingGroupModelconfigured for the given product if any
-
isPoEligibleForProcessType
boolean isPoEligibleForProcessType(TmaProcessType processType, TmaProductOfferingModel product, TmaBundledProductOfferingModel bpo) Verifies if the given product is eligible for the given process type. Eligibility is performed considering the process types defined on the subscription price plans of the given product. If the BPO is given then the checks are performed against price plan overrides of the BPO where the product is defined as affected product.- Parameters:
processType- the process type that is going to be verifiedproduct- the product checked if eligible for given process typebpo- the BPO where product is part of- Returns:
- true/ false depending on the eligibility of the given product for the process type
-
getPoForCodeAndPriceContext
Returns aTmaProductOfferingModelfor the given code and prices of theTmaProductOfferingModelbased on theTmaPriceContextData- Parameters:
code- identifier ofTmaProductOfferingModelpriceContext- priceContextTmaPriceContextto retrieve prices of theTmaProductOfferingModel- Returns:
TmaProductOfferingModel
-
getProductOfferings
@Deprecated(since="1911", forRemoval=true) SearchPageData<TmaProductOfferingModel> getProductOfferings(Collection<CatalogVersionModel> catalogVersions, TmaProductOfferingSearchContext productOfferingSearchContext) Deprecated, for removal: This API element is subject to removal in a future version.since 1911 - use getAllProducts method of ExportProductService insteadFinds theTmaProductOfferingModelfor a given collectionCatalogVersionModelandTmaProductOfferingSearchContext- Parameters:
catalogVersions- catalog versions used to query for productsproductOfferingSearchContext- product search context object stores all attributes for search- Returns:
- page of
TmaProductOfferingModelwrapped onSearchResult
-
getConfigurableProductSpecCharacteristics
Set<TmaProductSpecCharacteristicModel> getConfigurableProductSpecCharacteristics(TmaProductOfferingModel productOffering) Computes and returns the configurableTmaProductSpecCharacteristicModelof a given product.- Parameters:
productOffering- the product offering- Returns:
- the configurable characteristics
-
getOperationalProductOffering
Optional<TmaOperationalProductOfferingModel> getOperationalProductOffering(TmaSubscribedProductAction action) Returns the operational product corresponding to the specified action.- Parameters:
action- the action that should be supported by the operational product.- Returns:
- The first operational product found that supports the given action, if any.
-
isServiceRequestAction
This method checks if the given cart action requires an operational product.- Parameters:
action- the input action to be checked.- Returns:
- true if an operational Po is used; false otherwise
-
getProductOffering
Returns a product offering for the given product code and cart action.- Parameters:
productCode- the code used for getting a PO if the action is keepcartAction- the cart action- Returns:
- the product offering for the product code and cart action.
- Throws:
de.hybris.platform.servicelayer.exceptions.ModelNotFoundException- if no product offering is found.IllegalArgumentException- if the cartAction is invalid.
-
getProductsForCode
Return the list ofTmaProductOfferingModelbased on product code- Parameters:
code- identifier ofTmaProductOfferingModel- Returns:
TmaProductOfferingModel
-
getProductOfferingsByProperties
Returns the set ofTmaProductOfferingModelbased on key and value in map where key is the property name and the value is the pattern value of the property- Parameters:
propertyPattern- map which has property as key and pattern as value- Returns:
- Set of
TmaProductOfferingModel
-
getProductOfferingGroupsByProperties
Set<TmaProductOfferingGroupModel> getProductOfferingGroupsByProperties(Map<String, String> propertyPattern) Returns the set of @{link TmaProductOfferingGroupModel} based on key and value in map where key is the property name and the value is the pattern value of the property- Parameters:
propertyPattern- map which has propertyPattern as key and pattern as value- Returns:
- Set of
TmaProductOfferingGroupModel
-
getSpoListForBpo
List<TmaSimpleProductOfferingModel> getSpoListForBpo(TmaBundledProductOfferingModel bundleProductOffering) Returns the list of all child product offeringTmaSimpleProductOfferingModelfor a given bundled product offering.- Parameters:
bundleProductOffering- the bundle product offering- Returns:
- the child spos of the product offering
-
getProductOfferings
Returns product offering list for corresponding catalog version- Parameters:
catalogVersion- for which product offerings will be retrieved- Returns:
- List of
TmaProductOfferingModel
-
getBundledProdOfferOptionFor
Optional<TmaBundledProdOfferOptionModel> getBundledProdOfferOptionFor(TmaBundledProductOfferingModel bundledProductOffering, TmaProductOfferingModel productOffering) Returns the bundled product offering option part of the provided bpo which is referred to the provided product offering.- Parameters:
bundledProductOffering- The Bundled Product OfferingproductOffering- The product offering- Returns:
- The
TmaBundledProdOfferOptionModelfrom the bpo which refers to the product offering
-
getIntermediateBpos
List<TmaBundledProductOfferingModel> getIntermediateBpos(TmaProductOfferingModel currentPo, TmaBundledProductOfferingModel targetBpo) Returns the list of BPOs between the provided PO and the target BPO.- Parameters:
currentPo- The product offeringtargetBpo- The target bundled product offering- Returns:
- List of
TmaBundledProductOfferingModel
-
isValidChild
Verifies if the given child is eligible to be attached on the given parent. Eligible means that child must be a SPO either a Fixed BPO if the parent is a Fixed BPO- Parameters:
child- The PO which is going to be checked if it is eligible for attaching on a Fixed BPOparent- The BPO depending on we know if the child PO is eligible or not- Returns:
- true/ false depending on the eligibility of the given product offering
-
getSposAndFixedBposFor
List<TmaProductOfferingModel> getSposAndFixedBposFor(TmaBundledProductOfferingModel bundledProductOffering) Returns the list of all children product offeringsTmaSimpleProductOfferingModelandTmaFixedBundledProductOfferingModelfor a given bundled product offering.- Parameters:
bundledProductOffering- the bundle product offering- Returns:
- the child spos or fixed bpos of the product offering
-
getParentIdsFrom
Returns the set of all parents product offering ids for a given product offering.- Parameters:
productOffering- the product offering- Returns:
- A set containing the parents ids of the product offering
-
getConfigurableProductSpecCharValueUses
Set<TmaProductSpecCharValueUseModel> getConfigurableProductSpecCharValueUses(TmaProductOfferingModel productOffering) Gets the configurable product spec characteristics value uses.- Parameters:
productOffering- the product offering- Returns:
- the configurable product spec characteristics value uses
-
removeProductOffering
Removes the product offering by id.- Parameters:
id- the id of the product offering .
-