orbitx-core-models 11.149.0 → 11.150.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.
@@ -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,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE3D;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CAAC;AAE1E,MAAM,MAAM,UAAU,GAClB,iBAAiB,GACjB,gBAAgB,GAChB,kBAAkB,GAClB,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,cAAc,GACd,eAAe,GAIf,eAAe,CAAC;AAEpB,MAAM,WAAW,OAAQ,SAAQ,QAAQ;IACvC,SAAS,EAAE,eAAe,CAAC;IAC3B,QAAQ,EAAE,cAAc,CAAC;IACzB,sEAAsE;IACtE,MAAM,CAAC,EA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E,SAAS,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;2EAKuE;IACvE,cAAc,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAChC,gBAAgB,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACzC;8DAC0D;IAC1D,SAAS,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC3B;0FACsF;IACtF,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
@@ -1 +1 @@
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;AA0D/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;AA+D/C,eAAO,MAAM,MAAM;;;;OAAkD,CAAC;AACtE,eAAe,MAAM,CAAC"}
@@ -80,6 +80,11 @@ const updateSchema = new mongoose_1.Schema({
80
80
  title: { type: String, required: true, trim: true, maxlength: 200 },
81
81
  body: { type: String, trim: true, maxlength: 2000 },
82
82
  link: { type: String, trim: true, maxlength: 300 },
83
+ // Phase 30's "Group busy items" -- which account this update is ABOUT, not who it's for (see
84
+ // the interface's own doc comment). No `ref` here since it's polymorphic by relatedOwnerType;
85
+ // callers that need the doc populated do it manually against Company/Partner.
86
+ relatedOwnerId: { type: mongoose_1.Schema.Types.ObjectId, index: true },
87
+ relatedOwnerType: { type: String, enum: ["Company", "Partner"] },
83
88
  createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
84
89
  readBy: { type: [mongoose_1.Schema.Types.ObjectId], ref: "User", default: [] },
85
90
  }, { 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.150.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",