UNPKG

eyght-models

Version:

Models for eyght

50 lines (47 loc) 1.99 kB
let mongoose = require('mongoose'); mongoose.Promise = global.Promise; let arCustCCSchema = new mongoose.Schema({ custID: [{type: mongoose.Schema.Types.ObjectId, ref: 'arCust', required: true}], ccNum: {type: 'String'}, ccFirst1: {type: 'String'}, ccBin: {type: 'String'}, ccBinID: {type: mongoose.Schema.Types.ObjectId, ref: 'genCCBin'}, ccLast4: {type: 'String'}, ccExpDt: {type: 'String'}, //formatted - MM/YY ccBrandID: {type: mongoose.Schema.Types.ObjectId, ref: 'genCCBrand', required: true}, aggrInfo: [{ aggrID: {type: mongoose.Schema.Types.ObjectId, ref: 'genAggr'}, aggrBinDesc: {type: 'String'}, aggrBinCCBrand: {type: 'String'}, aggrBinCCType: {type: 'String'}, aggrBinCCLevel: {type: 'String'}, aggrBinIssBank: {type: 'String'}, aggrBinCtry: {type: 'String'} }], clientInfo: [{ clientID: {type: mongoose.Schema.Types.ObjectId, ref: 'eygClient'}, clientCustDomIntlCatID: {type: mongoose.Schema.Types.ObjectId, ref: 'genDomIntlCat'} }], declHD: { occurred: {type: 'Boolean'}, dates: [{type: 'Date'}] //store all dates in utc }, declDNH: { occurred: {type: 'Boolean'}, dates: [{type: 'Date'}] //store all dates in utc }, declFix: { occurred: {type: 'Boolean'}, dates: [{type: 'Date'}] //store all dates in utc }, declSD: { occurred: {type: 'Boolean'}, dates: [{type: 'Date'}] //store all dates in utc }, // vault_id: {type: mongoose.Schema.Types.ObjectId, ref: ''}, these we will need to add in later when we know where they go and we are vaulting cc's // token_id: {type: mongoose.Schema.Types.ObjectId, ref: ''}, these we will need to add in later when we know where they go and we are vaulting cc's 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('arCustCC', arCustCCSchema, 'arCustCC');