orbitx-core-models 11.149.0 → 11.151.0

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.
@@ -13,7 +13,7 @@ export type UpdateDashboard = "ops" | "client" | "partner";
13
13
  * "broadcast" -- everyone on the given dashboard (an announcement with no specific target).
14
14
  */
15
15
  export type UpdateAudience = "user" | "company" | "partner" | "broadcast";
16
- export type UpdateType = "ticket_assigned" | "ticket_message" | "request_assigned" | "request_message" | "announcement" | "wallet_event" | "new_referral" | "review_status" | "billing_event";
16
+ export type UpdateType = "ticket_assigned" | "ticket_message" | "ticket_mentioned" | "request_assigned" | "request_message" | "announcement" | "wallet_event" | "new_referral" | "review_status" | "billing_event";
17
17
  export interface IUpdate extends Document {
18
18
  dashboard: UpdateDashboard;
19
19
  audience: UpdateAudience;
@@ -28,6 +28,14 @@ export interface IUpdate extends Document {
28
28
  body?: string;
29
29
  /** Frontend route to open when the update is clicked, e.g. "/tickets/view/<id>". */
30
30
  link?: string;
31
+ /** Which account this update is ABOUT -- distinct from companyId/partnerId above, which say
32
+ * who it's FOR. Mainly populated on Ops's own "user"-audience rows (a ticket/request
33
+ * assignment), where the target is one ops agent but the update is about one specific
34
+ * client/partner account. Phase 30's "Group busy items" (more than 3 same-day, same-type
35
+ * updates about one account collapse into one row) is the reason this exists -- nothing else
36
+ * on a "user"-audience row otherwise says which account it's about. */
37
+ relatedOwnerId?: Types.ObjectId;
38
+ relatedOwnerType?: "Company" | "Partner";
31
39
  /** Who triggered it -- the assigning agent, the announcement's author, etc. Absent for
32
40
  * system-generated updates with no single human cause. */
33
41
  createdBy?: Types.ObjectId;
@@ -1 +1 @@
1
- {"version":3,"file":"update.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/update.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK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D/C,eAAO,MAAM,MAAM;;;;OAAkD,CAAC;AACtE,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"update.model.d.ts","sourceRoot":"","sources":["../../src/models/update.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAEzD;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,uBAAqB,CAAC;AAgE/C,eAAO,MAAM,MAAM;;;;OAAkD,CAAC;AACtE,eAAe,MAAM,CAAC"}
@@ -66,6 +66,7 @@ const updateSchema = new mongoose_1.Schema({
66
66
  enum: [
67
67
  "ticket_assigned",
68
68
  "ticket_message",
69
+ "ticket_mentioned",
69
70
  "request_assigned",
70
71
  "request_message",
71
72
  "announcement",
@@ -80,6 +81,11 @@ const updateSchema = new mongoose_1.Schema({
80
81
  title: { type: String, required: true, trim: true, maxlength: 200 },
81
82
  body: { type: String, trim: true, maxlength: 2000 },
82
83
  link: { type: String, trim: true, maxlength: 300 },
84
+ // Phase 30's "Group busy items" -- which account this update is ABOUT, not who it's for (see
85
+ // the interface's own doc comment). No `ref` here since it's polymorphic by relatedOwnerType;
86
+ // callers that need the doc populated do it manually against Company/Partner.
87
+ relatedOwnerId: { type: mongoose_1.Schema.Types.ObjectId, index: true },
88
+ relatedOwnerType: { type: String, enum: ["Company", "Partner"] },
83
89
  createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
84
90
  readBy: { type: [mongoose_1.Schema.Types.ObjectId], ref: "User", default: [] },
85
91
  }, { timestamps: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orbitx-core-models",
3
- "version": "11.149.0",
3
+ "version": "11.151.0",
4
4
  "description": "Shared Mongoose models and interfaces for OrbitX services",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",