alpha
This commit is contained in:
@@ -7,6 +7,7 @@ const ItemRequest = require("./ItemRequest");
|
||||
const ItemRequestResponse = require("./ItemRequestResponse");
|
||||
const UserAddress = require("./UserAddress");
|
||||
const ConditionCheck = require("./ConditionCheck");
|
||||
const AlphaInvitation = require("./AlphaInvitation");
|
||||
|
||||
User.hasMany(Item, { as: "ownedItems", foreignKey: "ownerId" });
|
||||
Item.belongsTo(User, { as: "owner", foreignKey: "ownerId" });
|
||||
@@ -71,6 +72,16 @@ ConditionCheck.belongsTo(User, {
|
||||
foreignKey: "submittedBy",
|
||||
});
|
||||
|
||||
// AlphaInvitation associations
|
||||
AlphaInvitation.belongsTo(User, {
|
||||
as: "user",
|
||||
foreignKey: "usedBy",
|
||||
});
|
||||
User.hasMany(AlphaInvitation, {
|
||||
as: "alphaInvitations",
|
||||
foreignKey: "usedBy",
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
sequelize,
|
||||
User,
|
||||
@@ -81,4 +92,5 @@ module.exports = {
|
||||
ItemRequestResponse,
|
||||
UserAddress,
|
||||
ConditionCheck,
|
||||
AlphaInvitation,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user