Tariff subscription story - Pyosch/powertac-server GitHub Wiki

up
Here is a sequence diagram showing the subscription process: tariff subscription

A customer uses the TariffMarket API to request the current list of active tariffs for a particular PowerType, or it waits for the tariffMarketService to call its publishNewTariffs() method. The result will be returned with the most recent tariffs first. Having decided to switch some number n of its individual subscribers from some old tariff to a new one, it first unsubscribes from the old one, which may result in an early-withdrawal penalty being posted to Accounting. It then subscribes to the new one through the TariffMarket. The TariffMarket checks to see whether the Tariff is expired or revoked, and returns null if it is. If the tariff is active, then if this customer does not already have some individuals subscribed to it the Tariffmarket creates a new TariffSubscription and asks the subscription to add n individuals to it for the customer. The subscription posts a transaction to Accounting for the signup bonus, and the TariffMarket returns the new or updated TariffSubscription to the customer.

See also

⚠️ **GitHub.com Fallback** ⚠️