Please enable JavaScript.
Coggle requires JavaScript to display documents.
customer loyalty (API (scoring.php (config file, can contain customer and…
customer loyalty
API
- customers table new columns
-
- total_turnover => sum of delivered order prices
-
-
- tier_turnover => sum of delivered order prices where date(o.delivered_at) >= tiered_at
-
-
-
-
- reason ( for the moment always is delivered_order )
-
-
-
-
-
- redeems table ( we can postpone it if we ignore customer_scores.foreign_key_redeem_id )
-
-
-
-
-
-
-
-
- score calculation in order price calc route
- based on price, each 100$ => 1 score, read config from scoring.php
- also consider other factors from scoring.php
"- on order delivered events get the total_turnover and tier_turnover of customer and
update the record of customer regarding turnover columns by new turnover values"
- also later we will do the same on order cancel / delete / uncancel / ... for more accuracy on above values
- on each turnover update also, we have to read tiering.php config, which includes simply
turnover
=> tier
entries
so we can then find out if the latest turnover of customer reached one of those values or not, if reached so,
update customer record regarding its tier columns by new tier values, which are tier
, tiered_at
, tiered_till
-
- config file, can contain customer and courier indexes,
so courier scoring config can be moved here from general alopeyk.php file,
-
- we can have redeeming.php for redeem factors configuration, but we can ignore it too for the moment as well as redeem module
- in scoring.php, we will have factors for score calculations, for example we will have
customer
key,
under which, we have delivered_order
key, under which, we have
price_based
key, under which, there is per
key, under which,
there is 100
=> 1, by these keys and values we can
calculate the delivered order score for the customer, this is a simple example, but in development,
the developer may need more complicated chain of keys and values due to provide more calculation factors
an example of above extra keys, can be a affected_by
key beside per
, under which, there is
transport_type
=> 0.03, this value will be added to 100
=> 1, and will result, 1.03
,
tier
=> [ blue
=> 0, borenz
=> 0.25, silver
=> 0.75, gold
=> 3 ],
this value will be added to 100
=> 1, and will result, 1.25
for blue tier for example
also the score may be increased, either decreased, based on our values, but the basic value is always 1
- this config file is supposed to provide a formatted text output for CustomerApp
-
the plan for this file is not ready yet, and must be worked on once the final design of app is ready
-
-
-
-
-
-
-
-
-
- stock ( 0 means unlimited )
-
-
-
-
-
-