Pricing Provider

Estimated reading: 2 minutes 5 views

Overview

The Pricing Provider is the component that retrieves the price of the usage data. It is the component that is responsible for finding a specific price.

Prices can be located by different criteria, such as:

  • Billable Concept
  • Country
  • Company
  • From / To Date
  • Product
  • etc.

Out-of-the-box Pricing Provider

The out-of-the-box Pricing Provider covers from the most basic scenario where there is a single price for a specific concept, to the most complex scenarios where the price is compund by different prices for each hour of the day for example.

To learn more about the out-of-the-box Pricing Provider, please refer to the Pricing documentation.

Custom Pricing Provider

It would be rarely required to create a custom Pricing Provider. In fact, we advise to discuss this with Wattyo support in case you need to do it. But in case you need to do it, you can create your own provider and plug it into the system.

Pricing Provider Interface

The PricingProvider interface is defined as follows:

interface PricingProvider {
    Map<Id, List<Price>> getPrices(Set<Id> billableElementsIds);
}

The getPrices method is responsible for loading the prices for the specified Billable Elements. The method receives the list of Ids of the Billable Elements to load the prices for.

Price DTO

The Price is the object that the provider must return. It is defined as follows:

class Price {
//TODO
}

Leave a Comment

       
Euphoria, forever till the end of times

Euphoria

Share this Doc

Pricing Provider

Or copy link

CONTENTS