eyght-models
Version:
Models for eyght
21 lines (17 loc) • 597 B
JavaScript
let mongoose = require('mongoose');
mongoose.Promise = global.Promise;
let genExchRtSchema = new mongoose.Schema({
date: {type: 'Date'}, //store all dates in utc
curr1: {type: 'String'},
curr2: {type: 'String'},
exchRt: {type: 'Number'},
active: {type: 'Boolean', required: true},
inactDt: {type: 'Date'}, //store all dates in utc
inactRsnID: {type: mongoose.Schema.Types.ObjectId, ref: 'genInactRsn'}
}, {timestamps: true});
genExchRtSchema.index({
date: 1,
curr1: 1,
curr2: 1
}, {unique: true});
module.exports = mongoose.model('genExchRt', genExchRtSchema, 'genExchRt');