Mapper = require("../Mapper.js").mapper

class BedsMapper extends Mapper

  constructor: ->
    @identifier = "beds"

  schema: (method, action, endpoint, fun, args) ->
    switch fun.toLowerCase()
      when "byorganization"
        @map(["Organization.Id"], args) # one argument, organization id

  applySchema: (method, action, endpoint, fun, schema) ->
    switch fun.toLowerCase()
      when "byorganization"
        @unmap(schema)
      else
        winston.warn "no such fun", fun

exports.mapper = new BedsMapper()
