Knowledge Base
Points System Module::Item no. 2
Points System Module  

Developers' Notes

Developers' Notes

New C flow rule

if you recall, C is for cash value, P is for points value,
this time, F rule is for fields value. it is used to add
or subtract the value of the field with a new value.
currently works only on NUMERIC and TIMESTAMP
fields, but enhancements will be added later.

example
FUID=TSTEST,2592000

FUID means we are altering the field of the input UID
TSTEST,2592000 means, we are altering the field TSTEST
and 2592000 is the value.  Since TSTEST is a timestamp
field, 2592000 is interpreted as seconds to add to the
existing or current value of the field. 2592000 is 60*60*24*30
or 30 days.

If the field is originally blank, the value will be added to
01/01/1970 08:00:00 which is the beginning of time for
UNIX.  It is then wise to use the following rule :

{seqTSTEST=}FUID=TSTEST,now

it is interpreted as follows:
{seqTSTEST=} is a precondition, we treated TSTEST field
as a string field instead of a timestamp field. and we tested
it if the field is blank or null. If the condition matches it will execute
FUID=TSTEST,now which means we are setting the field TSTEST
to 'now' or the current date and time as of its execution.

Also, note that for timestamp type fields, positive value means
we are adding time, while negative value will subtract time.

FUID=TSTEST,-86400 means we are subtracting 1 day from the
field TSTEST.