joye-backend-utility 8.2.3 → 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.
|
@@ -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;
|
|
@@ -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;
|