1

Topic: Structure of tables for auxiliary aggregation

I think over implementation of the agency program.
Its conditions:
- The agent receives % from connection cost
- The agent receives % from a client license fee for services
- The license fee can be different (, monthly, annual)
- At different types of service the different interest rate
- In some cases clients can use in a minus ("the Promised payment", the letter of guarantee etc.), however for clients with the negative balance agency reward is not calculated
- At the agent should be not less than 3 active clients for program action
- Payment to the agent is produced once a month
services of clients the system conducts , all charges for services in it are registered.
However the table of charges very big and its direct usage in requests at me it is impossible to make effective (fast).
Therefore I think to launch a script of times a day (a minimum rated period of a license fee - days) and to accumulate the license fee calculated for days in approximately such table:
[CSV =;] the Field; Type; the Description
client_id; number; the Identifier of the client
pediod; date; the Rated period of payments of the agent (1st date)
day; date; Date to which the license fee is calculated
type; number; service Type on which the interest rate is defined
sum_all; number; the Total sum of the calculated license fee from period on day
sum_clear; number; the license fee Total on clients with the positive balance
By means of such table I define charges for the rated period on each client and each type of services and on their basis I can calculate the total of reward to the agent.
Do not advise, how such tasks normally dare?

2

Re: Structure of tables for auxiliary aggregation

Alibek B. wrote:

do not advise, how such tasks normally dare?

it is normal not in this forum.

3

Re: Structure of tables for auxiliary aggregation

Yes, overshot.
The request to moderators to transfer to appropriate section.

4

Re: Structure of tables for auxiliary aggregation

Alibek B.;
I would be repelled from the agent
_
The period

.....
stax

5

Re: Structure of tables for auxiliary aggregation

If at me it will be simple the total  for the period in a section of clients and types of services, I can consider agency charges somehow.
If I consider at once the total of agency charges on different agency circuits (with different conditions and types of services) it will be necessary to do separate calculations.
Actually at me also it is planned that will be two agency programs with different conditions (the different list of services on which there is a charge, different rates), therefore I would like to do auxiliary aggregation by general-purpose.

6

Re: Structure of tables for auxiliary aggregation

If billing commercial that re-read the documentation - normally such things are provided  billing.
If  - that to solve to the architect.
For example, charge of agency reward can be implemented as a part of process of charge to the subscriber is if billing professes  model.

7

Re: Structure of tables for auxiliary aggregation

In billing there are agency circuits, but simple enough, such requirements are not able. And finishing aloud the expensive.