joye-backend-utility 7.1.0 → 7.1.2
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.
package/dist/database.js
CHANGED
|
@@ -58,6 +58,7 @@ class database {
|
|
|
58
58
|
con.model('Master_Emotion_v2', schema_1.MasterEmotionsSchemaV2);
|
|
59
59
|
con.model('Master_Super_Power_Data', schema_1.MasterSuperPowerDataSchema);
|
|
60
60
|
con.model('Master_Super_Power_Rule', schema_1.MasterSuperPowerRuleSchema);
|
|
61
|
+
con.model('User_Super_Power_Data', schema_1.UserSuperPowerDataSchema);
|
|
61
62
|
};
|
|
62
63
|
this.connectToDatabase = () => {
|
|
63
64
|
const env = config_1.NODE_ENV || 'development';
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -49,3 +49,4 @@ export { PageViewSchema } from './pageView';
|
|
|
49
49
|
export { MasterEmotionsSchemaV2 } from './masterEmotionV2';
|
|
50
50
|
export { MasterSuperPowerDataSchema } from './masterSuperPowerData';
|
|
51
51
|
export { MasterSuperPowerRuleSchema } from './masterSuperPowerRule';
|
|
52
|
+
export { UserSuperPowerDataSchema } from './userSuperPowerData';
|
package/dist/schema/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MasterSuperPowerDataSchema = exports.MasterEmotionsSchemaV2 = exports.PageViewSchema = exports.AIPromptsSchema = exports.UserAnalyticSchema = exports.AIResponsesTrackingSchema = exports.UserProfileSchema = exports.UserChatSessionSchema = exports.FeatureFeedbackSchema = exports.UserWeekActivitySchema = exports.UserTrainingRemindersSchema = exports.UserTrainingDailyDataSchema = exports.MasterTrainingDaysSchema = exports.UserTrainingWeekDataSchema = exports.UserTrainingDataSchema = exports.MasterTrainingWeekSchema = exports.MasterTrainingSchema = exports.userJoyLevelQaSchema = exports.userGoalSchema = exports.OrganizationUserAttrPermissionSchema = exports.TimezoneSchema = exports.UserVideoSchema = exports.UserFeedbackSchema = exports.UserReminderSchema = exports.MasterLinkCardSchema = exports.UserRecommendationSchema = exports.MasterSuggestionsParameterSchema = exports.MasterSuggestionsMessageSchema = exports.MasterBlessingsDataSchema = exports.MasterVideoSchema = exports.DatabaseInfoSchema = exports.UserSchema = exports.UserMessageLogSchema = exports.UserMessageSchema = exports.UserMeetingSchema = exports.UserLogSchema = exports.PlatformSchema = exports.OrganizationSchema = exports.MasterThemeMessageSchema = exports.MasterThemeDataSchema = exports.MasterPredictionEmotionsMessageMappingSchema = exports.MasterPredictionEmotionMessageSchema = exports.MasterPredictionEmotionSchema = exports.MasterPodcastSchema = exports.MasterEmotionMessageTypeThemeMappingSchema = exports.MasterEmotionsMessageMappingSchema = exports.MasterEmotionsSchema = exports.MasterDataSchema = exports.MasterAppSettingSchema = exports.BrewSchema = void 0;
|
|
4
|
-
exports.MasterSuperPowerRuleSchema = void 0;
|
|
4
|
+
exports.UserSuperPowerDataSchema = exports.MasterSuperPowerRuleSchema = void 0;
|
|
5
5
|
var brew_1 = require("./brew");
|
|
6
6
|
Object.defineProperty(exports, "BrewSchema", { enumerable: true, get: function () { return brew_1.BrewSchema; } });
|
|
7
7
|
var masterAppSetting_1 = require("./masterAppSetting");
|
|
@@ -104,3 +104,5 @@ var masterSuperPowerData_1 = require("./masterSuperPowerData");
|
|
|
104
104
|
Object.defineProperty(exports, "MasterSuperPowerDataSchema", { enumerable: true, get: function () { return masterSuperPowerData_1.MasterSuperPowerDataSchema; } });
|
|
105
105
|
var masterSuperPowerRule_1 = require("./masterSuperPowerRule");
|
|
106
106
|
Object.defineProperty(exports, "MasterSuperPowerRuleSchema", { enumerable: true, get: function () { return masterSuperPowerRule_1.MasterSuperPowerRuleSchema; } });
|
|
107
|
+
var userSuperPowerData_1 = require("./userSuperPowerData");
|
|
108
|
+
Object.defineProperty(exports, "UserSuperPowerDataSchema", { enumerable: true, get: function () { return userSuperPowerData_1.UserSuperPowerDataSchema; } });
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserSuperPowerDataSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const DimensionInfoSchema = new mongoose_1.Schema({
|
|
6
|
+
key: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
score: {
|
|
11
|
+
type: Number,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
}, { _id: false });
|
|
15
|
+
const UserSuperPowerData = new mongoose_1.Schema({
|
|
16
|
+
date: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
month: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
year: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
createdTimestamp: {
|
|
29
|
+
type: Number,
|
|
30
|
+
required: true,
|
|
31
|
+
index: true,
|
|
32
|
+
},
|
|
33
|
+
employeeId: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: true,
|
|
36
|
+
index: true,
|
|
37
|
+
},
|
|
38
|
+
resilienceIndex: {
|
|
39
|
+
type: Number,
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
label: {
|
|
43
|
+
type: String,
|
|
44
|
+
required: true,
|
|
45
|
+
},
|
|
46
|
+
highDimension: {
|
|
47
|
+
type: DimensionInfoSchema,
|
|
48
|
+
required: true,
|
|
49
|
+
},
|
|
50
|
+
lowDimension: {
|
|
51
|
+
type: DimensionInfoSchema,
|
|
52
|
+
required: true,
|
|
53
|
+
},
|
|
54
|
+
lowDimensionCount: {
|
|
55
|
+
type: Number,
|
|
56
|
+
required: true,
|
|
57
|
+
},
|
|
58
|
+
rule: {
|
|
59
|
+
type: Number,
|
|
60
|
+
required: true,
|
|
61
|
+
},
|
|
62
|
+
superpowerStateMessage: {
|
|
63
|
+
type: String,
|
|
64
|
+
required: true,
|
|
65
|
+
},
|
|
66
|
+
stateTitle: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: null,
|
|
69
|
+
},
|
|
70
|
+
stateDetail: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: null,
|
|
73
|
+
},
|
|
74
|
+
suggestionTitle: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: null,
|
|
77
|
+
},
|
|
78
|
+
suggestions: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: null,
|
|
81
|
+
},
|
|
82
|
+
dos: {
|
|
83
|
+
type: [String],
|
|
84
|
+
default: [],
|
|
85
|
+
},
|
|
86
|
+
donts: {
|
|
87
|
+
type: [String],
|
|
88
|
+
default: [],
|
|
89
|
+
},
|
|
90
|
+
happyGoals: {
|
|
91
|
+
type: [String],
|
|
92
|
+
default: [],
|
|
93
|
+
},
|
|
94
|
+
trainings: {
|
|
95
|
+
type: [String],
|
|
96
|
+
default: [],
|
|
97
|
+
},
|
|
98
|
+
dimensionKey: {
|
|
99
|
+
type: String,
|
|
100
|
+
required: true,
|
|
101
|
+
index: true,
|
|
102
|
+
},
|
|
103
|
+
metadata: {
|
|
104
|
+
type: {
|
|
105
|
+
inputPayload: {
|
|
106
|
+
type: mongoose_1.Schema.Types.Mixed,
|
|
107
|
+
default: null,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
required: false,
|
|
111
|
+
default: () => ({
|
|
112
|
+
inputPayload: null,
|
|
113
|
+
}),
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
UserSuperPowerData.index({ employeeId: 1, dimensionKey: 1 });
|
|
117
|
+
UserSuperPowerData.index({ date: -1 });
|
|
118
|
+
exports.UserSuperPowerDataSchema = UserSuperPowerData;
|
|
@@ -99,6 +99,18 @@ const UserAnalytic = new mongoose_1.Schema({
|
|
|
99
99
|
type: String,
|
|
100
100
|
required: false,
|
|
101
101
|
},
|
|
102
|
+
title: {
|
|
103
|
+
type: String,
|
|
104
|
+
required: false,
|
|
105
|
+
},
|
|
106
|
+
dos: {
|
|
107
|
+
type: Array,
|
|
108
|
+
required: false,
|
|
109
|
+
},
|
|
110
|
+
donts: {
|
|
111
|
+
type: Array,
|
|
112
|
+
required: false,
|
|
113
|
+
},
|
|
102
114
|
});
|
|
103
115
|
UserAnalytic.index({ employeeId: 1, weekNumber: -1, year: -1, date: -1 });
|
|
104
116
|
UserAnalytic.index({ employeeId: 1, month: -1, year: -1, date: -1 });
|