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

/**
 * Statement Schema
 */
var StatementSchema = new Schema({
  statement_ID: {
    type: String,
    default: '',
    trim: true
  },
  statement_text: {
    type: String,
    default: '',
    trim: true
  },
  date_start_string: {
    type: String,
    default: '',
    trim: true
  },
  date_end_string: {
    type: String,
    default: '',
    trim: true
  },
  response_type: {
    type: String,
    default: '',
    trim: true
  }
});
mongoose.model('Statement', StatementSchema);

/**
 * Attestment Schema
 */
var AttestmentSchema = new Schema({
  attestment_date: {
    type: Date,
    default: Date.now
  },
  user: {
    type: Schema.ObjectId,
    ref: 'User'
  },
  consumer_ID: {
    type: String,
    default: '',
    trim: true
  },
  consumer_description: {
    type: String,
    default: '',
    trim: true
  },
  page_ID: {
    type: String,
    default: '',
    trim: true
  },
  page_description: {
    type: String,
    default: '',
    trim: true
  },
  statements: [StatementSchema]
});

mongoose.model('Attestment', AttestmentSchema);

