flykup_model_production 1.0.16 → 1.0.17

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.
Files changed (40) hide show
  1. package/.gitattributes +2 -0
  2. package/.github/workflows/publish.yml +31 -0
  3. package/auth.js +14 -14
  4. package/config.js +1 -1
  5. package/db_connection.js +23 -23
  6. package/index.js +140 -140
  7. package/models/AadhaarVerification.js +131 -131
  8. package/models/AdminEmail.model.js +38 -38
  9. package/models/BankVerification.js +92 -92
  10. package/models/GSTVerification.js +89 -89
  11. package/models/LiveStreamInteraction.model.js +101 -101
  12. package/models/ProductInteraction.model.js +108 -108
  13. package/models/Review.model.js +121 -121
  14. package/models/SearchAnalytics.js +23 -23
  15. package/models/ShoppableInteraction.model.js +106 -106
  16. package/models/Wishlist.model.js +29 -29
  17. package/models/admin.model.js +42 -42
  18. package/models/appUpdate.model.js +19 -19
  19. package/models/assets.model.js +32 -32
  20. package/models/blockedRegion.models.js +27 -27
  21. package/models/chat.model.js +511 -511
  22. package/models/coHostInvitation.model.js +60 -60
  23. package/models/follow.model.js +38 -38
  24. package/models/loginlogs.model.js +26 -26
  25. package/models/notification.model.js +130 -129
  26. package/models/order.modal.js +385 -385
  27. package/models/orderPayment.model.js +218 -218
  28. package/models/productListing.model.js +322 -322
  29. package/models/profileInteractions.model.js +44 -44
  30. package/models/registerShow.model.js +29 -29
  31. package/models/sellerDraft.model.js +27 -27
  32. package/models/shipper.model.js +126 -126
  33. package/models/shoppableVideo.model.js +237 -237
  34. package/models/shoppableVideoComment.model.js +57 -57
  35. package/models/shoppableVideoLike.model.js +29 -29
  36. package/models/shoppableVideoSave.model.js +27 -27
  37. package/models/shows.model.js +603 -603
  38. package/models/stock.model.js +105 -105
  39. package/models/ticket.model.js +115 -115
  40. package/package.json +18 -18
