Interface TmaCustomerInventoryService
- All Known Implementing Classes:
DefaultTmaCustomerInventoryService
public interface TmaCustomerInventoryService
Service handling business logic around all customer inventory entities
TmaBillingAccountModel,
TmaSubscriptionBaseModel,
TmaSubscriptionAccessModel- Since:
- 6.7
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanReplaceSubscribedProductWithOffering(TmaSubscribedProductModel subscribedProduct, TmaProductOfferingModel productOffering) Checks if a givenTmaSubscribedProductModelcan be replaced by the selectedTmaProductOfferingModel.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.getSubscribedProductById(String subscribedProductId, CustomerModel customer) Gets a subscribedProduct by id for a given customer.groupSubscriptionsByBillingArrangementAndBpo(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.
-
Method Details
-
createNewSubscriptionHierarchy
TmaSubscriptionBaseModel createNewSubscriptionHierarchy(String customerId, TmaAccessType accessType) Creates a new billing account for the given customer and a subscription base having the given access type.- Parameters:
customerId- customer identifieraccessType- subscription access type- Returns:
TmaSubscriptionBaseModelreturns TmaSubscriptionBaseModel
-
getAllSubscribedProducts
Returns the list of subscribed products from all customer's subscriptions.- Parameters:
customerModel- customer to be considered- Returns:
- list of all customer subscribed products
-
groupSubscriptionsByBillingArrangementAndBpo
Map<String,List<TmaSubscriptionBaseModel>> groupSubscriptionsByBillingArrangementAndBpo(List<TmaSubscriptionBaseModel> subscriptionBases) The 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.- 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
Set<TmaProcessType> retrieveProcesses()Retrieves theTmaProcessTypes for which the current customer is eligible.- Returns:
- eligible process types.
-
retrieveProcessesByCustomerId
Retrieves 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.- 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
Retrieves theTmaSubscriptionBaseModels eligible for a given process.- Parameters:
processType- the given process type for which eligible subscription ids are retrieved- Returns:
- the
TmaSubscriptionBaseModeleligible for given process
-
retrieveSubscriptionsForProcess
Set<TmaSubscriptionBaseModel> retrieveSubscriptionsForProcess(TmaProcessType processType, String userId) Retrieves theTmaSubscriptionBaseModels eligible for a given process and user.- 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
-
retrieveEligibleSubscriptions
Optional<TmaSubscriptionBaseModel> retrieveEligibleSubscriptions(String subscriberIdentity, String billingSystemId, TmaProcessType processType) Retrieves theTmaSubscriptionBaseModeleligible for a given process, billing system and subscriber identity- 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
Set<TmaProcessType> getAllProcessTypes()Gets all the ProcessTypes that exist in the system.- Returns:
- A list of processTypes.
-
createNewCartSubscriptionInfo
TmaCartSubscriptionInfoModel createNewCartSubscriptionInfo(String subscriberIdentity, String billingId, String subscriptionTermId, String processType) Creates aTmaCartSubscriptionInfoModelfrom given subscriber info- 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
Optional<TmaSubscribedProductModel> getSubscribedProductById(String subscribedProductId, CustomerModel customer) Gets a subscribedProduct by id for a given customer.- Parameters:
subscribedProductId- the id of the subscribedProduct.customer- the customer the subscribedProduct belongs to.- Returns:
- the subscribedProduct if found;
-
canReplaceSubscribedProductWithOffering
boolean canReplaceSubscribedProductWithOffering(TmaSubscribedProductModel subscribedProduct, TmaProductOfferingModel productOffering) Checks if a givenTmaSubscribedProductModelcan be replaced by the selectedTmaProductOfferingModel.- 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.
-