orbitx-core-models 11.166.0 → 11.167.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.
@@ -1 +1 @@
1
- {"version":3,"file":"chat.model.d.ts","sourceRoot":"","sources":["../../src/models/chat.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AA+RrD,eAAO,MAAM,IAAI;;;;OAA4C,CAAC"}
1
+ {"version":3,"file":"chat.model.d.ts","sourceRoot":"","sources":["../../src/models/chat.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAgSrD,eAAO,MAAM,IAAI;;;;OAA4C,CAAC"}
@@ -282,4 +282,5 @@ chatSchema.index({ currentOwnerId: 1, status: 1 });
282
282
  chatSchema.index({ groupId: 1, status: 1 });
283
283
  chatSchema.index({ "participants.userId": 1 });
284
284
  chatSchema.index({ smsPhoneNumber: 1, companyId: 1, activeChannel: 1 }); // SMS bridge lookup
285
+ chatSchema.index({ createdAt: 1 }); // Ops-wide date ranges (Dashboard analytics across every company)
285
286
  exports.Chat = mongoose_1.default.model("Chat", chatSchema);
@@ -1 +1 @@
1
- {"version":3,"file":"companySettings.model.d.ts","sourceRoot":"","sources":["../../src/models/companySettings.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAA2B,MAAM,UAAU,CAAC;AACnD,OAAO,EACL,gBAAgB,EASjB,MAAM,yCAAyC,CAAC;AA+TjD,eAAO,MAAM,eAAe;;;;OAG3B,CAAC;AACF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"companySettings.model.d.ts","sourceRoot":"","sources":["../../src/models/companySettings.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAA2B,MAAM,UAAU,CAAC;AACnD,OAAO,EACL,gBAAgB,EASjB,MAAM,yCAAyC,CAAC;AA8TjD,eAAO,MAAM,eAAe;;;;OAG3B,CAAC;AACF,eAAe,eAAe,CAAC"}
@@ -290,6 +290,5 @@ const companySettingsSchema = new mongoose_1.Schema({
290
290
  // ─────────────────────────────────────────────
291
291
  // INDEXES
292
292
  // ─────────────────────────────────────────────
293
- companySettingsSchema.index({ company: 1 }, { unique: true });
294
293
  exports.CompanySettings = mongoose_1.default.model("CompanySettings", companySettingsSchema);
295
294
  exports.default = exports.CompanySettings;
@@ -1 +1 @@
1
- {"version":3,"file":"coupon.model.d.ts","sourceRoot":"","sources":["../../src/models/coupon.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAuDzD,eAAO,MAAM,MAAM;;;;OAAkD,CAAC;AACtE,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"coupon.model.d.ts","sourceRoot":"","sources":["../../src/models/coupon.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAsDzD,eAAO,MAAM,MAAM;;;;OAAkD,CAAC;AACtE,eAAe,MAAM,CAAC"}
@@ -81,7 +81,6 @@ const couponSchema = new mongoose_1.Schema({
81
81
  toJSON: { virtuals: true },
82
82
  toObject: { virtuals: true },
83
83
  });
84
- couponSchema.index({ code: 1 }, { unique: true });
85
84
  couponSchema.index({ isActive: 1 });
86
85
  exports.Coupon = mongoose_1.default.model("Coupon", couponSchema);
87
86
  exports.default = exports.Coupon;
@@ -1 +1 @@
1
- {"version":3,"file":"group.model.d.ts","sourceRoot":"","sources":["../../src/models/group.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAmEvD,eAAO,MAAM,KAAK;;;;OAA+C,CAAC"}
1
+ {"version":3,"file":"group.model.d.ts","sourceRoot":"","sources":["../../src/models/group.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAkEvD,eAAO,MAAM,KAAK;;;;OAA+C,CAAC"}
@@ -86,6 +86,5 @@ const groupSchema = new mongoose_1.Schema({
86
86
  // ─────────────────────────────────────────────
87
87
  // INDEXES
88
88
  // ─────────────────────────────────────────────
89
- groupSchema.index({ isActive: 1 });
90
89
  groupSchema.index({ "agents.userId": 1 });
91
90
  exports.Group = mongoose_1.default.model("Group", groupSchema);
@@ -1 +1 @@
1
- {"version":3,"file":"lead.model.d.ts","sourceRoot":"","sources":["../../src/models/lead.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAa,MAAM,8BAA8B,CAAC;AAmMhE,eAAO,MAAM,IAAI;;;;OAA4C,CAAC;AAC9D,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"lead.model.d.ts","sourceRoot":"","sources":["../../src/models/lead.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAa,MAAM,8BAA8B,CAAC;AAoMhE,eAAO,MAAM,IAAI;;;;OAA4C,CAAC;AAC9D,eAAe,IAAI,CAAC"}
@@ -196,5 +196,6 @@ leadSchema.pre("save", function () {
196
196
  leadSchema.index({ "data.email": 1 });
197
197
  leadSchema.index({ companyId: 1, isSent: 1, isFlagged: 1 });
198
198
  leadSchema.index({ visitorId: 1 });
199
+ leadSchema.index({ createdAt: 1 }); // Ops-wide date ranges and the newest-first lead list
199
200
  exports.Lead = mongoose_1.default.model("Lead", leadSchema);
200
201
  exports.default = exports.Lead;
@@ -1 +1 @@
1
- {"version":3,"file":"leadLedger.model.d.ts","sourceRoot":"","sources":["../../src/models/leadLedger.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AA4HjE,eAAO,MAAM,UAAU;;;;OAGtB,CAAC;AACF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"leadLedger.model.d.ts","sourceRoot":"","sources":["../../src/models/leadLedger.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AA2HjE,eAAO,MAAM,UAAU;;;;OAGtB,CAAC;AACF,eAAe,UAAU,CAAC"}
@@ -137,6 +137,5 @@ leadLedgerSchema.index({
137
137
  billingPeriodStart: 1,
138
138
  billingPeriodEnd: 1,
139
139
  });
140
- leadLedgerSchema.index({ invoiceId: 1 });
141
140
  exports.LeadLedger = mongoose_1.default.model("LeadLedger", leadLedgerSchema);
142
141
  exports.default = exports.LeadLedger;
@@ -1 +1 @@
1
- {"version":3,"file":"request.model.d.ts","sourceRoot":"","sources":["../../src/models/request.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAE5C,OAAO,EACL,QAAQ,EAOT,MAAM,iCAAiC,CAAC;AA+JzC,eAAO,MAAM,OAAO;;;;OAAqD,CAAC;AAC1E,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"request.model.d.ts","sourceRoot":"","sources":["../../src/models/request.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAE5C,OAAO,EACL,QAAQ,EAOT,MAAM,iCAAiC,CAAC;AAkKzC,eAAO,MAAM,OAAO;;;;OAAqD,CAAC;AAC1E,eAAe,OAAO,CAAC"}
@@ -160,5 +160,8 @@ requestSchema.index({ companyId: 1, createdAt: -1 });
160
160
  requestSchema.index({ companyId: 1, status: 1, createdAt: -1 });
161
161
  requestSchema.index({ companyId: 1, category: 1, createdAt: -1 });
162
162
  requestSchema.index({ assigneeId: 1, status: 1, createdAt: -1 });
163
+ // The Ops request list covers every company, newest first, optionally by status; analytics count by date.
164
+ requestSchema.index({ createdAt: -1 });
165
+ requestSchema.index({ status: 1, createdAt: -1 });
163
166
  exports.Request = mongoose_1.default.model("Request", requestSchema);
164
167
  exports.default = exports.Request;
@@ -1 +1 @@
1
- {"version":3,"file":"ticket.model.d.ts","sourceRoot":"","sources":["../../src/models/ticket.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAE5C,OAAO,EACL,OAAO,EAIR,MAAM,gCAAgC,CAAC;AAmQxC,eAAO,MAAM,MAAM;;;;OAAkD,CAAC;AACtE,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"ticket.model.d.ts","sourceRoot":"","sources":["../../src/models/ticket.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAE5C,OAAO,EACL,OAAO,EAIR,MAAM,gCAAgC,CAAC;AAsQxC,eAAO,MAAM,MAAM;;;;OAAkD,CAAC;AACtE,eAAe,MAAM,CAAC"}
@@ -268,5 +268,8 @@ ticketSchema.pre("save", async function () {
268
268
  ticketSchema.index({ ownerType: 1, ownerId: 1, createdAt: -1 });
269
269
  ticketSchema.index({ ownerType: 1, ownerId: 1, status: 1, createdAt: -1 });
270
270
  ticketSchema.index({ assigneeId: 1, status: 1, createdAt: -1 });
271
+ // The Ops ticket list covers every owner, newest first, optionally by status; analytics count by date.
272
+ ticketSchema.index({ createdAt: -1 });
273
+ ticketSchema.index({ status: 1, createdAt: -1 });
271
274
  exports.Ticket = mongoose_1.default.model("Ticket", ticketSchema);
272
275
  exports.default = exports.Ticket;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orbitx-core-models",
3
- "version": "11.166.0",
3
+ "version": "11.167.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",