 FactoryGirl  = require 'factory_girl'
 faker        = require 'faker'
 indentString = require 'indent-string'
+async        = require 'async'
 
 FactoryGirl.define 'user', ->
   @id = Math.random() * 101|0

  "# #{faker.name.findName()}\n"

createGroup = (size) ->
  "# Group #{faker.internet.userName()}\n"

createEndpoint = ->
  "## #{faker.address.country()} [/#{faker.internet.userName().toLowerCase()}]\n"


createResponse = (code = 200, method = 'GET') ->
  """
  ### #{faker.internet.domainWord()} [#{method}]
  + Response #{code} (application/json)

  #{createBody()}

  """

createBody = ->
  string = JSON.stringify faker.helpers.createCard(), ' ', 2
  indentString string, ' ', 8


createBlueprint = ->
  """
  #{createMeta()}
  #{createApiName()}
  #{createGroup()}
  #{createEndpoint()}
  #{createResponse()}
  """

module.exports = createBlueprint


user = FactoryGirl.create 'user'

debug = false

randomIntInc = (low, high) ->
  Math.floor(Math.random() * (high - low + 1) + low)

createMeta = ->
  "FORMAT: 1A\n"

