Class DefaultTmaCustomerInventoryService
java.lang.Object
de.hybris.platform.b2ctelcoservices.services.impl.DefaultTmaCustomerInventoryService
- All Implemented Interfaces:
TmaCustomerInventoryService
public class DefaultTmaCustomerInventoryService
extends Object
implements TmaCustomerInventoryService
Default implementation for
TmaCustomerInventoryService.- Since:
- 1810
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanReplaceSubscribedProductWithOffering(TmaSubscribedProductModel subscribedProduct, TmaProductOfferingModel productOffering) Checks if a givenTmaSubscribedProductModelcan be replaced by the selectedTmaProductOfferingModel.protected booleancheckMatchingProductTypes(Set<TmaProductSpecTypeModel> poProductSpecTypes, Set<TmaProductSpecTypeModel> subscribedProductSpecTypes, Class productSpecificationTypeClass) This method checks if the instances of subtype ofTmaProductSpecTypeModelgiven by the productSpecificationTypeClass parameter match between the product offering and the subscribed product.createNewCartSubscriptionInfo(String subscriberIdentity, String billingId, String subscriptionTermId, String processType) Creates aTmaCartSubscriptionInfoModelfrom given subscriber infocreateNewSubscriptionHierarchy(String customerId, TmaAccessType accessType) Creates a new billing account for the given customer and a subscription base having the given access type.Gets all the ProcessTypes that exist in the system.getAllSubscribedProducts(CustomerModel customerModel) Returns the list of subscribed products from all customer's subscriptions.protected TmaBillingAccountServiceprotected de.hybris.platform.enumeration.EnumerationServiceprotected de.hybris.platform.servicelayer.model.ModelServiceprotected List<TmaProcessType>getProcessTypesFromCodes(List<String> processTypeCodes) getSubscribedProductById(String subscribedProductId, CustomerModel customer) Gets a subscribedProduct by id for a given customer.protected TmaSubscriptionBaseServiceprotected TmaSubscriptionTermServiceprotected TmaEligibilityContextServiceprotected de.hybris.platform.servicelayer.user.UserServicegroupSubscriptionsByBillingArrangementAndBpo(List<TmaSubscriptionBaseModel> subscriptionBases) The list of subscription selections given is grouped by billing agreement and BPO, obtaining a map of subscription selection lists.retrieveEligibleSubscriptions(String subscriberIdentity, String billingSystemId, TmaProcessType processType) Retrieves theTmaSubscriptionBaseModeleligible for a given process, billing system and subscriber identityRetrieves theTmaProcessTypes for which the current customer is eligible.retrieveProcessesByCustomerId(String customerId) Retrieves theTmaProcessTypes for which the given customer is eligible.retrieveSubscriptionsForProcess(TmaProcessType processType) Retrieves theTmaSubscriptionBaseModels eligible for a given process.retrieveSubscriptionsForProcess(TmaProcessType processType, String userId) Retrieves theTmaSubscriptionBaseModels eligible for a given process and user.voidsetBillingAccountService(TmaBillingAccountService billingAccountService) voidsetEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService) voidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService) voidsetSubscriptionBaseService(TmaSubscriptionBaseService subscriptionBaseService) voidsetSubscriptionTermService(TmaSubscriptionTermService subscriptionTermService) voidsetTmaEligibilityContextService(TmaEligibilityContextService tmaEligibilityContextService) voidsetUserService(de.hybris.platform.servicelayer.user.UserService userService)
-
Constructor Details
-
DefaultTmaCustomerInventoryService
public DefaultTmaCustomerInventoryService()
-
-
Method Details
-
createNewSubscriptionHierarchy
public TmaSubscriptionBaseModel createNewSubscriptionHierarchy(String customerId, TmaAccessType accessType) Description copied from interface:TmaCustomerInventoryServiceCreates a new billing account for the given customer and a subscription base having the given access type.- Specified by:
createNewSubscriptionHierarchyin interfaceTmaCustomerInventoryService- Parameters:
customerId- customer identifieraccessType- subscription access type- Returns:
TmaSubscriptionBaseModelreturns TmaSubscriptionBaseModel
-
groupSubscriptionsByBillingArrangementAndBpo
public Map<String,List<TmaSubscriptionBaseModel>> groupSubscriptionsByBillingArrangementAndBpo(List<TmaSubscriptionBaseModel> subscriptionBases) Description copied from interface:TmaCustomerInventoryServiceThe list of subscription selections given is grouped by billing agreement and BPO, obtaining a map of subscription selection lists. The key of the map is: - Combination of billing agreement id and BPO: for those subscriptions having the billing agreement and BPO attached - Billing agreement ID + 'NOBPO' + indexNo: for those subscriptions having billing agreement attached but no BPO At first the subscription selections are grouped by billing agreement. If a subscription selection has no billing agreement that subscription is not considered anymore. The list of subscription selections grouped by billing agreement is then grouped by BPO. Each list of subscription selections having the same billing agreement and same BPO will be added to the result map as an entry having the key determined as described above.- Specified by:
groupSubscriptionsByBillingArrangementAndBpoin interfaceTmaCustomerInventoryService- Parameters:
subscriptionBases- the list with subscription selections that will be processed- Returns:
- the subscription selections map grouping the subscription bases by billing agreement and BPO
-
retrieveProcesses
Description copied from interface:TmaCustomerInventoryServiceRetrieves theTmaProcessTypes for which the current customer is eligible.- Specified by:
retrieveProcessesin interfaceTmaCustomerInventoryService- Returns:
- eligible process types.
-
retrieveProcessesByCustomerId
Description copied from interface:TmaCustomerInventoryServiceRetrieves theTmaProcessTypes for which the given customer is eligible. If no input customer id is given it will return theTmaProcessTypefor the current user on the session.- Specified by:
retrieveProcessesByCustomerIdin interfaceTmaCustomerInventoryService- Parameters:
customerId- The id of the customer- Returns:
- eligible process flows for the given customer; if customerId is empty return the processes for the current user.
-
retrieveSubscriptionsForProcess
Description copied from interface:TmaCustomerInventoryServiceRetrieves theTmaSubscriptionBaseModels eligible for a given process.- Specified by:
retrieveSubscriptionsForProcessin interfaceTmaCustomerInventoryService- Parameters:
processType- the given process type for which eligible subscription ids are retrieved- Returns:
- the
TmaSubscriptionBaseModeleligible for given process
-
retrieveSubscriptionsForProcess
public Set<TmaSubscriptionBaseModel> retrieveSubscriptionsForProcess(TmaProcessType processType, String userId) Description copied from interface:TmaCustomerInventoryServiceRetrieves theTmaSubscriptionBaseModels eligible for a given process and user.- Specified by:
retrieveSubscriptionsForProcessin interfaceTmaCustomerInventoryService- Parameters:
processType- the given process type for which eligible subscription ids are retrieveduserId- the identifier of the user- Returns:
- the
TmaSubscriptionBaseModeleligible for given process and user
-
getAllSubscribedProducts
Description copied from interface:TmaCustomerInventoryServiceReturns the list of subscribed products from all customer's subscriptions.- Specified by:
getAllSubscribedProductsin interfaceTmaCustomerInventoryService- Parameters:
customerModel- customer to be considered- Returns:
- list of all customer subscribed products
-
retrieveEligibleSubscriptions
public Optional<TmaSubscriptionBaseModel> retrieveEligibleSubscriptions(String subscriberIdentity, String billingSystemId, TmaProcessType processType) Description copied from interface:TmaCustomerInventoryServiceRetrieves theTmaSubscriptionBaseModeleligible for a given process, billing system and subscriber identity- Specified by:
retrieveEligibleSubscriptionsin interfaceTmaCustomerInventoryService- Parameters:
subscriberIdentity- the given subscriber identity for which eligible subscription is retrievedbillingSystemId- the given billing system id for which eligible subscription is retrievedprocessType- the given process type for which eligible subscription is retrieved- Returns:
TmaSubscriptionBaseModel
-
getAllProcessTypes
Description copied from interface:TmaCustomerInventoryServiceGets all the ProcessTypes that exist in the system.- Specified by:
getAllProcessTypesin interfaceTmaCustomerInventoryService- Returns:
- A list of processTypes.
-
createNewCartSubscriptionInfo
public TmaCartSubscriptionInfoModel createNewCartSubscriptionInfo(String subscriberIdentity, String billingId, String subscriptionTermId, String processType) Description copied from interface:TmaCustomerInventoryServiceCreates aTmaCartSubscriptionInfoModelfrom given subscriber info- Specified by:
createNewCartSubscriptionInfoin interfaceTmaCustomerInventoryService- Parameters:
subscriberIdentity- the identity of the subscriberbillingId- the identifier of the billing systemsubscriptionTermId- the identifier of the subscription termprocessType- the process type- Returns:
TmaCartSubscriptionInfoModel
-
getSubscribedProductById
public Optional<TmaSubscribedProductModel> getSubscribedProductById(String subscribedProductId, CustomerModel customer) Description copied from interface:TmaCustomerInventoryServiceGets a subscribedProduct by id for a given customer.- Specified by:
getSubscribedProductByIdin interfaceTmaCustomerInventoryService- Parameters:
subscribedProductId- the id of the subscribedProduct.customer- the customer the subscribedProduct belongs to.- Returns:
- the subscribedProduct if found;
-
canReplaceSubscribedProductWithOffering
public boolean canReplaceSubscribedProductWithOffering(TmaSubscribedProductModel subscribedProduct, TmaProductOfferingModel productOffering) Description copied from interface:TmaCustomerInventoryServiceChecks if a givenTmaSubscribedProductModelcan be replaced by the selectedTmaProductOfferingModel.- Specified by:
canReplaceSubscribedProductWithOfferingin interfaceTmaCustomerInventoryService- Parameters:
subscribedProduct- the subscribed product to be replaced.productOffering- the new product offering.- Returns:
- true if the given subscribedProduct can be replaced by the productOffering; false otherwise.
-
checkMatchingProductTypes
protected boolean checkMatchingProductTypes(Set<TmaProductSpecTypeModel> poProductSpecTypes, Set<TmaProductSpecTypeModel> subscribedProductSpecTypes, Class productSpecificationTypeClass) This method checks if the instances of subtype ofTmaProductSpecTypeModelgiven by the productSpecificationTypeClass parameter match between the product offering and the subscribed product.- Parameters:
poProductSpecTypes- The product specification types of the product offeringsubscribedProductSpecTypes- The product specification types of the subscribed product.productSpecificationTypeClass- The subtype of the productSpecificationType to be checked.- Returns:
- true if the specification types match; false otherwise.
-
getProcessTypesFromCodes
-
getSubscriptionBaseService
-
setSubscriptionBaseService
-
getBillingAccountService
-
setBillingAccountService
-
getEnumerationService
protected de.hybris.platform.enumeration.EnumerationService getEnumerationService() -
setEnumerationService
public void setEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService) -
getTmaEligibilityContextService
-
setTmaEligibilityContextService
public void setTmaEligibilityContextService(TmaEligibilityContextService tmaEligibilityContextService) -
getUserService
protected de.hybris.platform.servicelayer.user.UserService getUserService() -
setUserService
public void setUserService(de.hybris.platform.servicelayer.user.UserService userService) -
getModelService
protected de.hybris.platform.servicelayer.model.ModelService getModelService() -
setModelService
public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService) -
getSubscriptionTermService
-
setSubscriptionTermService
-