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 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 identifier
      accessType - subscription access type
      Returns:
      TmaSubscriptionBaseModel returns TmaSubscriptionBaseModel
    • getAllSubscribedProducts

      List<TmaSubscribedProductModel> getAllSubscribedProducts(CustomerModel customerModel)
      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 the TmaProcessTypes for which the current customer is eligible.
      Returns:
      eligible process types.
    • retrieveProcessesByCustomerId

      Set<TmaProcessType> retrieveProcessesByCustomerId(String customerId)
      Retrieves the TmaProcessTypes for which the given customer is eligible. If no input customer id is given it will return the TmaProcessType for 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

      Set<TmaSubscriptionBaseModel> retrieveSubscriptionsForProcess(TmaProcessType processType)
      Retrieves the TmaSubscriptionBaseModels eligible for a given process.
      Parameters:
      processType - the given process type for which eligible subscription ids are retrieved
      Returns:
      the TmaSubscriptionBaseModel eligible for given process
    • retrieveSubscriptionsForProcess

      Set<TmaSubscriptionBaseModel> retrieveSubscriptionsForProcess(TmaProcessType processType, String userId)
      Retrieves the TmaSubscriptionBaseModels eligible for a given process and user.
      Parameters:
      processType - the given process type for which eligible subscription ids are retrieved
      userId - the identifier of the user
      Returns:
      the TmaSubscriptionBaseModel eligible for given process and user
    • retrieveEligibleSubscriptions

      Optional<TmaSubscriptionBaseModel> retrieveEligibleSubscriptions(String subscriberIdentity, String billingSystemId, TmaProcessType processType)
      Retrieves the TmaSubscriptionBaseModel eligible for a given process, billing system and subscriber identity
      Parameters:
      subscriberIdentity - the given subscriber identity for which eligible subscription is retrieved
      billingSystemId - the given billing system id for which eligible subscription is retrieved
      processType - 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 a TmaCartSubscriptionInfoModel from given subscriber info
      Parameters:
      subscriberIdentity - the identity of the subscriber
      billingId - the identifier of the billing system
      subscriptionTermId - the identifier of the subscription term
      processType - 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 given TmaSubscribedProductModel can be replaced by the selected TmaProductOfferingModel.
      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.