joye-backend-utility 5.1.51 → 6.0.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.
package/dist/database.js CHANGED
@@ -44,6 +44,9 @@ class database {
44
44
  con.model('User_Training_Week_Data', schema_1.UserTrainingWeekDataSchema);
45
45
  con.model('Master_Training', schema_1.MasterTrainingSchema);
46
46
  con.model('Master_Training_Week', schema_1.MasterTrainingWeekSchema);
47
+ con.model('Master_Training_Days', schema_1.MasterTrainingDaysSchema);
48
+ con.model('User_Training_Daily_Data', schema_1.UserTrainingDailyDataSchema);
49
+ con.model('User_Training_Reminders', schema_1.UserTrainingRemindersSchema);
47
50
  con.model('User_Week_Activity', schema_1.UserWeekActivitySchema);
48
51
  con.model('Feature_Feedback', schema_1.FeatureFeedbackSchema);
49
52
  con.model('User_Chat_session', schema_1.UserChatSessionSchema);
@@ -35,6 +35,9 @@ export { MasterTrainingSchema } from './masterTraining';
35
35
  export { MasterTrainingWeekSchema } from './masterTrainingWeek';
36
36
  export { UserTrainingDataSchema } from './userTrainingData';
37
37
  export { UserTrainingWeekDataSchema } from './userTrainingWeekData';
38
+ export { MasterTrainingDaysSchema } from './masterTrainingDays';
39
+ export { UserTrainingDailyDataSchema } from './userTrainingDailyData';
40
+ export { UserTrainingRemindersSchema } from './userTrainingReminders';
38
41
  export { UserWeekActivitySchema } from './userWeekActivity';
39
42
  export { FeatureFeedbackSchema } from './featureFeedback';
40
43
  export { UserChatSessionSchema } from './userChatSession';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PageViewSchema = exports.AIPromptsSchema = exports.UserAnalyticSchema = exports.AIResponsesTrackingSchema = exports.UserProfileSchema = exports.UserChatSessionSchema = exports.FeatureFeedbackSchema = exports.UserWeekActivitySchema = 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;
3
+ 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
4
  var brew_1 = require("./brew");
5
5
  Object.defineProperty(exports, "BrewSchema", { enumerable: true, get: function () { return brew_1.BrewSchema; } });
6
6
  var masterAppSetting_1 = require("./masterAppSetting");
@@ -75,6 +75,12 @@ var userTrainingData_1 = require("./userTrainingData");
75
75
  Object.defineProperty(exports, "UserTrainingDataSchema", { enumerable: true, get: function () { return userTrainingData_1.UserTrainingDataSchema; } });
76
76
  var userTrainingWeekData_1 = require("./userTrainingWeekData");
77
77
  Object.defineProperty(exports, "UserTrainingWeekDataSchema", { enumerable: true, get: function () { return userTrainingWeekData_1.UserTrainingWeekDataSchema; } });
78
+ var masterTrainingDays_1 = require("./masterTrainingDays");
79
+ Object.defineProperty(exports, "MasterTrainingDaysSchema", { enumerable: true, get: function () { return masterTrainingDays_1.MasterTrainingDaysSchema; } });
80
+ var userTrainingDailyData_1 = require("./userTrainingDailyData");
81
+ Object.defineProperty(exports, "UserTrainingDailyDataSchema", { enumerable: true, get: function () { return userTrainingDailyData_1.UserTrainingDailyDataSchema; } });
82
+ var userTrainingReminders_1 = require("./userTrainingReminders");
83
+ Object.defineProperty(exports, "UserTrainingRemindersSchema", { enumerable: true, get: function () { return userTrainingReminders_1.UserTrainingRemindersSchema; } });
78
84
  var userWeekActivity_1 = require("./userWeekActivity");
79
85
  Object.defineProperty(exports, "UserWeekActivitySchema", { enumerable: true, get: function () { return userWeekActivity_1.UserWeekActivitySchema; } });
80
86
  var featureFeedback_1 = require("./featureFeedback");
@@ -33,5 +33,35 @@ const MasterTraining = new mongoose_1.Schema({
33
33
  required: true,
34
34
  default: true,
35
35
  },
36
+ dailyHabit: {
37
+ type: String,
38
+ required: false,
39
+ default: '',
40
+ },
41
+ dailyNotifications: {
42
+ type: String,
43
+ required: false,
44
+ default: '',
45
+ },
46
+ weeklyHabit: {
47
+ type: String,
48
+ required: false,
49
+ default: '',
50
+ },
51
+ weeklyNotifications: {
52
+ type: String,
53
+ required: false,
54
+ default: '',
55
+ },
56
+ monthlyHabit: {
57
+ type: String,
58
+ required: false,
59
+ default: '',
60
+ },
61
+ monthlyNotifications: {
62
+ type: String,
63
+ required: false,
64
+ default: '',
65
+ },
36
66
  });