@@ -1,106 +1,106 @@
1
- import mongoose, { Schema, model } from 'mongoose';
2
- import crypto from 'crypto';
3
-
4
- const shoppableVideoInteractionSchema = new mongoose.Schema({
5
- video: {
6
- type: mongoose.Schema.Types.ObjectId,
7
- ref: 'ShoppableVideo', // Reference the correct model name
8
- required: true
9
- },
10
- user: {
11
- type: mongoose.Schema.Types.ObjectId,
12
- ref: 'User',
13
- index: true
14
- },
15
- // Used to identify anonymous users by hashing their IP and User-Agent
16
- sessionIdentifier: {
17
- type: String,
18
- index: true
19
- },
20
- host: {
21
- type: mongoose.Schema.Types.ObjectId,
22
- refPath: 'hostModel',
23
- required: true
24
- },
25
- hostModel: {
26
- type: String,
27
- required: true,
28
- enum: ['sellers', 'dropshippers']
29
- },
30
- location: {
31
- city: String,
32
- region: String,
33
- country: String
34
- },
35
- platform: {
36
- type: String,
37
- enum: ['web', 'mobile', 'unknown'],
38
- default: 'unknown'
39
- },
40
- device: {
41
- type: String,
42
- enum: ['mobile', 'desktop', 'tablet', 'other', 'unknown'],
43
- default: 'unknown'
44
- },
45
- browser: String,
46
- os: String,
47
- ip: {
48
- type: String,
49
- required: true
50
- },
51
- watchDuration: { // Total seconds the user watched across sessions
52
- type: Number,
53
- default: 0
54
- },
55
- completionPercentage: { // The maximum percentage of the video watched
56
- type: Number,
57
- min: 0,
58
- max: 100,
59
- default: 0
60
- },
61
- productsClicked: [{ // Unique list of products clicked by this user for this video
62
- type: mongoose.Schema.Types.ObjectId,
63
- ref: 'productlistings'
64
- }],
65
- maxSecondReached: {
66
- type: Number,
67
- default: 0
68
- },
69
- rewatchCount: {
70
- type: Number,
71
- default: 0
72
- },
73
- watchSessions: [{
74
- startedAt: Date,
75
- endedAt: Date,
76
- duration: Number,
77
- completionPercentage: Number,
78
- maxSecond: Number
79
- }],
80
- }, {
81
- timestamps: true
82
- });
83
-
84
- // Ensures a unique interaction record per logged-in user per video.
85
- shoppableVideoInteractionSchema.index({ video: 1, user: 1 }, {
86
- unique: true,
87
- partialFilterExpression: { user: { $exists: true } }
88
- });
89
- shoppableVideoInteractionSchema.index({ video: 1, maxSecondReached: 1 });
90
- shoppableVideoInteractionSchema.index({ video: 1, rewatchCount: 1 });
91
- shoppableVideoInteractionSchema.index({ host: 1, user: 1 });
92
-
93
- // Ensures a unique interaction record per anonymous session per video.
94
- shoppableVideoInteractionSchema.index({ video: 1, sessionIdentifier: 1 }, {
95
- unique: true,
96
- partialFilterExpression: { sessionIdentifier: { $exists: true } }
97
- });
98
-
99
- // Additional indexes for fast analytic queries
100
- shoppableVideoInteractionSchema.index({ video: 1, createdAt: -1 });
101
-
102
- const ShoppableVideoInteraction = mongoose.models.ShoppableVideoInteraction || mongoose.model(
103
- 'ShoppableVideoInteraction',
104
- shoppableVideoInteractionSchema
105
- );
106
- export default ShoppableVideoInteraction;
1
+ import mongoose, { Schema, model } from 'mongoose';
2
+ import crypto from 'crypto';
3
+
4
+ const shoppableVideoInteractionSchema = new mongoose.Schema({
5
+ video: {
6
+ type: mongoose.Schema.Types.ObjectId,
7
+ ref: 'ShoppableVideo', // Reference the correct model name
8
+ required: true
9
+ },
10
+ user: {
11
+ type: mongoose.Schema.Types.ObjectId,
12
+ ref: 'User',
13
+ index: true
14
+ },
15
+ // Used to identify anonymous users by hashing their IP and User-Agent
16
+ sessionIdentifier: {
17
+ type: String,
18
+ index: true
19
+ },
20
+ host: {
21
+ type: mongoose.Schema.Types.ObjectId,
22
+ refPath: 'hostModel',
23
+ required: true
24
+ },
25
+ hostModel: {
26
+ type: String,
27
+ required: true,
28
+ enum: ['sellers', 'dropshippers']
29
+ },
30
+ location: {
31
+ city: String,
32
+ region: String,
33
+ country: String
34
+ },
35
+ platform: {
36
+ type: String,
37
+ enum: ['web', 'mobile', 'unknown'],
38
+ default: 'unknown'
39
+ },
40
+ device: {
41
+ type: String,
42
+ enum: ['mobile', 'desktop', 'tablet', 'other', 'unknown'],
43
+ default: 'unknown'
44
+ },
45
+ browser: String,
46
+ os: String,
47
+ ip: {
48
+ type: String,
49
+ required: true
50
+ },
51
+ watchDuration: { // Total seconds the user watched across sessions
52
+ type: Number,
53
+ default: 0
54
+ },
55
+ completionPercentage: { // The maximum percentage of the video watched
56
+ type: Number,
57
+ min: 0,
58
+ max: 100,
59
+ default: 0
60
+ },
61
+ productsClicked: [{ // Unique list of products clicked by this user for this video
62
+ type: mongoose.Schema.Types.ObjectId,
63
+ ref: 'productlistings'
64
+ }],
65
+ maxSecondReached: {
66
+ type: Number,
67
+ default: 0
68
+ },
69
+ rewatchCount: {
70
+ type: Number,
71
+ default: 0
72
+ },
73
+ watchSessions: [{
74
+ startedAt: Date,
75
+ endedAt: Date,
76
+ duration: Number,
77
+ completionPercentage: Number,
78
+ maxSecond: Number
79
+ }],
80
+ }, {
81
+ timestamps: true
82
+ });
83
+
84
+ // Ensures a unique interaction record per logged-in user per video.
85
+ shoppableVideoInteractionSchema.index({ video: 1, user: 1 }, {
86
+ unique: true,
87
+ partialFilterExpression: { user: { $exists: true } }
88
+ });
89
+ shoppableVideoInteractionSchema.index({ video: 1, maxSecondReached: 1 });
90
+ shoppableVideoInteractionSchema.index({ video: 1, rewatchCount: 1 });
91
+ shoppableVideoInteractionSchema.index({ host: 1, user: 1 });
92
+
93
+ // Ensures a unique interaction record per anonymous session per video.
94
+ shoppableVideoInteractionSchema.index({ video: 1, sessionIdentifier: 1 }, {
95
+ unique: true,
96
+ partialFilterExpression: { sessionIdentifier: { $exists: true } }
97
+ });
98
+
99
+ // Additional indexes for fast analytic queries
100
+ shoppableVideoInteractionSchema.index({ video: 1, createdAt: -1 });
101
+
102
+ const ShoppableVideoInteraction = mongoose.models.ShoppableVideoInteraction || mongoose.model(
103
+ 'ShoppableVideoInteraction',
104
+ shoppableVideoInteractionSchema
105
+ );
106
+ export default ShoppableVideoInteraction;
@@ -1,29 +1,29 @@
1
- // backend/models/Wishlist.js
2
- import mongoose from "mongoose";
3
- const { Schema } = mongoose;
4
-
5
- const WishlistSchema = new Schema(
6
- {
7
- userId: {
8
- type: Schema.Types.ObjectId,
9
- ref: "users",
10
- required: true
11
- },
12
- productId: {
13
- type: Schema.Types.ObjectId,
14
- ref: "productlistings",
15
- required: true
16
- },
17
- addedAt: {
18
- type: Date,
19
- default: Date.now
20
- }
21
- },
22
- { timestamps: true }
23
- );
24
-
25
- // Add compound index to prevent duplicate entries
26
- WishlistSchema.index({ userId: 1, productId: 1 }, { unique: true });
27
-
28
- const Wishlist = mongoose.models.wishlists || mongoose.model("wishlists", WishlistSchema);
29
- export default Wishlist;
1
+ // backend/models/Wishlist.js
2
+ import mongoose from "mongoose";
3
+ const { Schema } = mongoose;
4
+
5
+ const WishlistSchema = new Schema(
6
+ {
7
+ userId: {
8
+ type: Schema.Types.ObjectId,
9
+ ref: "users",
10
+ required: true
11
+ },
12
+ productId: {
13
+ type: Schema.Types.ObjectId,
14
+ ref: "productlistings",
15
+ required: true
16
+ },
17
+ addedAt: {
18
+ type: Date,
19
+ default: Date.now
20
+ }
21
+ },
22
+ { timestamps: true }
23
+ );
24
+
25
+ // Add compound index to prevent duplicate entries
26
+ WishlistSchema.index({ userId: 1, productId: 1 }, { unique: true });
27
+
28
+ const Wishlist = mongoose.models.wishlists || mongoose.model("wishlists", WishlistSchema);
29
+ export default Wishlist;
@@ -1,42 +1,42 @@
1
- import mongoose from 'mongoose';
2
-
3
- const { Schema } = mongoose;
4
-
5
- const AdminSchema = new Schema(
6
- {
7
- name: { type: String, required: true },
8
- role: { type: String, required: true, default: "admin" },
9
- email: { type: String, required: true, unique: true },
10
- mobileNumber: { type: String, required: true },
11
- password: { type: String, required: true },
12
- profilePicture: {
13
- type: String,
14
- default: "https://img.freepik.com/free-vector/blue-circle-with-white-user_78370-4707.jpg"
15
- },
16
-
17
- contentAccess: {
18
- users: { readOnly: Boolean, edit: Boolean },
19
- pendingSellers: { readOnly: Boolean, edit: Boolean },
20
- sellers: { readOnly: Boolean, edit: Boolean },
21
- orders: { readOnly: Boolean, edit: Boolean },
22
- category: { readOnly: Boolean, edit: Boolean },
23
- autoApproved:{readOnly:Boolean,edit:Boolean},
24
- manualReview:{readOnly:Boolean,edit:Boolean},
25
- AutoRejected:{readOnly:Boolean,edit:Boolean},
26
- NewSellers:{readOnly:Boolean,edit:Boolean},
27
- Coupons:{readOnly:Boolean,edit:Boolean},
28
- Plans:{readOnly:Boolean,edit:Boolean},
29
- orderPayments:{readOnly:Boolean,edit:Boolean},
30
- helpandsupport:{readOnly:Boolean,edit:Boolean},
31
- // settings: { readOnly: Boolean, edit: Boolean },
32
- // admins: { readOnly: Boolean, edit: Boolean },
33
- },
34
- maskingSwitch: { type: Boolean, default: false },
35
- },
36
- { timestamps: true }
37
- );
38
-
39
- // ✅ Fix: Use AdminSchema instead of Schema
40
- const Admin = mongoose.models.Admin || mongoose.model("Admin", AdminSchema);
41
-
42
- export default Admin;
1
+ import mongoose from 'mongoose';
2
+
3
+ const { Schema } = mongoose;
4
+
5
+ const AdminSchema = new Schema(
6
+ {
7
+ name: { type: String, required: true },
8
+ role: { type: String, required: true, default: "admin" },
9
+ email: { type: String, required: true, unique: true },
10
+ mobileNumber: { type: String, required: true },
11
+ password: { type: String, required: true },
12
+ profilePicture: {
13
+ type: String,
14
+ default: "https://img.freepik.com/free-vector/blue-circle-with-white-user_78370-4707.jpg"
15
+ },
16
+
17
+ contentAccess: {
18
+ users: { readOnly: Boolean, edit: Boolean },
19
+ pendingSellers: { readOnly: Boolean, edit: Boolean },
20
+ sellers: { readOnly: Boolean, edit: Boolean },
21
+ orders: { readOnly: Boolean, edit: Boolean },
22
+ category: { readOnly: Boolean, edit: Boolean },
23
+ autoApproved:{readOnly:Boolean,edit:Boolean},
24
+ manualReview:{readOnly:Boolean,edit:Boolean},
25
+ AutoRejected:{readOnly:Boolean,edit:Boolean},
26
+ NewSellers:{readOnly:Boolean,edit:Boolean},
27
+ Coupons:{readOnly:Boolean,edit:Boolean},
28
+ Plans:{readOnly:Boolean,edit:Boolean},
29
+ orderPayments:{readOnly:Boolean,edit:Boolean},
30
+ helpandsupport:{readOnly:Boolean,edit:Boolean},
31
+ // settings: { readOnly: Boolean, edit: Boolean },
32
+ // admins: { readOnly: Boolean, edit: Boolean },
33
+ },
34
+ maskingSwitch: { type: Boolean, default: false },
35
+ },
36
+ { timestamps: true }
37
+ );
38
+
39
+ // ✅ Fix: Use AdminSchema instead of Schema
40
+ const Admin = mongoose.models.Admin || mongoose.model("Admin", AdminSchema);
41
+
42
+ export default Admin;
@@ -1,20 +1,20 @@
1
- import mongoose, { Schema, model } from 'mongoose';
2
-
3
- const updateSchema = new Schema({
4
- platform: { type: String, enum: ['android', 'ios'], required: true },
5
- currentVersion: { type: String, required: true },
6
- minVersion: { type: String, required: true }, // Minimum supported version
7
- isForceUpdate: { type: Boolean, default: false },
8
- releaseDate: { type: Date, default: Date.now },
9
- features: [{
10
- title: String,
11
- description: String
12
- }],
13
- releaseNotes: String,
14
- downloadUrl: String,
15
- createdAt: { type: Date, default: Date.now }
16
- });
17
-
18
- const Update = mongoose.models.Update || mongoose.model('Update', updateSchema);
19
-
1
+ import mongoose, { Schema, model } from 'mongoose';
2
+
3
+ const updateSchema = new Schema({
4
+ platform: { type: String, enum: ['android', 'ios'], required: true },
5
+ currentVersion: { type: String, required: true },
6
+ minVersion: { type: String, required: true }, // Minimum supported version
7
+ isForceUpdate: { type: Boolean, default: false },
8
+ releaseDate: { type: Date, default: Date.now },
9
+ features: [{
10
+ title: String,
11
+ description: String
12
+ }],
13
+ releaseNotes: String,
14
+ downloadUrl: String,
15
+ createdAt: { type: Date, default: Date.now }
16
+ });
17
+
18
+ const Update = mongoose.models.Update || mongoose.model('Update', updateSchema);
19
+
20
20
  export default Update;
