flykup_model_development 3.1.74 → 3.1.76

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 (42) hide show
  1. package/.gitattributes +2 -0
  2. package/.github/workflows/main.yml +30 -0
  3. package/.github/workflows/publish.yml +31 -0
  4. package/auth.js +14 -14
  5. package/config.js +1 -1
  6. package/db_connection.js +23 -23
  7. package/index.js +140 -140
  8. package/models/AadhaarVerification.js +131 -131
  9. package/models/AdminEmail.model.js +39 -38
  10. package/models/BankVerification.js +92 -92
  11. package/models/GSTVerification.js +89 -89
  12. package/models/LiveStreamInteraction.model.js +101 -101
  13. package/models/ProductInteraction.model.js +108 -108
  14. package/models/Review.model.js +121 -121
  15. package/models/SearchAnalytics.js +23 -23
  16. package/models/ShoppableInteraction.model.js +106 -106
  17. package/models/Wishlist.model.js +29 -29
  18. package/models/admin.model.js +42 -42
  19. package/models/appUpdate.model.js +19 -19
  20. package/models/assets.model.js +32 -32
  21. package/models/blockedRegion.models.js +27 -27
  22. package/models/chat.model.js +511 -511
  23. package/models/coHostInvitation.model.js +60 -60
  24. package/models/follow.model.js +38 -38
  25. package/models/loginlogs.model.js +26 -26
  26. package/models/notification.model.js +129 -129
  27. package/models/order.modal.js +386 -385
  28. package/models/orderPayment.model.js +218 -218
  29. package/models/productListing.model.js +322 -322
  30. package/models/profileInteractions.model.js +44 -44
  31. package/models/registerShow.model.js +29 -29
  32. package/models/sellerDraft.model.js +27 -27
  33. package/models/shipper.model.js +126 -126
  34. package/models/shoppableVideo.model.js +237 -237
  35. package/models/shoppableVideoComment.model.js +57 -57
  36. package/models/shoppableVideoLike.model.js +29 -29
  37. package/models/shoppableVideoSave.model.js +27 -27
  38. package/models/shows.model.js +604 -604
  39. package/models/stock.model.js +105 -105
  40. package/models/ticket.model.js +115 -115
  41. package/package.json +19 -19
  42. package/test.html +11 -11