37
67
  exports.MasterTrainingSchema = MasterTraining;
@@ -0,0 +1,2 @@
1
+ import { Schema } from 'mongoose';
2
+ export declare const MasterTrainingDaysSchema: Schema<import("mongoose").Document<any, any, any>, import("mongoose").Model<import("mongoose").Document<any, any, any>, any, any>, undefined, {}>;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MasterTrainingDaysSchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const MasterTrainingDays = new mongoose_1.Schema({
6
+ trainingKey: {
7
+ type: String,
8
+ required: true,
9
+ index: true,
10
+ },
11
+ day: {
12
+ // day number within the training (1..n)
13
+ type: Number,
14
+ required: true,
15
+ },
16
+ title: {
17
+ type: String,
18
+ required: true,
19
+ },
20
+ content: {
21
+ type: String,
22
+ required: false,
23
+ },
24
+ notification: {
25
+ // notification text or schedule identifier
26
+ type: String,
27
+ required: false,
28
+ },
29
+ });
30
+ MasterTrainingDays.index({ trainingKey: 1, day: 1 });
31
+ exports.MasterTrainingDaysSchema = MasterTrainingDays;
@@ -70,6 +70,9 @@ const userGoal = new mongoose_1.Schema({
70
70
  type: String,
71
71
  required: false,
72
72
  },
73
+ lastReminderDate: {
74
+ type: String,
75
+ },
73
76
  });
74
77
  userGoal.index({ employeeId: 1, date: -1 }, {
75
78
  unique: false,
@@ -0,0 +1,2 @@
1
+ import { Schema } from 'mongoose';
2
+ export declare const UserTrainingDailyDataSchema: Schema<import("mongoose").Document<any, any, any>, import("mongoose").Model<import("mongoose").Document<any, any, any>, any, any>, undefined, {}>;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserTrainingDailyDataSchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const UserTrainingDailyData = new mongoose_1.Schema({
6
+ employeeId: {
7
+ type: String,
8
+ required: true,
9
+ index: true,
10
+ },
11
+ trainingKey: {
12
+ type: String,
13
+ required: true,
14
+ index: true,
15
+ },
16
+ day: {
17
+ type: Number,
18
+ required: false,
19
+ },
20
+ creationTimestamp: {
21
+ type: Number,
22
+ required: true,
23
+ },
24
+ status: {
25
+ type: String,
26
+ required: false,
27
+ },
28
+ deleted: {
29
+ type: Boolean,
30
+ required: false,
31
+ default: false,
32
+ },
33
+ content: {
34
+ type: String,
35
+ required: true,
36
+ },
37
+ });
38
+ UserTrainingDailyData.index({ employeeId: 1, trainingKey: 1 });
39
+ UserTrainingDailyData.index({ employeeId: 1, trainingKey: 1, day: 1 });
40
+ exports.UserTrainingDailyDataSchema = UserTrainingDailyData;
@@ -0,0 +1,2 @@
1
+ import { Schema } from 'mongoose';
2
+ export declare const UserTrainingRemindersSchema: Schema<import("mongoose").Document<any, any, any>, import("mongoose").Model<import("mongoose").Document<any, any, any>, any, any>, undefined, {}>;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserTrainingRemindersSchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const UserTrainingReminders = new mongoose_1.Schema({
6
+ employeeId: {
7
+ type: String,
8
+ required: true,
9
+ index: true,
10
+ },
11
+ trainingKey: {
12
+ type: String,
13
+ required: false,
14
+ },
15
+ day: {
16
+ type: Number,
17
+ required: false,
18
+ },
19
+ userReminder: {
20
+ type: Boolean,
21
+ required: true,
22
+ },
23
+ reminderType: {
24
+ // e.g., 'daily', 'weekly', 'monthly', 'oneoff'
25
+ type: String,
26
+ required: true,
27
+ },
28
+ reminderDate: {
29
+ // date string (ISO) or date identifier
30
+ type: String,
31
+ required: true,
32
+ },
33
+ reminderTime: {
34
+ type: String,
35
+ required: true,
36
+ },
37
+ creationTimestamp: {
38
+ type: Number,
39
+ required: true,
40
+ },
41
+ tz: {
42
+ // timezone identifier, e.g. 'Asia/Kolkata'
43
+ type: String,
44
+ required: true,
45
+ },
46
+ });
47
+ UserTrainingReminders.index({ employeeId: 1, trainingKey: 1 });
48
+ UserTrainingReminders.index({ employeeId: 1, trainingKey: 1, day: 1 });
49
+ UserTrainingReminders.index({ reminderDate: 1, reminderTime: 1, reminderType: 1, trainingKey: 1, day: 1 });
50
+ exports.UserTrainingRemindersSchema = UserTrainingReminders;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "joye-backend-utility",
3
- "version": "5.1.51",
3
+ "version": "6.0.0",
4
4
  "description": "Joye backend utility for db functions and common functions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",