Interface TmaPoService
-
- All Known Implementing Classes:
DefaultTmaPoService
public interface TmaPoServiceService handling business logic aroundTmaProductOfferingModel.- Since:
- 6.7
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddPoChildToParent(TmaBundledProductOfferingModel parent, TmaProductOfferingModel child)Adds a newTmaProductOfferingModelchild to aTmaBundledProductOfferingModelparent.java.util.Collection<TmaBundledProductOfferingModel>getAllParents(TmaProductOfferingModel poModel)Returns all parents for the given product offering.TmaBundledProductOfferingModelgetBpoForCode(java.lang.String code)Returns aTmaBundledProductOfferingModelfor the given code.java.util.Set<TmaProductSpecCharacteristicModel>getConfigurableProductSpecCharacteristics(TmaProductOfferingModel productOffering)Computes and returns the configurableTmaProductSpecCharacteristicModelof a given product.java.util.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.java.util.Optional<TmaProductOfferingGroupModel>getOfferingGroupForPoAndBpo(TmaProductOfferingModel productOffering, TmaBundledProductOfferingModel parent)Retrieves theTmaProductOfferingGroupModelfor a given product inside the givenTmaBundledProductOfferingModelparent.java.util.Optional<TmaOperationalProductOfferingModel>getOperationalProductOffering(TmaSubscribedProductAction action)Returns the operational product corresponding to the specified action.TmaProductOfferingModelgetPoForCode(java.lang.String code)Returns aTmaProductOfferingModelfor the given code.TmaProductOfferingModelgetPoForCodeAndPriceContext(java.lang.String code, TmaPriceContext priceContext)Returns aTmaProductOfferingModelfor the given code and prices of theTmaProductOfferingModelbased on theTmaPriceContextDataProductModelgetProductOffering(java.lang.String productCode, TmaSubscribedProductAction cartAction)Returns a product offering for the given product code and cart action.java.util.Set<TmaProductOfferingGroupModel>getProductOfferingGroupsByProperties(java.util.Map<java.lang.String,java.lang.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 propertyjava.util.List<TmaProductOfferingModel>getProductOfferings(CatalogVersionModel catalogVersion)Returns product offering list for corresponding catalog versionSearchPageData<TmaProductOfferingModel>getProductOfferings(java.util.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 insteadjava.util.Set<TmaProductOfferingModel>getProductOfferingsByProperties(java.util.Map<java.lang.String,java.lang.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 propertyjava.util.List<TmaProductOfferingModel>getProductsForCode(java.lang.String code)Return the list ofTmaProductOfferingModelbased on product codejava.util.List<TmaSimpleProductOfferingModel>getSpoListForBpo(TmaBundledProductOfferingModel bundleProductOffering)Returns the list of all child product offeringTmaSimpleProductOfferingModelfor a given bundled product offering.booleanisPoEligibleForProcessType(TmaProcessType processType, TmaProductOfferingModel product, TmaBundledProductOfferingModel bpo)Verifies if the given product is eligible for the given process type.booleanisServiceRequestAction(TmaSubscribedProductAction action)This method checks if the given cart action requires an operational product.booleanisValidParent(TmaProductOfferingModel product, TmaBundledProductOfferingModel parent)Verifies if the givenTmaBundledProductOfferingModelparent is a valid parent for the given product offering.voidremovePoChildFromParent(TmaBundledProductOfferingModel parent, TmaProductOfferingModel child)Removes the link betweenTmaProductOfferingModelchild andTmaBundledProductOfferingModelparent.
-
-
-
Method Detail
-
getPoForCode
TmaProductOfferingModel getPoForCode(java.lang.String code)
Returns aTmaProductOfferingModelfor the given code.- Parameters:
code- identifier ofTmaProductOfferingModel- Returns:
TmaProductOfferingModel
-
addPoChildToParent
void addPoChildToParent(TmaBundledProductOfferingModel parent, TmaProductOfferingModel child)
Adds a newTmaProductOfferingModelchild to aTmaBundledProductOfferingModelparent.- Parameters:
parent- bundled product offering under which the child is addedchild- child to be added
-
removePoChildFromParent
void removePoChildFromParent(TmaBundledProductOfferingModel parent, TmaProductOfferingModel child)
Removes the link betweenTmaProductOfferingModelchild andTmaBundledProductOfferingModelparent.- Parameters:
parent- bundled product offering from which the child is removedchild- product offering child to be removed
-
getAllParents
java.util.Collection<TmaBundledProductOfferingModel> getAllParents(TmaProductOfferingModel poModel)
Returns all parents for the given product offering.- Parameters:
poModel- product offering- Returns:
CollectionofTmaBundledProductOfferingModel
-
getGroupNextToProductGroup
java.util.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
boolean isValidParent(TmaProductOfferingModel product, TmaBundledProductOfferingModel parent)
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
TmaBundledProductOfferingModel getBpoForCode(java.lang.String code)
Returns aTmaBundledProductOfferingModelfor the given code.- Parameters:
code- identifier ofTmaBundledProductOfferingModel- Returns:
TmaBundledProductOfferingModel
-
getOfferingGroupForPoAndBpo
java.util.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
TmaProductOfferingModel getPoForCodeAndPriceContext(java.lang.String code, TmaPriceContext priceContext)
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(java.util.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
java.util.Set<TmaProductSpecCharacteristicModel> getConfigurableProductSpecCharacteristics(TmaProductOfferingModel productOffering)
Computes and returns the configurableTmaProductSpecCharacteristicModelof a given product.- Parameters:
productOffering- the product offering- Returns:
- the configurable characteristics
-
getOperationalProductOffering
java.util.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
boolean isServiceRequestAction(TmaSubscribedProductAction action)
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
ProductModel getProductOffering(java.lang.String productCode, TmaSubscribedProductAction cartAction)
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.java.lang.IllegalArgumentException- if the cartAction is invalid.
-
getProductsForCode
java.util.List<TmaProductOfferingModel> getProductsForCode(java.lang.String code)
Return the list ofTmaProductOfferingModelbased on product code- Parameters:
code- identifier ofTmaProductOfferingModel- Returns:
TmaProductOfferingModel
-
getProductOfferingsByProperties
java.util.Set<TmaProductOfferingModel> getProductOfferingsByProperties(java.util.Map<java.lang.String,java.lang.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 property- Parameters:
propertyPattern- map which has property as key and pattern as value- Returns:
- Set of
TmaProductOfferingModel
-
getProductOfferingGroupsByProperties
java.util.Set<TmaProductOfferingGroupModel> getProductOfferingGroupsByProperties(java.util.Map<java.lang.String,java.lang.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
java.util.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
java.util.List<TmaProductOfferingModel> getProductOfferings(CatalogVersionModel catalogVersion)
Returns product offering list for corresponding catalog version- Parameters:
catalogVersion- for which product offerings will be retrieved- Returns:
- List of
TmaProductOfferingModel
-
-