Interface TmaCustomerInventoryService

    • Method Detail

      • createNewSubscriptionHierarchy

        TmaSubscriptionBaseModel createNewSubscriptionHierarchy​(java.lang.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

        java.util.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

        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. 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

        java.util.Set<TmaProcessType> retrieveProcesses()
        Retrieves the TmaProcessTypes for which the current customer is eligible.
        Returns:
        eligible process types.
      • retrieveProcessesByCustomerId

        java.util.Set<TmaProcessType> retrieveProcessesByCustomerId​(java.lang.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

        java.util.Set<TmaSubscriptionBaseModel> retrieveSubscriptionsForProcess​(TmaProcessType processType,
                                                                                java.lang.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

        java.util.Optional<TmaSubscriptionBaseModel> retrieveEligibleSubscriptions​(java.lang.String subscriberIdentity,
                                                                                   java.lang.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

        java.util.Set<TmaProcessType> getAllProcessTypes()
        Gets all the ProcessTypes that exist in the system.
        Returns:
        A list of processTypes.
      • createNewCartSubscriptionInfo

        TmaCartSubscriptionInfoModel createNewCartSubscriptionInfo​(java.lang.String subscriberIdentity,
                                                                   java.lang.String billingId,
                                                                   java.lang.String subscriptionTermId,
                                                                   java.lang.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

        java.util.Optional<TmaSubscribedProductModel> getSubscribedProductById​(java.lang.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.