Skip to content

Instantly share code, notes, and snippets.

@turntayble81
Created December 21, 2016 16:12
Show Gist options
  • Save turntayble81/bfd2e784191a6737943cc8931117083a to your computer and use it in GitHub Desktop.
Save turntayble81/bfd2e784191a6737943cc8931117083a to your computer and use it in GitHub Desktop.
var schema = {
'bankLogins': {
dynamodbTable : 'loans',
primaryKey : ['loanId', 'recordId'],
indexes: {
loanId : {
column : 'loanId'
},
loanId : {
column : 'recordId'
}
},
children: {
bankAccounts: {
foreignKeyReference : ['loanId', 'recordId'],
foreignKey : ['loanId', 'recordId'],
docRoot : '_documentData',
recordType : 'array'
}
},
columns: {
loanId: {
mapField : 'loanId',
type : 'VARCHAR(255)'
},
clientId: {
mapField : 'clientId',
type : 'VARCHAR(255)'
},
loginId: {
mapField : '_document.recordId',
type : 'VARCHAR(255)'
}
}
},
'bankAccounts': {
primaryKey : ['loanId', 'recordId', 'accountNumberFound'],
indexes: {
loanId : {
column : 'loanId'
},
loanId : {
column : 'recordId'
}
},
children: {
bankTransactions: {
foreignKeyReference : ['loanId', 'recordId'],
foreignKey : ['loanId', 'recordId'],
docRoot : '_documentData.ficoScore',
recordType : 'array'
}
},
columns: {
loanId: {
mapField : 'loanId',
type : 'VARCHAR(255)'
},
clientId: {
mapField : 'clientId',
type : 'VARCHAR(255)'
},
loginId: {
mapField : '_document.recordId',
type : 'VARCHAR(255)'
},
accountNumberFound: {
mapField : '_documentData.AccountNumberFound',
type : 'VARCHAR(255)'
},
routingNumberFound: {
mapField : '_documentData.RoutingNumberFound',
type : 'VARCHAR(255)'
}
}
},
'bankTransactions': {
dynamodbTable : 'loans',
primaryKey : ['loanId', 'recordId'],
indexes: {
loanId : {
column : 'loanId'
},
loanId : {
column : 'recordId'
}
},
children: {
bankAccounts: {
foreignKeyReference : ['loanId', 'recordId'],
foreignKey : ['loanId', 'recordId'],
docRoot : 'transactions',
recordType : 'array'
}
},
columns: {
loanId: {
mapField : 'loanId',
type : 'VARCHAR(255)'
},
clientId: {
mapField : 'clientId',
type : 'VARCHAR(255)'
},
loginId: {
mapField : '_document.recordId',
type : 'VARCHAR(255)'
}
}
}
};
module.exports = schema;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment