mypetbook-core 1.0.39 → 1.0.41

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mypetbook-core",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "This contain all the entity model for the mypetbook",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -7,8 +7,12 @@ const VideoType = {
7
7
  Education: "Education",
8
8
  PetCare: "PetCare",
9
9
  };
10
+ const VideoLikeType = {
11
+ THUMBS_UP: "thumbs_up"
12
+ };
10
13
 
11
14
  const VideoTypeEnum = [VideoType.Education, VideoType.PetCare];
15
+ const VideoLikeTypeEnum = [VideoLikeType.THUMBS_UP];
12
16
 
13
17
 
14
18
  const videoRecordingSchema = new Schema({
@@ -53,7 +57,7 @@ const videoCommentSchema = new Schema({
53
57
  index: true,
54
58
  required: true,
55
59
  },
56
- user: {
60
+ videoRecording: {
57
61
  type:mongoose.Schema.ObjectId,
58
62
  ref: "VideoRecording",
59
63
  index: true,
@@ -65,9 +69,37 @@ const videoCommentSchema = new Schema({
65
69
 
66
70
  const VideoComment = mongoose.model("VideoComment", videoCommentSchema);
67
71
 
72
+ const videoLikeSchema = new Schema({
73
+ date: { type: Date},
74
+ user: {
75
+ type:mongoose.Schema.ObjectId,
76
+ ref: "User",
77
+ index: true,
78
+ required: true,
79
+ },
80
+ videoRecording: {
81
+ type:mongoose.Schema.ObjectId,
82
+ ref: "VideoRecording",
83
+ index: true,
84
+ required: true,
85
+ },
86
+ type:{
87
+ type: String,
88
+ index: true,
89
+ enum : VideoLikeTypeEnum,
90
+ default : VideoLikeType.THUMBS_UP,
91
+ required: true
92
+ }
93
+ });
94
+
95
+ const VideoLike = mongoose.model("VideoLike", videoLikeSchema);
96
+
68
97
  module.exports = {
69
98
  VideoRecording,
70
99
  VideoComment,
71
100
  VideoTypeEnum,
72
- VideoType
101
+ VideoType,
102
+ VideoLike,
103
+ VideoLikeTypeEnum,
104
+ VideoLikeType
73
105
  };
package/src/index.js CHANGED
@@ -24,7 +24,7 @@ const { Treatment, TreatmentItem, TreatmentStatus } = require("./TreatmentEntity
24
24
  const { TreatmentRecording } = require("./TreatmentRecordingEntity");
25
25
  const { TreatmentReport } = require("./TreatmentReportEntity");
26
26
  const { User } = require("./UserEntity");
27
- const { VideoRecording, VideoComment, VideoType, VideoTypeEnum } = require("./VideoRecordingEntity");
27
+ const { VideoRecording, VideoComment, VideoType, VideoTypeEnum, VideoLikeType, VideoLike, VideoLikeTypeEnum } = require("./VideoRecordingEntity");
28
28
 
29
29
  module.exports = {
30
30
  Appointment : Appointment,
@@ -71,5 +71,8 @@ module.exports = {
71
71
  VideoRecording:VideoRecording,
72
72
  VideoComment:VideoComment,
73
73
  VideoType:VideoType,
74
- VideoTypeEnum:VideoTypeEnum
74
+ VideoTypeEnum:VideoTypeEnum,
75
+ VideoLike:VideoLike,
76
+ VideoLikeType:VideoLikeType,
77
+ VideoLikeTypeEnum:VideoLikeTypeEnum
75
78
  };