@timardex/cluemart-server-shared 1.0.3 → 1.0.4
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/Chat-CR7oHSji.d.mts +89 -0
- package/dist/Chat-CR7oHSji.d.ts +89 -0
- package/dist/chunk-OKDYM6JS.mjs +938 -0
- package/dist/chunk-OKDYM6JS.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +959 -0
- package/dist/mongoose/index.cjs.map +1 -0
- package/dist/mongoose/index.d.mts +415 -0
- package/dist/mongoose/index.d.ts +415 -0
- package/dist/mongoose/index.mjs +51 -0
- package/dist/mongoose/index.mjs.map +1 -0
- package/dist/service/index.cjs +1139 -0
- package/dist/service/index.cjs.map +1 -0
- package/dist/service/index.d.mts +32 -0
- package/dist/service/index.d.ts +32 -0
- package/dist/service/index.mjs +226 -0
- package/dist/service/index.mjs.map +1 -0
- package/dist/types/index.cjs +53 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.mts +5 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.mjs +16 -0
- package/dist/types/index.mjs.map +1 -0
- package/package.json +5 -2
|
@@ -0,0 +1,938 @@
|
|
|
1
|
+
// src/mongoose/Ad.ts
|
|
2
|
+
import {
|
|
3
|
+
EnumAdShowOn,
|
|
4
|
+
EnumAdStatus,
|
|
5
|
+
EnumAdStyle,
|
|
6
|
+
EnumAdType,
|
|
7
|
+
EnumResourceType as EnumResourceType3
|
|
8
|
+
} from "@timardex/cluemart-shared";
|
|
9
|
+
import mongoose4 from "mongoose";
|
|
10
|
+
|
|
11
|
+
// src/mongoose/global.ts
|
|
12
|
+
import {
|
|
13
|
+
EnumResourceType as EnumResourceType2,
|
|
14
|
+
EnumUserLicence
|
|
15
|
+
} from "@timardex/cluemart-shared";
|
|
16
|
+
import mongoose3 from "mongoose";
|
|
17
|
+
|
|
18
|
+
// src/mongoose/Relation.ts
|
|
19
|
+
import mongoose2 from "mongoose";
|
|
20
|
+
import {
|
|
21
|
+
EnumInviteStatus,
|
|
22
|
+
EnumRelationResource,
|
|
23
|
+
EnumResourceType
|
|
24
|
+
} from "@timardex/cluemart-shared";
|
|
25
|
+
|
|
26
|
+
// src/mongoose/event/EventInfo.ts
|
|
27
|
+
import {
|
|
28
|
+
EnumPaymentMethod
|
|
29
|
+
} from "@timardex/cluemart-shared";
|
|
30
|
+
import mongoose from "mongoose";
|
|
31
|
+
var MongooseSchema = mongoose.Schema;
|
|
32
|
+
var StallTypeSchema = new MongooseSchema(
|
|
33
|
+
{
|
|
34
|
+
electricity: {
|
|
35
|
+
price: { required: false, type: Number },
|
|
36
|
+
selected: { required: false, type: Boolean }
|
|
37
|
+
},
|
|
38
|
+
label: { required: false, type: String },
|
|
39
|
+
price: { required: false, type: Number },
|
|
40
|
+
stallCapacity: { required: false, type: Number }
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
_id: false
|
|
44
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
var dateTimeSchema = new MongooseSchema(
|
|
48
|
+
{
|
|
49
|
+
endDate: { required: true, type: String },
|
|
50
|
+
endTime: { required: true, type: String },
|
|
51
|
+
stallTypes: [StallTypeSchema],
|
|
52
|
+
startDate: { required: true, type: String },
|
|
53
|
+
startTime: { required: true, type: String }
|
|
54
|
+
},
|
|
55
|
+
{ _id: false }
|
|
56
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
57
|
+
);
|
|
58
|
+
var paymentInfoSchema = new MongooseSchema(
|
|
59
|
+
{
|
|
60
|
+
accountHolderName: { required: false, type: String },
|
|
61
|
+
accountNumber: { required: false, type: String },
|
|
62
|
+
link: { required: false, type: String },
|
|
63
|
+
paymentMethod: {
|
|
64
|
+
enum: Object.values(EnumPaymentMethod),
|
|
65
|
+
required: true,
|
|
66
|
+
type: String
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{ _id: false }
|
|
70
|
+
// Prevents Mongoose from creating an additional _id field
|
|
71
|
+
);
|
|
72
|
+
var requirementsSchema = new MongooseSchema(
|
|
73
|
+
{
|
|
74
|
+
category: { required: true, type: String },
|
|
75
|
+
label: { required: true, type: String },
|
|
76
|
+
value: { required: true, type: Boolean }
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
_id: false
|
|
80
|
+
// Prevents Mongoose from creating an additional _id field for
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
var schema = new MongooseSchema(
|
|
84
|
+
{
|
|
85
|
+
applicationDeadlineHours: { required: true, type: Number },
|
|
86
|
+
dateTime: [dateTimeSchema],
|
|
87
|
+
eventId: {
|
|
88
|
+
ref: "Event",
|
|
89
|
+
required: false,
|
|
90
|
+
type: mongoose.Schema.Types.ObjectId
|
|
91
|
+
},
|
|
92
|
+
packInTime: { required: true, type: Number },
|
|
93
|
+
paymentDueHours: { required: true, type: Number },
|
|
94
|
+
paymentInfo: [paymentInfoSchema],
|
|
95
|
+
requirements: [requirementsSchema]
|
|
96
|
+
},
|
|
97
|
+
{ timestamps: true }
|
|
98
|
+
);
|
|
99
|
+
var EventInfoModel = mongoose.models.EventInfo || mongoose.model("EventInfo", schema);
|
|
100
|
+
|
|
101
|
+
// src/mongoose/Relation.ts
|
|
102
|
+
var MongooseSchema2 = mongoose2.Schema;
|
|
103
|
+
var relationDatesSchema = new MongooseSchema2(
|
|
104
|
+
{
|
|
105
|
+
lastUpdateBy: {
|
|
106
|
+
resourceId: { required: false, type: String },
|
|
107
|
+
userEmail: { required: false, type: String }
|
|
108
|
+
},
|
|
109
|
+
paymentReference: { required: false, type: String },
|
|
110
|
+
stallType: StallTypeSchema,
|
|
111
|
+
startDate: { required: false, type: String },
|
|
112
|
+
startTime: { required: false, type: String },
|
|
113
|
+
status: {
|
|
114
|
+
enum: Object.values(EnumInviteStatus),
|
|
115
|
+
required: false,
|
|
116
|
+
type: String
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{ _id: false }
|
|
120
|
+
);
|
|
121
|
+
var RelationTypeSchema = new MongooseSchema2(
|
|
122
|
+
{
|
|
123
|
+
active: { default: true, required: true, type: Boolean },
|
|
124
|
+
chatId: {
|
|
125
|
+
ref: "Chat",
|
|
126
|
+
required: true,
|
|
127
|
+
type: mongoose2.Schema.Types.ObjectId
|
|
128
|
+
},
|
|
129
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
130
|
+
eventId: {
|
|
131
|
+
ref: "Event",
|
|
132
|
+
required: true,
|
|
133
|
+
type: mongoose2.Schema.Types.ObjectId
|
|
134
|
+
},
|
|
135
|
+
lastUpdateBy: {
|
|
136
|
+
enum: Object.values(EnumResourceType),
|
|
137
|
+
required: true,
|
|
138
|
+
type: String
|
|
139
|
+
},
|
|
140
|
+
relationDates: [relationDatesSchema],
|
|
141
|
+
relationType: {
|
|
142
|
+
enum: Object.values(EnumRelationResource),
|
|
143
|
+
required: true,
|
|
144
|
+
type: String
|
|
145
|
+
},
|
|
146
|
+
vendorId: {
|
|
147
|
+
ref: "Vendor",
|
|
148
|
+
required: true,
|
|
149
|
+
type: mongoose2.Schema.Types.ObjectId
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{ timestamps: true }
|
|
153
|
+
);
|
|
154
|
+
RelationTypeSchema.index({
|
|
155
|
+
"relationDates.startDate": 1,
|
|
156
|
+
"relationDates.startTime": 1,
|
|
157
|
+
"relationDates.status": 1
|
|
158
|
+
});
|
|
159
|
+
var RelationModel = mongoose2.models.Relation || mongoose2.model("Relation", RelationTypeSchema);
|
|
160
|
+
|
|
161
|
+
// src/mongoose/global.ts
|
|
162
|
+
var MongooseSchema3 = mongoose3.Schema;
|
|
163
|
+
var OwnerTypeSchema = new MongooseSchema3(
|
|
164
|
+
{
|
|
165
|
+
email: { required: true, type: String },
|
|
166
|
+
userId: {
|
|
167
|
+
ref: "User",
|
|
168
|
+
required: true,
|
|
169
|
+
type: mongoose3.Schema.Types.ObjectId
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
{ _id: false }
|
|
173
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
174
|
+
);
|
|
175
|
+
var SocialMediaTypeSchema = new MongooseSchema3(
|
|
176
|
+
{
|
|
177
|
+
link: { required: true, type: String },
|
|
178
|
+
name: { required: true, type: String }
|
|
179
|
+
},
|
|
180
|
+
{ _id: false }
|
|
181
|
+
// Prevents Mongoose from creating an additional _id field
|
|
182
|
+
);
|
|
183
|
+
var ResourceImageTypeSchema = new MongooseSchema3(
|
|
184
|
+
{
|
|
185
|
+
source: { required: false, type: String },
|
|
186
|
+
title: { required: false, type: String }
|
|
187
|
+
},
|
|
188
|
+
{ _id: false }
|
|
189
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
190
|
+
);
|
|
191
|
+
var SubCategorySchema = new MongooseSchema3(
|
|
192
|
+
{
|
|
193
|
+
id: { required: false, type: String },
|
|
194
|
+
items: [
|
|
195
|
+
{
|
|
196
|
+
id: { required: false, type: String },
|
|
197
|
+
name: { required: false, type: String }
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
name: { required: false, type: String }
|
|
201
|
+
},
|
|
202
|
+
{ _id: false }
|
|
203
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
204
|
+
);
|
|
205
|
+
var CategorySchema = new MongooseSchema3(
|
|
206
|
+
{
|
|
207
|
+
id: { required: true, type: String },
|
|
208
|
+
name: { required: true, type: String },
|
|
209
|
+
subcategories: [SubCategorySchema]
|
|
210
|
+
},
|
|
211
|
+
{ _id: false }
|
|
212
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
213
|
+
);
|
|
214
|
+
var PosterUsageTypeSchema = new MongooseSchema3(
|
|
215
|
+
{
|
|
216
|
+
count: { default: 0, required: false, type: Number },
|
|
217
|
+
month: { required: false, type: String }
|
|
218
|
+
},
|
|
219
|
+
{ _id: false }
|
|
220
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
221
|
+
);
|
|
222
|
+
var partnersSchema = new MongooseSchema3(
|
|
223
|
+
{
|
|
224
|
+
email: { required: false, type: String },
|
|
225
|
+
licence: {
|
|
226
|
+
enum: Object.values(EnumUserLicence),
|
|
227
|
+
required: false,
|
|
228
|
+
type: String
|
|
229
|
+
},
|
|
230
|
+
resourceId: {
|
|
231
|
+
required: false,
|
|
232
|
+
type: String
|
|
233
|
+
},
|
|
234
|
+
resourceType: {
|
|
235
|
+
enum: Object.values(EnumResourceType2),
|
|
236
|
+
required: false,
|
|
237
|
+
type: String
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
{ _id: false }
|
|
241
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
242
|
+
);
|
|
243
|
+
var ContactDetailsSchema = new MongooseSchema3(
|
|
244
|
+
{
|
|
245
|
+
email: { required: false, type: String },
|
|
246
|
+
landlinePhone: { required: false, type: String },
|
|
247
|
+
mobilePhone: { required: false, type: String }
|
|
248
|
+
},
|
|
249
|
+
{ _id: false }
|
|
250
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
251
|
+
);
|
|
252
|
+
var termsAgreementSchema = new MongooseSchema3(
|
|
253
|
+
{
|
|
254
|
+
appBuildNumber: { required: true, type: String },
|
|
255
|
+
appId: { required: true, type: String },
|
|
256
|
+
appVersion: { required: true, type: String },
|
|
257
|
+
brand: { required: true, type: String },
|
|
258
|
+
deviceName: { required: true, type: String },
|
|
259
|
+
installationId: { required: true, type: String },
|
|
260
|
+
manufacturer: { required: true, type: String },
|
|
261
|
+
modelName: { required: true, type: String },
|
|
262
|
+
osName: { required: true, type: String },
|
|
263
|
+
osVersion: { required: true, type: String },
|
|
264
|
+
termVersion: { required: true, type: String },
|
|
265
|
+
timestamp: { required: true, type: String }
|
|
266
|
+
},
|
|
267
|
+
{ _id: false }
|
|
268
|
+
);
|
|
269
|
+
var resourceRelationsSchema = new MongooseSchema3(
|
|
270
|
+
{
|
|
271
|
+
relationDates: {
|
|
272
|
+
default: [],
|
|
273
|
+
required: false,
|
|
274
|
+
type: [relationDatesSchema]
|
|
275
|
+
},
|
|
276
|
+
relationId: {
|
|
277
|
+
ref: "Relation",
|
|
278
|
+
required: false,
|
|
279
|
+
type: mongoose3.Schema.Types.ObjectId
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
{ _id: false }
|
|
283
|
+
);
|
|
284
|
+
var baseResourceFields = {
|
|
285
|
+
active: { default: false, required: true, type: Boolean },
|
|
286
|
+
adIds: {
|
|
287
|
+
ref: "Ad",
|
|
288
|
+
required: false,
|
|
289
|
+
type: [mongoose3.Schema.Types.ObjectId]
|
|
290
|
+
},
|
|
291
|
+
contactDetails: ContactDetailsSchema,
|
|
292
|
+
cover: ResourceImageTypeSchema,
|
|
293
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
294
|
+
description: { required: true, type: String },
|
|
295
|
+
images: [ResourceImageTypeSchema],
|
|
296
|
+
logo: ResourceImageTypeSchema,
|
|
297
|
+
name: { required: true, type: String },
|
|
298
|
+
owner: OwnerTypeSchema,
|
|
299
|
+
partners: {
|
|
300
|
+
required: false,
|
|
301
|
+
type: [partnersSchema]
|
|
302
|
+
},
|
|
303
|
+
posterUsage: PosterUsageTypeSchema,
|
|
304
|
+
promoCodes: { required: false, type: [String] },
|
|
305
|
+
region: { required: true, type: String },
|
|
306
|
+
relations: {
|
|
307
|
+
default: [],
|
|
308
|
+
required: false,
|
|
309
|
+
type: [resourceRelationsSchema]
|
|
310
|
+
},
|
|
311
|
+
socialMedia: [SocialMediaTypeSchema],
|
|
312
|
+
termsAgreement: termsAgreementSchema
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
// src/mongoose/Ad.ts
|
|
316
|
+
var MongooseSchema4 = mongoose4.Schema;
|
|
317
|
+
var schema2 = new MongooseSchema4(
|
|
318
|
+
{
|
|
319
|
+
active: { default: true, type: Boolean },
|
|
320
|
+
adStyle: {
|
|
321
|
+
default: EnumAdStyle.BLOOM,
|
|
322
|
+
enum: Object.values(EnumAdStyle),
|
|
323
|
+
required: true,
|
|
324
|
+
type: String
|
|
325
|
+
},
|
|
326
|
+
adType: {
|
|
327
|
+
default: EnumAdType.SPONSORED,
|
|
328
|
+
enum: Object.values(EnumAdType),
|
|
329
|
+
required: true,
|
|
330
|
+
type: String
|
|
331
|
+
},
|
|
332
|
+
// TODO: similar to ViewSchema
|
|
333
|
+
clicks: { default: 0, required: true, type: Number },
|
|
334
|
+
clui: { required: false, type: String },
|
|
335
|
+
end: { required: true, type: Date },
|
|
336
|
+
// TODO: similar to ViewSchema
|
|
337
|
+
impressions: { default: 0, required: true, type: Number },
|
|
338
|
+
resourceCover: { required: true, type: String },
|
|
339
|
+
resourceDescription: { required: true, type: String },
|
|
340
|
+
resourceId: { required: true, type: String },
|
|
341
|
+
resourceLogo: { required: false, type: String },
|
|
342
|
+
resourceName: { required: true, type: String },
|
|
343
|
+
resourceRegion: { required: true, type: String },
|
|
344
|
+
resourceType: {
|
|
345
|
+
enum: Object.values(EnumResourceType3),
|
|
346
|
+
required: true,
|
|
347
|
+
type: String
|
|
348
|
+
},
|
|
349
|
+
showOn: {
|
|
350
|
+
default: EnumAdShowOn.FRONT_PAGE,
|
|
351
|
+
enum: Object.values(EnumAdShowOn),
|
|
352
|
+
required: true,
|
|
353
|
+
type: String
|
|
354
|
+
},
|
|
355
|
+
socialMedia: [SocialMediaTypeSchema],
|
|
356
|
+
start: { required: true, type: Date },
|
|
357
|
+
status: {
|
|
358
|
+
default: EnumAdStatus.ACTIVE,
|
|
359
|
+
enum: Object.values(EnumAdStatus),
|
|
360
|
+
required: true,
|
|
361
|
+
type: String
|
|
362
|
+
},
|
|
363
|
+
targetRegion: { required: false, type: String }
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
timestamps: true
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
schema2.index({
|
|
370
|
+
end: 1,
|
|
371
|
+
start: 1,
|
|
372
|
+
status: 1
|
|
373
|
+
});
|
|
374
|
+
var AdModel = mongoose4.models.Ad || mongoose4.model("Ad", schema2);
|
|
375
|
+
|
|
376
|
+
// src/mongoose/Chat.ts
|
|
377
|
+
import {
|
|
378
|
+
EnumChatType
|
|
379
|
+
} from "@timardex/cluemart-shared";
|
|
380
|
+
import mongoose5 from "mongoose";
|
|
381
|
+
var MongooseSchema5 = mongoose5.Schema;
|
|
382
|
+
var MessageSchema = new MongooseSchema5(
|
|
383
|
+
{
|
|
384
|
+
content: { required: true, type: String },
|
|
385
|
+
senderAvatar: { required: false, type: String },
|
|
386
|
+
senderId: {
|
|
387
|
+
ref: "User",
|
|
388
|
+
required: true,
|
|
389
|
+
type: mongoose5.Schema.Types.ObjectId
|
|
390
|
+
},
|
|
391
|
+
senderName: { required: true, type: String }
|
|
392
|
+
},
|
|
393
|
+
{ timestamps: true }
|
|
394
|
+
);
|
|
395
|
+
var ParticipantSchema = new MongooseSchema5(
|
|
396
|
+
{
|
|
397
|
+
active: { default: true, required: true, type: Boolean },
|
|
398
|
+
email: { required: true, type: String },
|
|
399
|
+
userId: {
|
|
400
|
+
ref: "User",
|
|
401
|
+
required: true,
|
|
402
|
+
type: mongoose5.Schema.Types.ObjectId
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
{ _id: false }
|
|
406
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
407
|
+
);
|
|
408
|
+
var ChatSchema = new MongooseSchema5(
|
|
409
|
+
{
|
|
410
|
+
active: { default: true, required: true, type: Boolean },
|
|
411
|
+
chatName: { required: true, type: String },
|
|
412
|
+
chatType: {
|
|
413
|
+
enum: Object.values(EnumChatType),
|
|
414
|
+
required: true,
|
|
415
|
+
type: String
|
|
416
|
+
},
|
|
417
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
418
|
+
messages: [MessageSchema],
|
|
419
|
+
participants: [ParticipantSchema],
|
|
420
|
+
resourceInfo: {
|
|
421
|
+
eventId: {
|
|
422
|
+
ref: "Event",
|
|
423
|
+
required: false,
|
|
424
|
+
type: mongoose5.Schema.Types.ObjectId
|
|
425
|
+
},
|
|
426
|
+
vendorId: {
|
|
427
|
+
ref: "Vendor",
|
|
428
|
+
required: false,
|
|
429
|
+
type: mongoose5.Schema.Types.ObjectId
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
timestamps: true
|
|
435
|
+
}
|
|
436
|
+
);
|
|
437
|
+
var ChatModel = mongoose5.models.Chat || mongoose5.model("Chat", ChatSchema);
|
|
438
|
+
|
|
439
|
+
// src/mongoose/Notification.ts
|
|
440
|
+
import {
|
|
441
|
+
EnumNotificationResourceType,
|
|
442
|
+
EnumNotificationType
|
|
443
|
+
} from "@timardex/cluemart-shared";
|
|
444
|
+
import mongoose6 from "mongoose";
|
|
445
|
+
var MongooseSchema6 = mongoose6.Schema;
|
|
446
|
+
var schema3 = new MongooseSchema6(
|
|
447
|
+
{
|
|
448
|
+
data: {
|
|
449
|
+
resourceId: { required: true, type: String },
|
|
450
|
+
resourceName: { required: true, type: String },
|
|
451
|
+
resourceType: {
|
|
452
|
+
enum: Object.values(EnumNotificationResourceType),
|
|
453
|
+
required: true,
|
|
454
|
+
type: String
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
isRead: { default: false, index: true, required: true, type: Boolean },
|
|
458
|
+
message: { required: true, type: String },
|
|
459
|
+
title: { required: true, type: String },
|
|
460
|
+
type: {
|
|
461
|
+
default: EnumNotificationType.SYSTEM,
|
|
462
|
+
enum: Object.values(EnumNotificationType),
|
|
463
|
+
required: true,
|
|
464
|
+
type: String
|
|
465
|
+
},
|
|
466
|
+
userId: {
|
|
467
|
+
ref: "User",
|
|
468
|
+
required: true,
|
|
469
|
+
type: mongoose6.Schema.Types.ObjectId
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
{ timestamps: true }
|
|
473
|
+
);
|
|
474
|
+
schema3.index({ isRead: 1, userId: 1 });
|
|
475
|
+
schema3.index({ createdAt: -1, userId: 1 });
|
|
476
|
+
var NotificationModel = mongoose6.models.Notification || mongoose6.model("Notification", schema3);
|
|
477
|
+
|
|
478
|
+
// src/mongoose/PushToken.ts
|
|
479
|
+
import { EnumOSPlatform } from "@timardex/cluemart-shared/enums";
|
|
480
|
+
import mongoose7 from "mongoose";
|
|
481
|
+
var MongooseSchema7 = mongoose7.Schema;
|
|
482
|
+
var schema4 = new MongooseSchema7(
|
|
483
|
+
{
|
|
484
|
+
platform: {
|
|
485
|
+
enum: Object.values(EnumOSPlatform),
|
|
486
|
+
required: true,
|
|
487
|
+
type: String
|
|
488
|
+
},
|
|
489
|
+
token: { required: true, type: String },
|
|
490
|
+
userId: { required: true, type: mongoose7.Schema.Types.ObjectId }
|
|
491
|
+
},
|
|
492
|
+
{ timestamps: true }
|
|
493
|
+
);
|
|
494
|
+
var PushTokenModel = mongoose7.models.PushToken || mongoose7.model("PushToken", schema4);
|
|
495
|
+
|
|
496
|
+
// src/mongoose/ResourceActivity.ts
|
|
497
|
+
import {
|
|
498
|
+
EnumActivity,
|
|
499
|
+
EnumOSPlatform as EnumOSPlatform2,
|
|
500
|
+
EnumResourceType as EnumResourceType4
|
|
501
|
+
} from "@timardex/cluemart-shared";
|
|
502
|
+
import mongoose8 from "mongoose";
|
|
503
|
+
var MongooseSchema8 = mongoose8.Schema;
|
|
504
|
+
var ActivitySchema = new MongooseSchema8(
|
|
505
|
+
{
|
|
506
|
+
activityType: {
|
|
507
|
+
enum: Object.values(EnumActivity),
|
|
508
|
+
required: true,
|
|
509
|
+
type: String
|
|
510
|
+
},
|
|
511
|
+
location: {
|
|
512
|
+
coordinates: {
|
|
513
|
+
required: false,
|
|
514
|
+
type: [Number]
|
|
515
|
+
},
|
|
516
|
+
type: {
|
|
517
|
+
default: "Point",
|
|
518
|
+
enum: ["Point"],
|
|
519
|
+
required: false,
|
|
520
|
+
type: String
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
startDate: { required: false, type: String },
|
|
524
|
+
startTime: { required: false, type: String },
|
|
525
|
+
timestamp: { default: Date.now, type: Date },
|
|
526
|
+
userAgent: {
|
|
527
|
+
enum: Object.values(EnumOSPlatform2),
|
|
528
|
+
required: true,
|
|
529
|
+
type: String
|
|
530
|
+
},
|
|
531
|
+
userId: { required: false, type: String }
|
|
532
|
+
},
|
|
533
|
+
{ _id: false }
|
|
534
|
+
);
|
|
535
|
+
var schema5 = new MongooseSchema8(
|
|
536
|
+
{
|
|
537
|
+
activity: { default: [], type: [ActivitySchema] },
|
|
538
|
+
resourceId: { required: true, type: String },
|
|
539
|
+
resourceType: {
|
|
540
|
+
enum: Object.values(EnumResourceType4),
|
|
541
|
+
required: true,
|
|
542
|
+
type: String
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
{ timestamps: true }
|
|
546
|
+
);
|
|
547
|
+
schema5.index({ resourceId: 1, resourceType: 1 }, { unique: true });
|
|
548
|
+
schema5.index({ "views.location": "2dsphere" });
|
|
549
|
+
var ResourceActivityModel = mongoose8.models.ResourceActivity || mongoose8.model("ResourceActivity", schema5);
|
|
550
|
+
|
|
551
|
+
// src/mongoose/Testers.ts
|
|
552
|
+
import {
|
|
553
|
+
EnumOSPlatform as EnumOSPlatform3,
|
|
554
|
+
EnumResourceType as EnumResourceType5
|
|
555
|
+
} from "@timardex/cluemart-shared";
|
|
556
|
+
import mongoose9 from "mongoose";
|
|
557
|
+
var MongooseSchema9 = mongoose9.Schema;
|
|
558
|
+
var TesterSchema = new MongooseSchema9(
|
|
559
|
+
{
|
|
560
|
+
active: { default: false, required: true, type: Boolean },
|
|
561
|
+
categories: [CategorySchema],
|
|
562
|
+
companyName: { required: true, type: String },
|
|
563
|
+
email: { required: true, type: String },
|
|
564
|
+
firstName: { required: true, type: String },
|
|
565
|
+
lastName: { required: true, type: String },
|
|
566
|
+
osType: {
|
|
567
|
+
enum: Object.values(EnumOSPlatform3),
|
|
568
|
+
required: true,
|
|
569
|
+
type: String
|
|
570
|
+
},
|
|
571
|
+
region: { required: true, type: String },
|
|
572
|
+
resourceType: {
|
|
573
|
+
enum: Object.values(EnumResourceType5),
|
|
574
|
+
required: true,
|
|
575
|
+
type: String
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
timestamps: true
|
|
580
|
+
}
|
|
581
|
+
);
|
|
582
|
+
var TesterModel = mongoose9.models.Tester || mongoose9.model("Tester", TesterSchema);
|
|
583
|
+
|
|
584
|
+
// src/mongoose/User.ts
|
|
585
|
+
import {
|
|
586
|
+
EnumOSPlatform as EnumOSPlatform4,
|
|
587
|
+
EnumUserLicence as EnumUserLicence2,
|
|
588
|
+
EnumUserRole
|
|
589
|
+
} from "@timardex/cluemart-shared";
|
|
590
|
+
import mongoose10 from "mongoose";
|
|
591
|
+
var MongooseSchema10 = mongoose10.Schema;
|
|
592
|
+
var userActivityEventSchema = new MongooseSchema10(
|
|
593
|
+
{
|
|
594
|
+
resourceId: {
|
|
595
|
+
ref: "Event",
|
|
596
|
+
required: false,
|
|
597
|
+
type: mongoose10.Schema.Types.ObjectId
|
|
598
|
+
},
|
|
599
|
+
startDate: { required: false, type: String },
|
|
600
|
+
startTime: { required: false, type: String }
|
|
601
|
+
},
|
|
602
|
+
{ _id: false }
|
|
603
|
+
);
|
|
604
|
+
var userActivityFavouritesSchema = new MongooseSchema10(
|
|
605
|
+
{
|
|
606
|
+
events: {
|
|
607
|
+
ref: "Event",
|
|
608
|
+
required: false,
|
|
609
|
+
type: [mongoose10.Schema.Types.ObjectId]
|
|
610
|
+
},
|
|
611
|
+
vendors: {
|
|
612
|
+
ref: "Vendor",
|
|
613
|
+
required: false,
|
|
614
|
+
type: [mongoose10.Schema.Types.ObjectId]
|
|
615
|
+
}
|
|
616
|
+
},
|
|
617
|
+
{ _id: false }
|
|
618
|
+
);
|
|
619
|
+
var schema6 = new MongooseSchema10(
|
|
620
|
+
{
|
|
621
|
+
active: { default: false, required: true, type: Boolean },
|
|
622
|
+
avatar: ResourceImageTypeSchema,
|
|
623
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
624
|
+
email: { required: true, type: String },
|
|
625
|
+
events: {
|
|
626
|
+
ref: "Event",
|
|
627
|
+
required: false,
|
|
628
|
+
type: [mongoose10.Schema.Types.ObjectId]
|
|
629
|
+
},
|
|
630
|
+
firstName: { required: true, type: String },
|
|
631
|
+
isTester: { default: false, required: false, type: Boolean },
|
|
632
|
+
lastName: { required: true, type: String },
|
|
633
|
+
licences: {
|
|
634
|
+
enum: Object.values(EnumUserLicence2),
|
|
635
|
+
required: false,
|
|
636
|
+
type: [String]
|
|
637
|
+
},
|
|
638
|
+
partners: {
|
|
639
|
+
required: false,
|
|
640
|
+
type: [partnersSchema]
|
|
641
|
+
},
|
|
642
|
+
password: { required: true, type: String },
|
|
643
|
+
platform: {
|
|
644
|
+
enum: Object.values(EnumOSPlatform4),
|
|
645
|
+
required: false,
|
|
646
|
+
type: String
|
|
647
|
+
},
|
|
648
|
+
preferredRegion: {
|
|
649
|
+
required: true,
|
|
650
|
+
type: String
|
|
651
|
+
},
|
|
652
|
+
refreshToken: {
|
|
653
|
+
required: false,
|
|
654
|
+
type: String
|
|
655
|
+
},
|
|
656
|
+
role: {
|
|
657
|
+
default: EnumUserRole.CUSTOMER,
|
|
658
|
+
enum: Object.values(EnumUserRole),
|
|
659
|
+
required: true,
|
|
660
|
+
type: String
|
|
661
|
+
},
|
|
662
|
+
termsAgreement: termsAgreementSchema,
|
|
663
|
+
userActivity: {
|
|
664
|
+
favourites: {
|
|
665
|
+
default: () => ({ events: [], vendors: [] }),
|
|
666
|
+
type: userActivityFavouritesSchema
|
|
667
|
+
},
|
|
668
|
+
going: {
|
|
669
|
+
events: [userActivityEventSchema]
|
|
670
|
+
},
|
|
671
|
+
interested: {
|
|
672
|
+
events: [userActivityEventSchema]
|
|
673
|
+
},
|
|
674
|
+
present: {
|
|
675
|
+
events: [userActivityEventSchema]
|
|
676
|
+
}
|
|
677
|
+
},
|
|
678
|
+
vendor: {
|
|
679
|
+
ref: "Vendor",
|
|
680
|
+
required: false,
|
|
681
|
+
type: mongoose10.Schema.Types.ObjectId
|
|
682
|
+
}
|
|
683
|
+
},
|
|
684
|
+
{ timestamps: true }
|
|
685
|
+
);
|
|
686
|
+
schema6.index({ "partners.email": 1 });
|
|
687
|
+
var UserModel = mongoose10.models.User || mongoose10.model("User", schema6);
|
|
688
|
+
|
|
689
|
+
// src/mongoose/VerificationToken.ts
|
|
690
|
+
import mongoose11 from "mongoose";
|
|
691
|
+
var MongooseSchema11 = mongoose11.Schema;
|
|
692
|
+
var schema7 = new MongooseSchema11(
|
|
693
|
+
{
|
|
694
|
+
createdAt: {
|
|
695
|
+
default: Date.now,
|
|
696
|
+
expires: 24 * 60 * 60,
|
|
697
|
+
// 24 hours in seconds (MongoDB TTL expects seconds)
|
|
698
|
+
required: true,
|
|
699
|
+
type: Date
|
|
700
|
+
},
|
|
701
|
+
// Token expires after 1 day
|
|
702
|
+
email: { required: true, type: String },
|
|
703
|
+
verificationToken: { required: true, type: String }
|
|
704
|
+
},
|
|
705
|
+
{ timestamps: true }
|
|
706
|
+
);
|
|
707
|
+
var VerificationTokenModel = mongoose11.models.VerificationToken || mongoose11.model("VerificationToken", schema7);
|
|
708
|
+
|
|
709
|
+
// src/mongoose/vendor/Vendor.ts
|
|
710
|
+
import {
|
|
711
|
+
EnumVendorType
|
|
712
|
+
} from "@timardex/cluemart-shared";
|
|
713
|
+
import mongoose12 from "mongoose";
|
|
714
|
+
var MongooseSchema12 = mongoose12.Schema;
|
|
715
|
+
var MenuTypeSchema = new MongooseSchema12(
|
|
716
|
+
{
|
|
717
|
+
description: { required: false, type: String },
|
|
718
|
+
name: { required: false, type: String },
|
|
719
|
+
price: { required: false, type: Number },
|
|
720
|
+
productGroups: { required: false, type: [String] }
|
|
721
|
+
},
|
|
722
|
+
{ _id: false }
|
|
723
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
724
|
+
);
|
|
725
|
+
var LocationsSchema = new MongooseSchema12(
|
|
726
|
+
{
|
|
727
|
+
dateTime: {
|
|
728
|
+
endDate: { required: false, type: String },
|
|
729
|
+
endTime: { required: false, type: String },
|
|
730
|
+
startDate: { required: false, type: String },
|
|
731
|
+
startTime: { required: false, type: String }
|
|
732
|
+
},
|
|
733
|
+
description: { required: false, type: String },
|
|
734
|
+
location: {
|
|
735
|
+
city: { required: false, type: String },
|
|
736
|
+
coordinates: {
|
|
737
|
+
required: false,
|
|
738
|
+
type: [Number]
|
|
739
|
+
// [longitude, latitude]
|
|
740
|
+
},
|
|
741
|
+
country: { required: false, type: String },
|
|
742
|
+
fullAddress: { required: false, type: String },
|
|
743
|
+
latitude: { required: false, type: Number },
|
|
744
|
+
longitude: { required: false, type: Number },
|
|
745
|
+
region: { required: false, type: String },
|
|
746
|
+
type: { required: false, type: String }
|
|
747
|
+
// Mongoose GeoJSON type
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
{ _id: false }
|
|
751
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
752
|
+
);
|
|
753
|
+
var schema8 = new MongooseSchema12(
|
|
754
|
+
{
|
|
755
|
+
...baseResourceFields,
|
|
756
|
+
// Importing base resource fields from global.ts
|
|
757
|
+
availability: {
|
|
758
|
+
corporate: { default: false, required: false, type: Boolean },
|
|
759
|
+
private: { default: false, required: false, type: Boolean },
|
|
760
|
+
school: { default: false, required: false, type: Boolean }
|
|
761
|
+
},
|
|
762
|
+
categories: [CategorySchema],
|
|
763
|
+
locations: [LocationsSchema],
|
|
764
|
+
multiLocation: { required: true, type: Boolean },
|
|
765
|
+
products: [MenuTypeSchema],
|
|
766
|
+
vendorInfoId: {
|
|
767
|
+
ref: "VendorInfo",
|
|
768
|
+
required: false,
|
|
769
|
+
type: mongoose12.Schema.Types.ObjectId
|
|
770
|
+
},
|
|
771
|
+
vendorType: {
|
|
772
|
+
enum: Object.values(EnumVendorType),
|
|
773
|
+
required: true,
|
|
774
|
+
type: String
|
|
775
|
+
}
|
|
776
|
+
},
|
|
777
|
+
{ timestamps: true }
|
|
778
|
+
);
|
|
779
|
+
schema8.index({ name: 1 });
|
|
780
|
+
schema8.index({ description: 1 });
|
|
781
|
+
schema8.index({ region: 1 });
|
|
782
|
+
schema8.index({ "categories.name": 1 });
|
|
783
|
+
schema8.index({ "partners.email": 1 });
|
|
784
|
+
var VendorModel = mongoose12.models.Vendor || mongoose12.model("Vendor", schema8);
|
|
785
|
+
|
|
786
|
+
// src/mongoose/vendor/VendorInfo.ts
|
|
787
|
+
import {
|
|
788
|
+
EnumFoodFlavor
|
|
789
|
+
} from "@timardex/cluemart-shared";
|
|
790
|
+
import mongoose13 from "mongoose";
|
|
791
|
+
var MongooseSchema13 = mongoose13.Schema;
|
|
792
|
+
var AttributesSchema = new MongooseSchema13(
|
|
793
|
+
{
|
|
794
|
+
details: { required: false, type: String },
|
|
795
|
+
isRequired: { default: false, required: true, type: Boolean }
|
|
796
|
+
},
|
|
797
|
+
{ _id: false }
|
|
798
|
+
);
|
|
799
|
+
var schema9 = new MongooseSchema13(
|
|
800
|
+
{
|
|
801
|
+
compliance: {
|
|
802
|
+
foodBeverageLicense: { default: false, required: false, type: Boolean },
|
|
803
|
+
liabilityInsurance: { default: false, required: false, type: Boolean }
|
|
804
|
+
},
|
|
805
|
+
documents: [ResourceImageTypeSchema],
|
|
806
|
+
product: {
|
|
807
|
+
foodFlavors: {
|
|
808
|
+
enum: Object.values(EnumFoodFlavor),
|
|
809
|
+
required: true,
|
|
810
|
+
type: [String]
|
|
811
|
+
},
|
|
812
|
+
packaging: { required: true, type: [String] },
|
|
813
|
+
priceRange: {
|
|
814
|
+
max: { required: true, type: Number },
|
|
815
|
+
min: { required: true, type: Number }
|
|
816
|
+
},
|
|
817
|
+
producedIn: { required: true, type: [String] }
|
|
818
|
+
},
|
|
819
|
+
requirements: {
|
|
820
|
+
electricity: AttributesSchema,
|
|
821
|
+
gazebo: AttributesSchema,
|
|
822
|
+
table: AttributesSchema
|
|
823
|
+
},
|
|
824
|
+
stallInfo: {
|
|
825
|
+
size: {
|
|
826
|
+
depth: { required: true, type: Number },
|
|
827
|
+
width: { required: true, type: Number }
|
|
828
|
+
}
|
|
829
|
+
},
|
|
830
|
+
vendorId: {
|
|
831
|
+
ref: "Vendor",
|
|
832
|
+
required: true,
|
|
833
|
+
type: mongoose13.Schema.Types.ObjectId
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
{ timestamps: true }
|
|
837
|
+
);
|
|
838
|
+
var VendorInfoModel = mongoose13.models.VendorInfo || mongoose13.model("VendorInfo", schema9);
|
|
839
|
+
|
|
840
|
+
// src/mongoose/event/Event.ts
|
|
841
|
+
import {
|
|
842
|
+
EnumEventType
|
|
843
|
+
} from "@timardex/cluemart-shared";
|
|
844
|
+
import mongoose14 from "mongoose";
|
|
845
|
+
var MongooseSchema14 = mongoose14.Schema;
|
|
846
|
+
var locationsSchema = new MongooseSchema14(
|
|
847
|
+
{
|
|
848
|
+
city: { required: true, type: String },
|
|
849
|
+
coordinates: {
|
|
850
|
+
required: true,
|
|
851
|
+
type: [Number]
|
|
852
|
+
// [longitude, latitude]
|
|
853
|
+
},
|
|
854
|
+
country: { required: true, type: String },
|
|
855
|
+
fullAddress: { required: true, type: String },
|
|
856
|
+
latitude: { required: true, type: Number },
|
|
857
|
+
longitude: { required: true, type: Number },
|
|
858
|
+
region: { required: true, type: String },
|
|
859
|
+
type: {
|
|
860
|
+
default: "Point",
|
|
861
|
+
enum: ["Point"],
|
|
862
|
+
required: true,
|
|
863
|
+
type: String
|
|
864
|
+
}
|
|
865
|
+
},
|
|
866
|
+
{ _id: false }
|
|
867
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
868
|
+
);
|
|
869
|
+
var dateTimeSchema2 = new MongooseSchema14(
|
|
870
|
+
{
|
|
871
|
+
endDate: { required: true, type: String },
|
|
872
|
+
endTime: { required: true, type: String },
|
|
873
|
+
startDate: { required: true, type: String },
|
|
874
|
+
startTime: { required: true, type: String }
|
|
875
|
+
},
|
|
876
|
+
{ _id: false }
|
|
877
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
878
|
+
);
|
|
879
|
+
var schema10 = new MongooseSchema14(
|
|
880
|
+
{
|
|
881
|
+
...baseResourceFields,
|
|
882
|
+
// Importing base resource fields from global.ts
|
|
883
|
+
dateTime: [dateTimeSchema2],
|
|
884
|
+
eventInfoId: {
|
|
885
|
+
ref: "EventInfo",
|
|
886
|
+
required: false,
|
|
887
|
+
type: mongoose14.Schema.Types.ObjectId
|
|
888
|
+
},
|
|
889
|
+
eventType: {
|
|
890
|
+
enum: Object.values(EnumEventType),
|
|
891
|
+
required: true,
|
|
892
|
+
type: String
|
|
893
|
+
},
|
|
894
|
+
location: {
|
|
895
|
+
required: true,
|
|
896
|
+
type: locationsSchema
|
|
897
|
+
},
|
|
898
|
+
nzbn: { required: true, type: String },
|
|
899
|
+
provider: { required: false, type: String },
|
|
900
|
+
rainOrShine: { required: true, type: Boolean },
|
|
901
|
+
tags: { required: true, type: [String] }
|
|
902
|
+
},
|
|
903
|
+
{ timestamps: true }
|
|
904
|
+
);
|
|
905
|
+
schema10.index({ name: 1 });
|
|
906
|
+
schema10.index({ description: 1 });
|
|
907
|
+
schema10.index({ region: 1 });
|
|
908
|
+
schema10.index({ location: "2dsphere" });
|
|
909
|
+
schema10.index({ tags: 1 });
|
|
910
|
+
schema10.index({ "partners.email": 1 });
|
|
911
|
+
var EventModel = mongoose14.models.Event || mongoose14.model("Event", schema10);
|
|
912
|
+
|
|
913
|
+
export {
|
|
914
|
+
StallTypeSchema,
|
|
915
|
+
EventInfoModel,
|
|
916
|
+
relationDatesSchema,
|
|
917
|
+
RelationTypeSchema,
|
|
918
|
+
RelationModel,
|
|
919
|
+
SocialMediaTypeSchema,
|
|
920
|
+
ResourceImageTypeSchema,
|
|
921
|
+
CategorySchema,
|
|
922
|
+
partnersSchema,
|
|
923
|
+
termsAgreementSchema,
|
|
924
|
+
baseResourceFields,
|
|
925
|
+
AdModel,
|
|
926
|
+
ParticipantSchema,
|
|
927
|
+
ChatModel,
|
|
928
|
+
NotificationModel,
|
|
929
|
+
PushTokenModel,
|
|
930
|
+
ResourceActivityModel,
|
|
931
|
+
TesterModel,
|
|
932
|
+
UserModel,
|
|
933
|
+
VerificationTokenModel,
|
|
934
|
+
VendorModel,
|
|
935
|
+
VendorInfoModel,
|
|
936
|
+
EventModel
|
|
937
|
+
};
|
|
938
|
+
//# sourceMappingURL=chunk-OKDYM6JS.mjs.map
|