vr-models 1.0.53 → 1.0.54

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.
@@ -119,6 +119,12 @@ class User extends vr_migrations_1.Model {
119
119
  onDelete: "SET NULL",
120
120
  onUpdate: "CASCADE",
121
121
  });
122
+ this.hasMany(models.DevicePaymentPlan, {
123
+ foreignKey: "userId",
124
+ as: "paymentPlans",
125
+ onDelete: "CASCADE", // ← This is SET NULL, not CASCADE
126
+ onUpdate: "CASCADE",
127
+ });
122
128
  this.hasMany(models.Payment, {
123
129
  foreignKey: "userId",
124
130
  as: "payments",
@@ -154,6 +160,7 @@ class User extends vr_migrations_1.Model {
154
160
  }
155
161
  async deactivate() {
156
162
  this.isDeactivated = true;
163
+ this.isActive = false;
157
164
  this.deactivatedAt = new Date();
158
165
  await this.save();
159
166
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vr-models",
3
- "version": "1.0.53",
3
+ "version": "1.0.54",
4
4
  "description": "Shared database models package for VR applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",