Quote Originally Posted by swguy View Post
The way I would effect a sunrise program is using the log; the log (rather than the reward_customer_points table) would be the medium for determining the current customer balance. The default would be simply to get all log records for that customer older than (say) 30 days. I wouldn't write a log record until the order had moved to (say) processing state, which could obviously be delayed for some payment methods; alternately, the log could store a state for each row, which would be something other than "available" for points accumulated by a transaction which hasn't settled.
I've created a reward_points_audit table which tracks customer and order ID, reward points, date added and a status. The status can be 'pending', 'processed', 'cancelled' or 'redeemed'. A change to the status will update the customer reward points record which I am going to keep in order to keep the number of MySQL transactions/load down when just doing things like displaying the current total.

I've just got to write the Admin side of the audit trail and then I'll put it up for download.