adding charges table and starting the endpoint for charging for a grant
This commit is contained in:
@@ -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'
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user