@@ -1,89 +1,89 @@
1
- // models/GSTVerification.js
2
- import mongoose from 'mongoose';
3
-
4
- const gstVerificationSchema = new mongoose.Schema({
5
- userId: {
6
- type: mongoose.Schema.Types.ObjectId,
7
- ref: 'users',
8
- required: true,
9
- index: true
10
- },
11
- gstNumber: {
12
- type: String,
13
- required: true,
14
- uppercase: true,
15
- trim: true
16
- },
17
- verificationStatus: {
18
- type: String,
19
- enum: ['verified', 'pending', 'failed'],
20
- default: 'pending'
21
- },
22
- businessName: {
23
- type: String,
24
- trim: true
25
- },
26
- tradeName: {
27
- type: String,
28
- trim: true
29
- },
30
- gstStatus: {
31
- type: String,
32
- trim: true
33
- },
34
- registrationDate: {
35
- type: Date
36
- },
37
- businessType: {
38
- type: String,
39
- trim: true
40
- },
41
- constitution: {
42
- type: String,
43
- trim: true
44
- },
45
- taxpayerType: {
46
- type: String,
47
- trim: true
48
- },
49
- address: {
50
- building: String,
51
- street: String,
52
- location: String,
53
- district: String,
54
- state: String,
55
- pincode: String,
56
- city: String,
57
- floor: String
58
- },
59
- filingStatus: {
60
- type: String,
61
- trim: true
62
- },
63
- lastUpdated: {
64
- type: Date
65
- },
66
- cancellationDate: {
67
- type: Date
68
- },
69
- rawResponse: {
70
- type: mongoose.Schema.Types.Mixed
71
- },
72
- verificationDate: {
73
- type: Date,
74
- default: Date.now
75
- },
76
- isActive: {
77
- type: Boolean,
78
- default: true
79
- }
80
- }, {
81
- timestamps: true
82
- });
83
-
84
- // Compound index to prevent duplicate verifications for same user and GST
85
- gstVerificationSchema.index({ userId: 1, gstNumber: 1 }, { unique: true });
86
-
87
- const GSTVerification = mongoose.models.GSTVerification || mongoose.model("GSTVerification", gstVerificationSchema);
88
-
89
- export default GSTVerification;
1
+ // models/GSTVerification.js
2
+ import mongoose from 'mongoose';
3
+
4
+ const gstVerificationSchema = new mongoose.Schema({
5
+ userId: {
6
+ type: mongoose.Schema.Types.ObjectId,
7
+ ref: 'users',
8
+ required: true,
9
+ index: true
10
+ },
11
+ gstNumber: {
12
+ type: String,
13
+ required: true,
14
+ uppercase: true,
15
+ trim: true
16
+ },
17
+ verificationStatus: {
18
+ type: String,
19
+ enum: ['verified', 'pending', 'failed'],
20
+ default: 'pending'
21
+ },
22
+ businessName: {
23
+ type: String,
24
+ trim: true
25
+ },
26
+ tradeName: {
27
+ type: String,
28
+ trim: true
29
+ },
30
+ gstStatus: {
31
+ type: String,
32
+ trim: true
33
+ },
34
+ registrationDate: {
35
+ type: Date
36
+ },
37
+ businessType: {
38
+ type: String,
39
+ trim: true
40
+ },
41
+ constitution: {
42
+ type: String,
43
+ trim: true
44
+ },
45
+ taxpayerType: {
46
+ type: String,
47
+ trim: true
48
+ },
49
+ address: {
50
+ building: String,
51
+ street: String,
52
+ location: String,
53
+ district: String,
54
+ state: String,
55
+ pincode: String,
56
+ city: String,
57
+ floor: String
58
+ },
59
+ filingStatus: {
60
+ type: String,
61
+ trim: true
62
+ },
63
+ lastUpdated: {
64
+ type: Date
65
+ },
66
+ cancellationDate: {
67
+ type: Date
68
+ },
69
+ rawResponse: {
70
+ type: mongoose.Schema.Types.Mixed
71
+ },
72
+ verificationDate: {
73
+ type: Date,
74
+ default: Date.now
75
+ },
76
+ isActive: {
77
+ type: Boolean,
78
+ default: true
79
+ }
80
+ }, {
81
+ timestamps: true
82
+ });
83
+
84
+ // Compound index to prevent duplicate verifications for same user and GST
85
+ gstVerificationSchema.index({ userId: 1, gstNumber: 1 }, { unique: true });
86
+
87
+ const GSTVerification = mongoose.models.GSTVerification || mongoose.model("GSTVerification", gstVerificationSchema);
88
+
89
+ export default GSTVerification;
@@ -1,101 +1,101 @@
1
- import mongoose, { Schema, model } from 'mongoose';
2
-
3
- import crypto from 'crypto';
4
-
5
- const liveStreamInteractionSchema = new mongoose.Schema({
6
- show: {
7
- type: mongoose.Schema.Types.ObjectId,
8
- ref: 'shows',
9
- required: true
10
- },
11
- user: {
12
- type: mongoose.Schema.Types.ObjectId,
13
- ref: 'User',
14
- index: true
15
- },
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: {
52
- type: Number,
53
- default: 0
54
- },
55
- lastSeenAt: Date,
56
- hasLiked: {
57
- type: Boolean,
58
- default: false
59
- },
60
- buyNowClicked: [{
61
- type: mongoose.Schema.Types.ObjectId,
62
- ref: 'productlistings'
63
- }],
64
- auctionBidded: [{
65
- type: mongoose.Schema.Types.ObjectId,
66
- ref: 'productlistings'
67
- }],
68
- giveawayEntered: [{
69
- type: mongoose.Schema.Types.ObjectId,
70
- ref: 'productlistings'
71
- }],
72
- auctionBids: [{
73
- productId: { type: mongoose.Schema.Types.ObjectId, ref: 'productlistings' },
74
- bidAmount: { type: Number, required: true },
75
- bidTime: { type: Date, default: Date.now }
76
- }],
77
- giveawayEntries: [{
78
- productId: { type: mongoose.Schema.Types.ObjectId, ref: 'productlistings' },
79
- entryTime: { type: Date, default: Date.now }
80
- }]
81
- }, {
82
- timestamps: true
83
- });
84
-
85
- // Unique indexes
86
- liveStreamInteractionSchema.index({ show: 1, user: 1 }, {
87
- unique: true,
88
- partialFilterExpression: { user: { $exists: true } }
89
- });
90
-
91
- liveStreamInteractionSchema.index({ show: 1, sessionIdentifier: 1 }, {
92
- unique: true,
93
- partialFilterExpression: { sessionIdentifier: { $exists: true } }
94
- });
95
-
96
- liveStreamInteractionSchema.index({ show: 1, createdAt: -1 });
97
-
98
- // Safe export to prevent OverwriteModelError
99
- const LiveStreamInteraction = mongoose.models.LiveStreamInteraction || mongoose.model('LiveStreamInteraction', liveStreamInteractionSchema);
100
-
101
- export default LiveStreamInteraction;
1
+ import mongoose, { Schema, model } from 'mongoose';
2
+
3
+ import crypto from 'crypto';
4
+
5
+ const liveStreamInteractionSchema = new mongoose.Schema({
6
+ show: {
7
+ type: mongoose.Schema.Types.ObjectId,
8
+ ref: 'shows',
9
+ required: true
10
+ },
11
+ user: {
12
+ type: mongoose.Schema.Types.ObjectId,
13
+ ref: 'User',
14
+ index: true
15
+ },
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: {
52
+ type: Number,
53
+ default: 0
54
+ },
55
+ lastSeenAt: Date,
56
+ hasLiked: {
57
+ type: Boolean,
58
+ default: false
59
+ },
60
+ buyNowClicked: [{
61
+ type: mongoose.Schema.Types.ObjectId,
62
+ ref: 'productlistings'
63
+ }],
64
+ auctionBidded: [{
65
+ type: mongoose.Schema.Types.ObjectId,
66
+ ref: 'productlistings'
67
+ }],
68
+ giveawayEntered: [{
69
+ type: mongoose.Schema.Types.ObjectId,
70
+ ref: 'productlistings'
71
+ }],
72
+ auctionBids: [{
73
+ productId: { type: mongoose.Schema.Types.ObjectId, ref: 'productlistings' },
74
+ bidAmount: { type: Number, required: true },
75
+ bidTime: { type: Date, default: Date.now }
76
+ }],
77
+ giveawayEntries: [{
78
+ productId: { type: mongoose.Schema.Types.ObjectId, ref: 'productlistings' },
79
+ entryTime: { type: Date, default: Date.now }
80
+ }]
81
+ }, {
82
+ timestamps: true
83
+ });
84
+
85
+ // Unique indexes
86
+ liveStreamInteractionSchema.index({ show: 1, user: 1 }, {
87
+ unique: true,
88
+ partialFilterExpression: { user: { $exists: true } }
89
+ });
90
+
91
+ liveStreamInteractionSchema.index({ show: 1, sessionIdentifier: 1 }, {
92
+ unique: true,
93
+ partialFilterExpression: { sessionIdentifier: { $exists: true } }
94
+ });
95
+
96
+ liveStreamInteractionSchema.index({ show: 1, createdAt: -1 });
97
+
98
+ // Safe export to prevent OverwriteModelError
99
+ const LiveStreamInteraction = mongoose.models.LiveStreamInteraction || mongoose.model('LiveStreamInteraction', liveStreamInteractionSchema);
100
+
101
+ export default LiveStreamInteraction;
@@ -1,108 +1,108 @@
1
- import mongoose, { Schema, model } from 'mongoose';
2
-
3
- const productInteractionSchema = new mongoose.Schema({
4
- product: { type: mongoose.Schema.Types.ObjectId, ref: 'Product', required: true },
5
- user: { type: mongoose.Schema.Types.ObjectId, ref: 'User', index: true },
6
- seller: { type: mongoose.Schema.Types.ObjectId, ref: 'Seller', required: true },
7
- location: {
8
- city: String,
9
- region: String,
10
- country: String
11
- },
12
- platform: { type: String, enum: ['web', 'mobile', 'unknown'], default: 'mobile' },
13
- device: { type: String, enum: ['mobile', 'desktop', 'tablet', 'other'] },
14
- browser: String,
15
- os: String,
16
- ip: { type: String, required: true },
17
- isIndianRegion: { type: Boolean, default: false },
18
- rating: {
19
- type: Number,
20
- min: 1,
21
- max: 5,
22
- validate: {
23
- validator: Number.isInteger,
24
- message: '{VALUE} is not an integer value'
25
- }
26
- },
27
- review: {
28
- type: String,
29
- maxlength: 500
30
- },
31
- viewCount: { type: Number, default: 1 },
32
- // NEW: Trust signals tracking
33
- trustSignals: {
34
- reviewViews: { type: Number, default: 0 }, // How many times user viewed reviews
35
- reviewViewDuration: { type: Number, default: 0 }, // Total time spent on reviews (seconds)
36
- comparisonViews: { type: Number, default: 0 }, // How many times user compared with other products
37
- priceCheckCount: { type: Number, default: 0 }, // How many times user checked pricing
38
- lastTrustSignalAt: { type: Date } // When the last trust signal was recorded
39
- },
40
- // NEW: Engagement status for sellers
41
- engagementStatus: {
42
- type: String,
43
- enum: ['new', 'interested', 'hesitant', 'contacted', 'converted'],
44
- default: 'new'
45
- },
46
- sellerNotes: [{
47
- note: String,
48
- createdAt: { type: Date, default: Date.now },
49
- updatedAt: { type: Date, default: Date.now }
50
- }]
51
- }, { timestamps: true });
52
-
53
- // Ensures a user's view is counted only once per product
54
- productInteractionSchema.index({ product: 1, user: 1 }, { unique: true, partialFilterExpression: { user: { $exists: true } } });
55
-
56
- // Additional indexes for performance
57
- productInteractionSchema.index({ createdAt: -1 });
58
-
59
- // Safe export to prevent OverwriteModelError
60
- const ProductInteraction = mongoose.models.ProductInteraction || mongoose.model('ProductInteraction', productInteractionSchema);
61
- export default ProductInteraction;
62
-
63
-
64
-
65
-
66
- // import mongoose, { Schema, model } from 'mongoose';
67
-
68
- // const productInteractionSchema = new mongoose.Schema({
69
- // product: { type: mongoose.Schema.Types.ObjectId, ref: 'Product', required: true },
70
- // user: { type: mongoose.Schema.Types.ObjectId, ref: 'User', index: true },
71
- // seller: { type: mongoose.Schema.Types.ObjectId, ref: 'Seller', required: true },
72
- // location: {
73
- // city: String,
74
- // region: String,
75
- // country: String
76
- // },
77
- // // --- NEW FIELD ---
78
- // platform: { type: String, enum: ['web', 'mobile', 'unknown'], default: 'mobile' },
79
- // device: { type: String, enum: ['mobile', 'desktop', 'tablet', 'other'] },
80
- // browser: String,
81
- // os: String,
82
- // ip: { type: String, required: true },
83
- // isIndianRegion: { type: Boolean, default: false },
84
- // rating: {
85
- // type: Number,
86
- // min: 1,
87
- // max: 5,
88
- // validate: {
89
- // validator: Number.isInteger,
90
- // message: '{VALUE} is not an integer value'
91
- // }
92
- // },
93
- // review: {
94
- // type: String,
95
- // maxlength: 500
96
- // },
97
- // viewCount: { type: Number, default: 1 }
98
- // }, { timestamps: true });
99
-
100
- // // Ensures a user's view is counted only once per product
101
- // productInteractionSchema.index({ product: 1, user: 1 }, { unique: true, partialFilterExpression: { user: { $exists: true } } });
102
-
103
- // // Additional indexes for performance
104
- // productInteractionSchema.index({ createdAt: -1 });
105
-
106
- // // Safe export to prevent OverwriteModelError
107
- // const ProductInteraction = mongoose.models.ProductInteraction || mongoose.model('ProductInteraction', productInteractionSchema);
108
- // export default ProductInteraction;
1
+ import mongoose, { Schema, model } from 'mongoose';
2
+
3
+ const productInteractionSchema = new mongoose.Schema({
4
+ product: { type: mongoose.Schema.Types.ObjectId, ref: 'Product', required: true },
5
+ user: { type: mongoose.Schema.Types.ObjectId, ref: 'User', index: true },
6
+ seller: { type: mongoose.Schema.Types.ObjectId, ref: 'Seller', required: true },
7
+ location: {
8
+ city: String,
9
+ region: String,
10
+ country: String
11
+ },
12
+ platform: { type: String, enum: ['web', 'mobile', 'unknown'], default: 'mobile' },
13
+ device: { type: String, enum: ['mobile', 'desktop', 'tablet', 'other'] },
14
+ browser: String,
15
+ os: String,
16
+ ip: { type: String, required: true },
17
+ isIndianRegion: { type: Boolean, default: false },
18
+ rating: {
19
+ type: Number,
20
+ min: 1,
21
+ max: 5,
22
+ validate: {
23
+ validator: Number.isInteger,
24
+ message: '{VALUE} is not an integer value'
25
+ }
26
+ },
27
+ review: {
28
+ type: String,
29
+ maxlength: 500
30
+ },
31
+ viewCount: { type: Number, default: 1 },
32
+ // NEW: Trust signals tracking
33
+ trustSignals: {
34
+ reviewViews: { type: Number, default: 0 }, // How many times user viewed reviews
35
+ reviewViewDuration: { type: Number, default: 0 }, // Total time spent on reviews (seconds)
36
+ comparisonViews: { type: Number, default: 0 }, // How many times user compared with other products
37
+ priceCheckCount: { type: Number, default: 0 }, // How many times user checked pricing
38
+ lastTrustSignalAt: { type: Date } // When the last trust signal was recorded
39
+ },
40
+ // NEW: Engagement status for sellers
41
+ engagementStatus: {
42
+ type: String,
43
+ enum: ['new', 'interested', 'hesitant', 'contacted', 'converted'],
44
+ default: 'new'
45
+ },
46
+ sellerNotes: [{
47
+ note: String,
48
+ createdAt: { type: Date, default: Date.now },
49
+ updatedAt: { type: Date, default: Date.now }
50
+ }]
51
+ }, { timestamps: true });
52
+
53
+ // Ensures a user's view is counted only once per product
54
+ productInteractionSchema.index({ product: 1, user: 1 }, { unique: true, partialFilterExpression: { user: { $exists: true } } });
55
+
56
+ // Additional indexes for performance
57
+ productInteractionSchema.index({ createdAt: -1 });
58
+
59
+ // Safe export to prevent OverwriteModelError
60
+ const ProductInteraction = mongoose.models.ProductInteraction || mongoose.model('ProductInteraction', productInteractionSchema);
61
+ export default ProductInteraction;
62
+
63
+
64
+
65
+
66
+ // import mongoose, { Schema, model } from 'mongoose';
67
+
68
+ // const productInteractionSchema = new mongoose.Schema({
69
+ // product: { type: mongoose.Schema.Types.ObjectId, ref: 'Product', required: true },
70
+ // user: { type: mongoose.Schema.Types.ObjectId, ref: 'User', index: true },
71
+ // seller: { type: mongoose.Schema.Types.ObjectId, ref: 'Seller', required: true },
72
+ // location: {
73
+ // city: String,
74
+ // region: String,
75
+ // country: String
76
+ // },
77
+ // // --- NEW FIELD ---
78
+ // platform: { type: String, enum: ['web', 'mobile', 'unknown'], default: 'mobile' },
79
+ // device: { type: String, enum: ['mobile', 'desktop', 'tablet', 'other'] },
80
+ // browser: String,
81
+ // os: String,
82
+ // ip: { type: String, required: true },
83
+ // isIndianRegion: { type: Boolean, default: false },
84
+ // rating: {
85
+ // type: Number,
86
+ // min: 1,
87
+ // max: 5,
88
+ // validate: {
89
+ // validator: Number.isInteger,
90
+ // message: '{VALUE} is not an integer value'
91
+ // }
92
+ // },
93
+ // review: {
94
+ // type: String,
95
+ // maxlength: 500
96
+ // },
97
+ // viewCount: { type: Number, default: 1 }
98
+ // }, { timestamps: true });
99
+
100
+ // // Ensures a user's view is counted only once per product
101
+ // productInteractionSchema.index({ product: 1, user: 1 }, { unique: true, partialFilterExpression: { user: { $exists: true } } });
102
+
103
+ // // Additional indexes for performance
104
+ // productInteractionSchema.index({ createdAt: -1 });
105
+
106
+ // // Safe export to prevent OverwriteModelError
107
+ // const ProductInteraction = mongoose.models.ProductInteraction || mongoose.model('ProductInteraction', productInteractionSchema);
108
+ // export default ProductInteraction;