agrs-sequelize-sdk 1.1.37 → 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.
@@ -62,6 +62,10 @@ module.exports = (sequelize, DataTypes) => {
62
62
  type: DataTypes.BOOLEAN,
63
63
  allowNull: true,
64
64
  },
65
+ disabled_reason: {
66
+ type: DataTypes.STRING,
67
+ allowNull: true,
68
+ },
65
69
  },
66
70
  {
67
71
  tableName: "AdAccount",
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agrs-sequelize-sdk",
3
- "version": "1.1.37",
3
+ "version": "1.1.38",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "start": "node index.js",