joye-backend-utility 8.2.6 → 8.2.7
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.
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AIResponsesTrackingSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
|
+
/**
|
|
6
|
+
* Assistant replies captured when a chat session ends.
|
|
7
|
+
* `platformKey` + `tId` match Organization so rows can be queried per tenant.
|
|
8
|
+
*/
|
|
5
9
|
const AIResponsesTracking = new mongoose_1.Schema({
|
|
6
10
|
date: {
|
|
7
11
|
type: String,
|
|
@@ -13,6 +17,16 @@ const AIResponsesTracking = new mongoose_1.Schema({
|
|
|
13
17
|
required: true,
|
|
14
18
|
index: true,
|
|
15
19
|
},
|
|
20
|
+
/** Organization.platformKey — teams, visit, pwa, chatgpt, and so on */
|
|
21
|
+
platformKey: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
/** Organization.tId */
|
|
26
|
+
tId: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
16
30
|
createdAt: {
|
|
17
31
|
type: Number,
|
|
18
32
|
required: true,
|
|
@@ -23,4 +37,6 @@ const AIResponsesTracking = new mongoose_1.Schema({
|
|
|
23
37
|
required: false,
|
|
24
38
|
},
|
|
25
39
|
});
|
|
40
|
+
AIResponsesTracking.index({ platformKey: 1, tId: 1, date: -1 });
|
|
41
|
+
AIResponsesTracking.index({ platformKey: 1, tId: 1, type: 1, date: -1 });
|
|
26
42
|
exports.AIResponsesTrackingSchema = AIResponsesTracking;
|