eyght-models
Version:
Models for eyght
29 lines (26 loc) • 1.3 kB
JavaScript
let mongoose = require('mongoose');
mongoose.Promise = global.Promise;
let genAggrSchema = new mongoose.Schema({
sname: {type: 'String', required: true},
desc: {type: 'String'},
type: {type: mongoose.Schema.Types.ObjectId, ref: 'genAggrType'},
aggrIDDerrick: {type: 'Number'},
uniqueTxnFields: [{type: 'String'}], //what constitutes a unique txn from this aggr
uniqueChgbkFields: [{type: 'String'}], //what constitutes a unique chgbk from this aggr
uniqueResFields: [{type: 'String'}], //what constitutes a unique res from this aggr
uniqueDepFields: [{type: 'String'}], //what constitutes a unique dep from this aggr
uniqueBatchFields: [{type: 'String'}], //what constitutes a unique batch from this aggr
uniqueStmtFeeFields: [{type: 'String'}],
chgbkTxnMapFields: [{type: 'String'}], //what fields map chgbk to txn
dataFormats: {
dtFmtApiReq: {type: 'String'},
dtFmtApiResp: {type: 'String'},
country: {type: 'String'},
dtFmtScrapeReq: {type: 'String'},
dtFmtScrapeResp: {type: 'String'}
},
active: {type: 'Boolean', required: true},
inactDt: {type: 'Date'}, //store all dates in utc
inactRsnID: {type: mongoose.Schema.Types.ObjectId, ref: 'genInactRsn'}
}, {timestamps: true});
module.exports = mongoose.model('genAggr', genAggrSchema, 'genAggr');