       keyField      : 'uuid'
       message       : 'user subscriptions'
       forEach       : (uuid, cached, sub, stackCb)=>
-        {plan, quantity, status, datetime, expires, renew, amount} = sub
+        {plan, quantity, status, activatedAt, expiresAt, renewAt, amount} = sub
         cached.setData extend cached.getData(), {
-          userCode, plan, quantity, status, datetime, expires, renew, amount
+          userCode, plan, quantity, status, activatedAt, expiresAt, renewAt, amount
         }
         cached.lastUpdate = Date.now()
         cached.save stackCb

    JPaymentPlan.fetchPlanByCode @planCode, (err, plan) =>
      return callback err  if err
      payment.addUserCharge @userCode,
        amount: (-1 * plan.feeMonthly * percent / 100)
      , callback

  calculateRefund: (callback)->


module.exports = class JPaymentSubscription extends jraphical.Module

  {secure, dash} = require 'bongo'
  JUser    = require '../user'
  JPayment = require './index'