@@ -1,32 +1,32 @@
1
- // models/Asset.js
2
-
3
- import mongoose, { Schema, model } from 'mongoose';
4
-
5
- import mongoosePaginate from 'mongoose-paginate-v2';
6
-
7
- const assetSchema = new mongoose.Schema({
8
- title: {
9
- type: String,
10
- required: true
11
- },
12
- key: {
13
- type: String,
14
- required: true,
15
- unique: true
16
- },
17
- type: {
18
- type: String,
19
- required: true,
20
- enum: ['video', 'image', 'pdf', 'other']
21
- },
22
- url: {
23
- type: String,
24
- required: true
25
- }
26
- }, {
27
- timestamps: true
28
- });
29
-
30
- assetSchema.plugin(mongoosePaginate);
31
-
32
- export const AssetsModel = mongoose.models.Asset || mongoose.model('Asset', assetSchema);
1
+ // models/Asset.js
2
+
3
+ import mongoose, { Schema, model } from 'mongoose';
4
+
5
+ import mongoosePaginate from 'mongoose-paginate-v2';
6
+
7
+ const assetSchema = new mongoose.Schema({
8
+ title: {
9
+ type: String,
10
+ required: true
11
+ },
12
+ key: {
13
+ type: String,
14
+ required: true,
15
+ unique: true
16
+ },
17
+ type: {
18
+ type: String,
19
+ required: true,
20
+ enum: ['video', 'image', 'pdf', 'other']
21
+ },
22
+ url: {
23
+ type: String,
24
+ required: true
25
+ }
26
+ }, {
27
+ timestamps: true
28
+ });
29
+
30
+ assetSchema.plugin(mongoosePaginate);
31
+
32
+ export const AssetsModel = mongoose.models.Asset || mongoose.model('Asset', assetSchema);
@@ -1,27 +1,27 @@
1
- import mongoose, { Schema, model } from 'mongoose';
2
-
3
- const blockedRegionSchema = new mongoose.Schema({
4
- region: {
5
- type: String,
6
- trim: true,
7
- },
8
- regionName: {
9
- type: String,
10
- trim: true,
11
- },
12
- country: {
13
- type: String,
14
- trim: true,
15
- },
16
- countryName: {
17
- type: String,
18
- trim: true,
19
- },
20
-
21
- }, {
22
- timestamps: true
23
- });
24
-
25
- const BlockedRegion = mongoose.models.BlockedRegion || mongoose.model('BlockedRegion', blockedRegionSchema);
26
-
27
- export default BlockedRegion;
1
+ import mongoose, { Schema, model } from 'mongoose';
2
+
3
+ const blockedRegionSchema = new mongoose.Schema({
4
+ region: {
5
+ type: String,
6
+ trim: true,
7
+ },
8
+ regionName: {
9
+ type: String,
10
+ trim: true,
11
+ },
12
+ country: {
13
+ type: String,
14
+ trim: true,
15
+ },
16
+ countryName: {
17
+ type: String,
18
+ trim: true,
19
+ },
20
+
21
+ }, {
22
+ timestamps: true
23
+ });
24
+
25
+ const BlockedRegion = mongoose.models.BlockedRegion || mongoose.model('BlockedRegion', blockedRegionSchema);
26
+
27
+ export default BlockedRegion;