The web service has regulated resources. Their presence / absence / value is what they charge for. You can buy a separate chip, or raise a separate parameter for a while. You can buy a "tariff plan", which includes a set of advanced parameters and the current month.
Question: how best to describe / manage these resources within the application? Probably, for game developers, hosting or mobile operators, the topic is hackneyed and solved long ago.
It is interesting to hear the opinion of those who implemented something similar in their projects.
Difficulties arose when considering collisions. For example, I bought the TA tariff, in which the P1 parameter rises to 100. This TA is valid for 1 calendar month. But the user took it, and in two weeks bought a separate P1 upgrade to 200, for a period of 2 weeks.
Addition is possible for some parameters: i.e. for two weeks the user will have P1 = 100+200 = 300 . For some, the addition is impossible, and you need to keep P1 = 200 consistently, and after the upgrade expires, continue at the tariff level P1 = 100 . And another question is whether to extend it for 2 weeks, or to disconnect as soon as the month of the tariff’s validity passes? (To be honest, it is necessary to extend, perhaps.)
The system is growing, and there will be new “items for bargaining” and a new business logic. How is it more or less reasonable to foresee the possible complications of marketing?
While each Parameter is entered into the database, along with a description of its properties: it is added or sequential, etc. When buying, the user acquires the Product, which consists of one or more Parameters, and has a validity period. And the purchased Parameters are listed in the Table of Activations: today with a plus sign, and at the end of the action, with a minus. When several identical parameters appear for one User, their dates are adjusted.