   debit$: permit 'commission resources',
     success: (client, debits, callback)->
       JVM = require '../vm'
-      JVM.fetchUsage client.connection.delegate, client.context.group, (err, usage)=>
+      {connection:{delegate}, context:{group}} = client
+      JVM.calculateUsage delegate, group, (err, usage)=>
         return callback err  if err?
 
         # TODO: we need to do some number-crunching with the usage stats

        ]
        default       : 'not allowed'

  @fetchPlans = permit 'commission resources',
    success: (client, callback) ->
      (require 'koding-payment').getPlans callback

  fetchLimits$: permit 'change bundle',
    success: (client, callback)-> @fetchLimits callback

module.exports = class JGroupBundle extends JBundle

  {permit} = require '../group/permissionset'

  {groupBy} = require 'underscore'

  @share()

