Class DefaultTmaCustomerInventoryService
- java.lang.Object
-
- de.hybris.platform.b2ctelcoservices.services.impl.DefaultTmaCustomerInventoryService
-
- All Implemented Interfaces:
TmaCustomerInventoryService
public class DefaultTmaCustomerInventoryService extends java.lang.Object implements TmaCustomerInventoryService
Default implementation forTmaCustomerInventoryService.- Since:
- 1810
-
-
Constructor Summary
Constructors Constructor Description DefaultTmaCustomerInventoryService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanReplaceSubscribedProductWithOffering(TmaSubscribedProductModel subscribedProduct, TmaProductOfferingModel productOffering)Checks if a givenTmaSubscribedProductModelcan be replaced by the selectedTmaProductOfferingModel.protected booleancheckMatchingProductTypes(java.util.Set<TmaProductSpecTypeModel> poProductSpecTypes, java.util.Set<TmaProductSpecTypeModel> subscribedProductSpecTypes, java.lang.Class productSpecificationTypeClass)This method checks if the instances of subtype ofTmaProductSpecTypeModelgiven by the productSpecificationTypeClass parameter match between the product offering and the subscribed product.TmaCartSubscriptionInfoModelcreateNewCartSubscriptionInfo(java.lang.String subscriberIdentity, java.lang.String billingId, java.lang.String subscriptionTermId, java.lang.String processType)Creates aTmaCartSubscriptionInfoModelfrom given subscriber infoTmaSubscriptionBaseModelcreateNewSubscriptionHierarchy(java.lang.String customerId, TmaAccessType accessType)Creates a new billing account for the given customer and a subscription base having the given access type.java.util.Set<TmaProcessType>getAllProcessTypes()Gets all the ProcessTypes that exist in the system.java.util.List<TmaSubscribedProductModel>getAllSubscribedProducts(CustomerModel customerModel)Returns the list of subscribed products from all customer's subscriptions.protected TmaBillingAccountServicegetBillingAccountService()protected de.hybris.platform.enumeration.EnumerationServicegetEnumerationService()protected de.hybris.platform.servicelayer.model.ModelServicegetModelService()protected java.util.List<TmaProcessType>getProcessTypesFromCodes(java.util.List<java.lang.String> processTypeCodes)java.util.Optional<TmaSubscribedProductModel>getSubscribedProductById(java.lang.String subscribedProductId, CustomerModel customer)Gets a subscribedProduct by id for a given customer.protected TmaSubscriptionBaseServicegetSubscriptionBaseService()protected TmaSubscriptionTermServicegetSubscriptionTermService()protected TmaEligibilityContextServicegetTmaEligibilityContextService()protected de.hybris.platform.servicelayer.user.UserServicegetUserService()java.util.Map<java.lang.String,java.util.List<TmaSubscriptionBaseModel>>groupSubscriptionsByBillingArrangementAndBpo(java.util.List<TmaSubscriptionBaseModel> subscriptionBases)The list of subscription selections given is grouped by billing agreement and BPO, obtaining a map of subscription selection lists.java.util.Optional<TmaSubscriptionBaseModel>retrieveEligibleSubscriptions(java.lang.String subscriberIdentity, java.lang.String billingSystemId, TmaProcessType processType)Retrieves theTmaSubscriptionBaseModeleligible for a given process, billing system and subscriber identityjava.util.Set<TmaProcessType>retrieveProcesses()Retrieves theTmaProcessTypes for which the current customer is eligible.java.util.Set<TmaProcessType>retrieveProcessesByCustomerId(java.lang.String customerId)Retrieves theTmaProcessTypes for which the given customer is eligible.java.util.Set<TmaSubscriptionBaseModel>retrieveSubscriptionsForProcess(TmaProcessType processType)Retrieves theTmaSubscriptionBaseModels eligible for a given process.java.util.Set<TmaSubscriptionBaseModel>retrieveSubscriptionsForProcess(TmaProcessType processType, java.lang.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)
-
-
-
Method Detail
-
createNewSubscriptionHierarchy
public TmaSubscriptionBaseModel createNewSubscriptionHierarchy(java.lang.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 java.util.Map<java.lang.String,java.util.List<TmaSubscriptionBaseModel>> groupSubscriptionsByBillingArrangementAndBpo(java.util.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
public java.util.Set<TmaProcessType> retrieveProcesses()
Description copied from interface:TmaCustomerInventoryServiceRetrieves theTmaProcessTypes for which the current customer is eligible.- Specified by:
retrieveProcessesin interfaceTmaCustomerInventoryService- Returns:
- eligible process types.
-
retrieveProcessesByCustomerId
public java.util.Set<TmaProcessType> retrieveProcessesByCustomerId(java.lang.String customerId)
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
public java.util.Set<TmaSubscriptionBaseModel> retrieveSubscriptionsForProcess(TmaProcessType processType)
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 java.util.Set<TmaSubscriptionBaseModel> retrieveSubscriptionsForProcess(TmaProcessType processType, java.lang.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
public java.util.List<TmaSubscribedProductModel> getAllSubscribedProducts(CustomerModel customerModel)
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 java.util.Optional<TmaSubscriptionBaseModel> retrieveEligibleSubscriptions(java.lang.String subscriberIdentity, java.lang.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
public java.util.Set<TmaProcessType> 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(java.lang.String subscriberIdentity, java.lang.String billingId, java.lang.String subscriptionTermId, java.lang.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 java.util.Optional<TmaSubscribedProductModel> getSubscribedProductById(java.lang.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(java.util.Set<TmaProductSpecTypeModel> poProductSpecTypes, java.util.Set<TmaProductSpecTypeModel> subscribedProductSpecTypes, java.lang.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
protected java.util.List<TmaProcessType> getProcessTypesFromCodes(java.util.List<java.lang.String> processTypeCodes)
-
getSubscriptionBaseService
protected TmaSubscriptionBaseService getSubscriptionBaseService()
-
setSubscriptionBaseService
public void setSubscriptionBaseService(TmaSubscriptionBaseService subscriptionBaseService)
-
getBillingAccountService
protected TmaBillingAccountService getBillingAccountService()
-
setBillingAccountService
public void setBillingAccountService(TmaBillingAccountService billingAccountService)
-
getEnumerationService
protected de.hybris.platform.enumeration.EnumerationService getEnumerationService()
-
setEnumerationService
public void setEnumerationService(de.hybris.platform.enumeration.EnumerationService enumerationService)
-
getTmaEligibilityContextService
protected TmaEligibilityContextService 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
protected TmaSubscriptionTermService getSubscriptionTermService()
-
setSubscriptionTermService
public void setSubscriptionTermService(TmaSubscriptionTermService subscriptionTermService)
-
-