@aurispec/core-backend 1.0.86 → 1.0.87

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.
@@ -1,6 +1,7 @@
1
1
  import { BaseModel } from "./BaseModel";
2
2
  import { AccountType } from "../common/enums";
3
3
  import { AdminUserModel } from "./AdminUserModel";
4
+ import { NotificationModel } from "./NotificationModel";
4
5
  export declare class BroadcastModel extends BaseModel {
5
6
  account_type: AccountType;
6
7
  title: string;
@@ -9,5 +10,6 @@ export declare class BroadcastModel extends BaseModel {
9
10
  total_read: number;
10
11
  admin_id: number;
11
12
  admin: AdminUserModel;
13
+ notifications?: NotificationModel[];
12
14
  }
13
15
  //# sourceMappingURL=BroadcastModel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BroadcastModel.d.ts","sourceRoot":"","sources":["../../src/models/BroadcastModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBACa,cAAe,SAAQ,SAAS;IAKzC,YAAY,EAAG,WAAW,CAAC;IAG3B,KAAK,EAAG,MAAM,CAAC;IAGf,OAAO,EAAG,MAAM,CAAC;IAGjB,cAAc,EAAG,MAAM,CAAC;IAGxB,UAAU,EAAG,MAAM,CAAC;IAGpB,QAAQ,EAAG,MAAM,CAAC;IAIlB,KAAK,EAAG,cAAc,CAAC;CAC1B"}
1
+ {"version":3,"file":"BroadcastModel.d.ts","sourceRoot":"","sources":["../../src/models/BroadcastModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,qBACa,cAAe,SAAQ,SAAS;IAKzC,YAAY,EAAG,WAAW,CAAC;IAG3B,KAAK,EAAG,MAAM,CAAC;IAGf,OAAO,EAAG,MAAM,CAAC;IAGjB,cAAc,EAAG,MAAM,CAAC;IAGxB,UAAU,EAAG,MAAM,CAAC;IAGpB,QAAQ,EAAG,MAAM,CAAC;IAIlB,KAAK,EAAG,cAAc,CAAC;IAUvB,aAAa,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACvC"}
@@ -14,6 +14,7 @@ const typeorm_1 = require("typeorm");
14
14
  const BaseModel_1 = require("./BaseModel");
15
15
  const enums_1 = require("../common/enums");
16
16
  const AdminUserModel_1 = require("./AdminUserModel");
17
+ const NotificationModel_1 = require("./NotificationModel");
17
18
  let BroadcastModel = class BroadcastModel extends BaseModel_1.BaseModel {
18
19
  account_type;
19
20
  title;
@@ -22,6 +23,7 @@ let BroadcastModel = class BroadcastModel extends BaseModel_1.BaseModel {
22
23
  total_read;
23
24
  admin_id;
24
25
  admin;
26
+ notifications;
25
27
  };
26
28
  exports.BroadcastModel = BroadcastModel;
27
29
  __decorate([
@@ -56,6 +58,13 @@ __decorate([
56
58
  (0, typeorm_1.JoinColumn)({ name: "admin_id", referencedColumnName: "id" }),
57
59
  __metadata("design:type", AdminUserModel_1.AdminUserModel)
58
60
  ], BroadcastModel.prototype, "admin", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.OneToMany)(() => NotificationModel_1.NotificationModel, (notification) => notification.broadcast, {
63
+ onDelete: "SET NULL",
64
+ onUpdate: "CASCADE",
65
+ }),
66
+ __metadata("design:type", Array)
67
+ ], BroadcastModel.prototype, "notifications", void 0);
59
68
  exports.BroadcastModel = BroadcastModel = __decorate([
60
69
  (0, typeorm_1.Entity)('broadcasts')
61
70
  ], BroadcastModel);
@@ -2,6 +2,7 @@ import { UserModel } from "./UserModel";
2
2
  import { BaseModel } from "./BaseModel";
3
3
  import { NotificationType } from "../common/enums/NotificationEnum";
4
4
  import { SYS_MODELS } from "../common/enums";
5
+ import { BroadcastModel } from "./BroadcastModel";
5
6
  export declare class NotificationModel extends BaseModel {
6
7
  user_id: number;
7
8
  user: UserModel;
@@ -13,5 +14,7 @@ export declare class NotificationModel extends BaseModel {
13
14
  message: string;
14
15
  read: boolean;
15
16
  is_broadcast: boolean;
17
+ broadcast_id?: number;
18
+ broadcast?: BroadcastModel;
16
19
  }
17
20
  //# sourceMappingURL=NotificationModel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationModel.d.ts","sourceRoot":"","sources":["../../src/models/NotificationModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,qBACa,iBAAkB,SAAQ,SAAS;IAE5C,OAAO,EAAG,MAAM,CAAC;IAIjB,IAAI,EAAG,SAAS,CAAC;IAMjB,GAAG,EAAG,gBAAgB,CAAC;IAGvB,aAAa,EAAG,MAAM,CAAC;IAGvB,KAAK,EAAG,MAAM,CAAC;IAGf,QAAQ,CAAC,EAAE,GAAG,CAAC;IAOf,eAAe,EAAG,UAAU,CAAC;IAG7B,OAAO,EAAG,MAAM,CAAC;IAGjB,IAAI,EAAG,OAAO,CAAC;IAGf,YAAY,EAAG,OAAO,CAAC;CAC1B"}
1
+ {"version":3,"file":"NotificationModel.d.ts","sourceRoot":"","sources":["../../src/models/NotificationModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBACa,iBAAkB,SAAQ,SAAS;IAE5C,OAAO,EAAG,MAAM,CAAC;IAIjB,IAAI,EAAG,SAAS,CAAC;IAMjB,GAAG,EAAG,gBAAgB,CAAC;IAGvB,aAAa,EAAG,MAAM,CAAC;IAGvB,KAAK,EAAG,MAAM,CAAC;IAGf,QAAQ,CAAC,EAAE,GAAG,CAAC;IAOf,eAAe,EAAG,UAAU,CAAC;IAG7B,OAAO,EAAG,MAAM,CAAC;IAGjB,IAAI,EAAG,OAAO,CAAC;IAGf,YAAY,EAAG,OAAO,CAAC;IAGvB,YAAY,CAAC,EAAE,MAAM,CAAC;IAItB,SAAS,CAAC,EAAE,cAAc,CAAC;CAC9B"}
@@ -15,6 +15,7 @@ const UserModel_1 = require("./UserModel");
15
15
  const BaseModel_1 = require("./BaseModel");
16
16
  const NotificationEnum_1 = require("../common/enums/NotificationEnum");
17
17
  const enums_1 = require("../common/enums");
18
+ const BroadcastModel_1 = require("./BroadcastModel");
18
19
  let NotificationModel = class NotificationModel extends BaseModel_1.BaseModel {
19
20
  user_id;
20
21
  user;
@@ -26,6 +27,8 @@ let NotificationModel = class NotificationModel extends BaseModel_1.BaseModel {
26
27
  message;
27
28
  read;
28
29
  is_broadcast;
30
+ broadcast_id;
31
+ broadcast;
29
32
  };
30
33
  exports.NotificationModel = NotificationModel;
31
34
  __decorate([
@@ -76,6 +79,15 @@ __decorate([
76
79
  (0, typeorm_1.Column)({ default: false }),
77
80
  __metadata("design:type", Boolean)
78
81
  ], NotificationModel.prototype, "is_broadcast", void 0);
82
+ __decorate([
83
+ (0, typeorm_1.Column)({ nullable: true }),
84
+ __metadata("design:type", Number)
85
+ ], NotificationModel.prototype, "broadcast_id", void 0);
86
+ __decorate([
87
+ (0, typeorm_1.ManyToOne)(() => BroadcastModel_1.BroadcastModel, (broadcast) => broadcast.notifications),
88
+ (0, typeorm_1.JoinColumn)({ name: "broadcast_id", referencedColumnName: "id" }),
89
+ __metadata("design:type", BroadcastModel_1.BroadcastModel)
90
+ ], NotificationModel.prototype, "broadcast", void 0);
79
91
  exports.NotificationModel = NotificationModel = __decorate([
80
92
  (0, typeorm_1.Entity)('notifications')
81
93
  ], NotificationModel);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurispec/core-backend",
3
- "version": "1.0.86",
3
+ "version": "1.0.87",
4
4
  "description": "Auri spectrum's backend core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",