joye-backend-utility 8.2.2 → 8.2.4
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.
|
@@ -3,10 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AIResponsesTrackingSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const AIResponsesTracking = new mongoose_1.Schema({
|
|
6
|
-
sessionId: {
|
|
7
|
-
type: String,
|
|
8
|
-
required: true,
|
|
9
|
-
},
|
|
10
6
|
date: {
|
|
11
7
|
type: String,
|
|
12
8
|
required: true,
|
|
@@ -31,7 +31,7 @@ exports.LlmBatchJobSchema = new mongoose_1.Schema({
|
|
|
31
31
|
batchName: { type: String, required: false, index: true },
|
|
32
32
|
displayName: { type: String, required: true },
|
|
33
33
|
state: { type: String, required: true, default: 'open', index: true },
|
|
34
|
-
/** Model id used for the batch (e.g. gemini-3.
|
|
34
|
+
/** Model id used for the batch (e.g. gemini-3.7-flash / claude-sonnet-4-6). */
|
|
35
35
|
model: { type: String, required: false },
|
|
36
36
|
createdAt: { type: Number, required: true },
|
|
37
37
|
submittedAt: { type: Number, required: false },
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Schema } from 'mongoose';
|
|
2
|
+
/** Tenant identity is scoped per platform — same tId may exist on different platforms. */
|
|
2
3
|
export declare const OrganizationSchema: Schema<import("mongoose").Document<any, any, any>, import("mongoose").Model<import("mongoose").Document<any, any, any>, any, any>, undefined, {}>;
|
|
@@ -76,4 +76,6 @@ const Organization = new mongoose_1.Schema({
|
|
|
76
76
|
},
|
|
77
77
|
});
|
|
78
78
|
Organization.index({ platformKey: 1, timezone: -1, inactive: -1 });
|
|
79
|
+
/** Tenant identity is scoped per platform — same tId may exist on different platforms. */
|
|
80
|
+
// Organization.index({ platformKey: 1, tId: 1 }, { unique: true });
|
|
79
81
|
exports.OrganizationSchema = Organization;
|
|
@@ -181,7 +181,7 @@ const UserAnalytic = new mongoose_1.Schema({
|
|
|
181
181
|
type: Number,
|
|
182
182
|
required: false,
|
|
183
183
|
},
|
|
184
|
-
/**
|
|
184
|
+
/** Thinking / reasoning tokens. Gemini: thoughtsTokenCount. Claude: output_tokens_details.thinking_tokens. */
|
|
185
185
|
thoughtsToken: {
|
|
186
186
|
type: Number,
|
|
187
187
|
required: false,
|
|
@@ -201,4 +201,7 @@ UserAnalytic.index({ employeeId: 1, weekNumber: -1, year: -1, date: -1 });
|
|
|
201
201
|
UserAnalytic.index({ employeeId: 1, month: -1, year: -1, date: -1 });
|
|
202
202
|
UserAnalytic.index({ year: 1, weekNumber: 1, bucket: 1, _id: 1 });
|
|
203
203
|
UserAnalytic.index({ year: 1, weekNumber: 1, hasDailySuggestion: 1, bucket: 1, _id: 1 });
|
|
204
|
+
// Suggestion-queue filter is year + weekNumber + hasDailySuggestion + tz + bucket, paged by _id.
|
|
205
|
+
// db.user_analytics.createIndex({ year: 1, weekNumber: 1, hasDailySuggestion: 1, tz: 1, bucket: 1, _id: 1 }, { name: 'year_week_hasDI_tz_bucket_id' })
|
|
206
|
+
UserAnalytic.index({ year: 1, weekNumber: 1, hasDailySuggestion: 1, tz: 1, bucket: 1, _id: 1 }, { name: 'year_week_hasDI_tz_bucket_id' });
|
|
204
207
|
exports.UserAnalyticSchema = UserAnalytic;
|