     indexes       :
       username    : 'unique'
       approved    : 'unique'
+    sharedMethods :
+      static      :
+        create    : (signature Object, Function)
     schema        :
       username    :
         type      : String

{Model} = require 'bongo'

module.exports = class JWFGH extends Model

  CAP       = 50000
  PRIZE     = 10000
  DEADLINE  = new Date 1418626800000 # Mon, 15 Dec 2014 00:00:00 PDT

  {signature, secure} = require 'bongo'
  @share()


  @getStats = (account, callback) ->

    JCampaign.get 'WFGH', (err, campaign) ->

      return callback message : 'expired'  if err or not campaign

      username = account?.profile?.nickname

      {cap, prize, deadline} = campaign

      cap      ?= 50000
      prize    ?= 10000
      deadline ?= new Date 1418626800000 # Mon, 15 Dec 2014 00:00:00 PDT

      unless username

        callback null, {
          totalApplicants    : 0
          approvedApplicants : 0
          isApplicant        : no
          deadline
          prize
          cap
        }

      JWFGH.one {username}, (err, applied)->

        return callback err  if err

        isApplicant = applied?
        isApproved  = applied?.approved
        isWinner    = applied?.winner

        JWFGH.count {}, (err, totalApplicants)->

          return callback err  if err

          JWFGH.count approved : yes, (err, approvedApplicants)->

            return callback err  if err

            callback err, {
              cap      : CAP
              prize    : PRIZE
              deadline : DEADLINE
              totalApplicants, approvedApplicants
              isApplicant, isApproved, isWinner
            }