agrs-sequelize-sdk 1.1.36 → 1.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/models/AdAccount.js +8 -0
- package/models/Pages.js +4 -0
- package/models/Users.js +27 -0
- package/package.json +1 -1
package/models/AdAccount.js
CHANGED
|
@@ -58,6 +58,14 @@ module.exports = (sequelize, DataTypes) => {
|
|
|
58
58
|
allowNull: false,
|
|
59
59
|
defaultValue: [], // Default value is an empty array
|
|
60
60
|
},
|
|
61
|
+
Archived: {
|
|
62
|
+
type: DataTypes.BOOLEAN,
|
|
63
|
+
allowNull: true,
|
|
64
|
+
},
|
|
65
|
+
disabled_reason: {
|
|
66
|
+
type: DataTypes.STRING,
|
|
67
|
+
allowNull: true,
|
|
68
|
+
},
|
|
61
69
|
},
|
|
62
70
|
{
|
|
63
71
|
tableName: "AdAccount",
|
package/models/Pages.js
CHANGED
package/models/Users.js
CHANGED
|
@@ -75,11 +75,38 @@ module.exports = (sequelize, DataTypes) => {
|
|
|
75
75
|
type: DataTypes.STRING, // Array of organization IDs
|
|
76
76
|
allowNull: true,
|
|
77
77
|
},
|
|
78
|
+
access_all_files: {
|
|
79
|
+
type: DataTypes.BOOLEAN,
|
|
80
|
+
allowNull: true,
|
|
81
|
+
},
|
|
82
|
+
managed_by: {
|
|
83
|
+
type: DataTypes.UUID, // A UUID to store the ID of the user who manages this user
|
|
84
|
+
allowNull: true,
|
|
85
|
+
references: {
|
|
86
|
+
model: 'Users',
|
|
87
|
+
key: 'id',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
78
90
|
},
|
|
79
91
|
{
|
|
80
92
|
tableName: "Users",
|
|
81
93
|
}
|
|
82
94
|
);
|
|
83
95
|
|
|
96
|
+
// Define associations for managed_by relationship
|
|
97
|
+
Users.associate = (models) => {
|
|
98
|
+
// A user can manage many users
|
|
99
|
+
Users.hasMany(models.Users, {
|
|
100
|
+
foreignKey: 'managed_by',
|
|
101
|
+
as: 'managedUsers',
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// A user can only be managed by one user
|
|
105
|
+
Users.belongsTo(models.Users, {
|
|
106
|
+
foreignKey: 'managed_by',
|
|
107
|
+
as: 'manager',
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
|
|
84
111
|
return Users;
|
|
85
112
|
};
|