I sell leads and buy my clients like this: (Only one type of payment from the following can be charged per client)
Pay Per Lead:
$ __ for the first __ potential customers per month
$ __ for the next __ potential customers per month
$ __ for the next __ potential customers per month
and so on ...
Appointment fee:
$ __ for the first __ potential customers per month
$ __ for the next __ potential customers per month
$ __ for the next __ potential customers per month
and so on ...
Sale Percentage Fee:
__% of the sale price (per sale)
My question is:
What are the best possible solutions for database design in such cases?
What I tried:
+---------+
| clients |
+---------+
| id |
| name |
+---------+
+---------------+
| deals |
+---------------+
| client_id |
| max_quantity |
| cost |
| unit_type |
+---------------+
Thus, records for client id1 may look like this:
+-----------+--------------+---------------+-------------+
| client_id | max_quantity | cost_per_unit | unit_type |
+-----------+--------------+---------------+-------------+
| 1 | 10 | 10 | lead |
| 1 | 30 | 5 | lead |
| 1 | 100 | 2 | lead |
| 1 | 10 | 35 | appointment |
| 1 | 30 | 20 | appointment |
| 1 | 100 | 10 | appointment |
| 1 | 1000 | 5 | appointment |
| 1 | 0 | 50 | sale |
+-----------+--------------+---------------+-------------+
Now, the above table means that:
$10will be charged for leadbefore 10leads
$5will be charged for leadbefore 30leads
$2will be charged for leadbefore 100leads
$35will be charged for appointmentbefore 10leads
$20will be charged for appointmentbefore 30leads
$10will be charged for appointmentbefore 100leads
$5will be charged for appointmentbefore 1000leads
$50 will charge for sale
x ( , , )
, - . , ! .
P.S. , unit_type , :)
Update
, ?