'use strict';
/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
  Schema = mongoose.Schema;

var RelatedApplicationSchema = new Schema ({
  MOTSID: {
    type: String,
    default: '',
    trim: true
  },
  MOTSAcronym: {
    type: String,
    default: '',
    trim: true
  },
  MOTSName: {
    type: String,
    default: '',
    trim: true
  }
});

//mongoose.model('RelatedApplication', RelatedApplicationSchema);

/**
 * HostName Schema
 */
var HostNameSchema = new Schema({
  hostName_date: {
    type: Date,
    default: Date.now
  },
  user: {
    type: Schema.ObjectId,
    ref: 'User'
  },
  semaphore: {
    type: String,
    default: '',
    trim: true
  },
  name: {
    type: String,
    default: '',
    trim: true
  },
  hostType: {
    type: String,
    default: '',
    trim: true
  },
  envType: {
    type: String,
    default: '',
    trim: true
  },
  originatingSource: {
    type: String,
    default: '',
    trim: true
  },
  originatingID: {
    type: String,
    default: '',
    trim: true
  },
  note: {
    type: String,
    default: '',
    trim: true
  },
  PBB: {
    type: String,
    default: '',
    trim: true
  },
  relatedApplications: [RelatedApplicationSchema],
  address: {
    commonName: {
      type: String,
      default: '',
      trim: true,
      uppercase: true
    },
    street1: {
      type: String,
      default: '',
      trim: true,
      uppercase: true
    },
    street2: {
      type: String,
      default: '',
      trim: true,
      uppercase: true
    },
    floor: {
      type: String,
      default: '',
      trim: true
    },
    section: {
      type: String,
      default: '',
      trim: true
    },
    city: {
      type: String,
      default: '',
      trim: true,
      uppercase: true
    },
    state: {
      type: String,
      default: '',
      trim: true,
      uppercase: true
    },
    postalCode: {
      type: String,
      default: '',
      trim: true
    },
    country: {
      type: String,
      default: '',
      trim: true,
      uppercase: true
    },
    clli: {
      type: String,
      default: '',
      trim: true,
      uppercase: true
    }
  }
});

mongoose.model('HostName', HostNameSchema);

// To Be Used with host settings
/**
 * Location Schema

var LocationSchema = new Schema({    
  commonName: {
    type: String,
    default: '',
    trim: true,
    uppercase: true
  },
  stateCode: {
    type: String,
    default: '',
    trim: true,
    uppercase: true
  },
  cityCode: {
    type: String,
    default: '',
    trim: true,
    uppercase: true
  },
  locationLetter: {
    type: String,
    default: '',
    trim: true
  }
});
 **/
