# All files / src/model clients.coffee

100% Statements 6/6
100% Branches 0/0
100% Functions 0/0
100% Lines 6/6

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    241x
    1x
    1x
    1x

    1x

    1x
     mongoose = require "mongoose"
    server = require "../server"
    connectionDefault = server.connectionDefault
    Schema = mongoose.Schema

    ClientSchema = new Schema
      "clientID":           type: String, required: true, unique: true, index: true
      "clientDomain":       type: String, unqiue: true, index: true
      "name":               type: String, required: true
      "roles":              [type: String, required: true]
      "passwordAlgorithm":  String
      "passwordHash":       String
      "passwordSalt":       String
      "certFingerprint":    String
      "organization":       String
      "location":           String
      "softwareName":       String
      "description":        String
      "contactPerson":      String
      "contactPersonEmail": String

    #compile the Client Schema into a Model
    exports.Client = connectionDefault.model 'Client', ClientSchema