adding charges table and starting the endpoint for charging for a grant

This commit is contained in:
Arjun Patel
2019-01-29 10:32:21 -08:00
parent 6ca8807a9b
commit e3b7a1699e
13 changed files with 148 additions and 9 deletions
+9 -1
View File
@@ -1,5 +1,5 @@
module.exports = models => {
const { Donor, Grant, Cause, Region, Organization } = models;
const { Donor, Grant, Cause, Region, Organization, Charge } = models;
Donor.hasMany(Grant, { foreignKey: 'donor_id' });
@@ -20,4 +20,12 @@ module.exports = models => {
foreignKey: 'grant_id',
otherKey: 'organization_id'
});
Donor.hasMany(Charge, {
foreignKey: 'user_id'
});
Organization.hasMany(Charge, {
foreignKey: 'user_id'
});
};