@timardex/cluemart-server-shared 1.0.179 → 1.0.200
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-Ctmtatmi.d.mts → Chat-DYkhie3G.d.mts} +2 -4
- package/dist/{Chat-Ctmtatmi.d.ts → Chat-DYkhie3G.d.ts} +2 -4
- package/dist/{Relation-BQhULTU-.d.mts → Relation-1llDbRjW.d.ts} +4 -4
- package/dist/{Relation-Dvgd2CFi.d.ts → Relation-BBXiEM1-.d.mts} +4 -4
- package/dist/{chunk-QHPLDTUG.mjs → chunk-MBUS572I.mjs} +78 -30
- package/dist/chunk-MBUS572I.mjs.map +1 -0
- package/dist/index.cjs +79 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +7 -21
- package/dist/index.d.ts +7 -21
- package/dist/index.mjs +79 -31
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +77 -29
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +4 -13
- package/dist/mongoose/index.d.ts +4 -13
- package/dist/mongoose/index.mjs +1 -1
- package/dist/service/index.cjs +79 -31
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +4 -7
- package/dist/service/index.d.ts +4 -7
- package/dist/service/index.mjs +3 -3
- package/dist/service/index.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/chunk-QHPLDTUG.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
|
|
2
|
-
import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType, GameType, GameDocType, SchoolType, EnumUserLicence, DateTimeWithPriceType } from '@timardex/cluemart-shared';
|
|
2
|
+
import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, PosterUsageType, GoogleImportedMarket, PushTokenType, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType, GameType, GameDocType, SchoolType, EnumUserLicence, EventListItemType, DateTimeWithPriceType } from '@timardex/cluemart-shared';
|
|
3
3
|
import mongoose from 'mongoose';
|
|
4
4
|
export { default as mongoose } from 'mongoose';
|
|
5
5
|
import { NotificationCount, DateTimeType as DateTimeType$1 } from '@timardex/cluemart-shared/types';
|
|
6
6
|
import express from 'express';
|
|
7
7
|
export { default as express } from 'express';
|
|
8
|
-
import { EnumOSPlatform } from '@timardex/cluemart-shared/enums';
|
|
9
8
|
|
|
10
9
|
declare const AdModel: mongoose.Model<AdType, {}, {}, {}, mongoose.Document<unknown, {}, AdType, {}, {}> & AdType & Required<{
|
|
11
10
|
_id: string;
|
|
@@ -62,13 +61,11 @@ interface GraphQLContext {
|
|
|
62
61
|
type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
|
|
63
62
|
senderId: ObjectId;
|
|
64
63
|
};
|
|
65
|
-
type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"
|
|
64
|
+
type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"> & {
|
|
66
65
|
userId: ObjectId;
|
|
67
|
-
createdAt: Date;
|
|
68
66
|
};
|
|
69
|
-
type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"
|
|
67
|
+
type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"> & {
|
|
70
68
|
userId: ObjectId;
|
|
71
|
-
seenAt: Date;
|
|
72
69
|
};
|
|
73
70
|
type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
|
|
74
71
|
senderId: ObjectId;
|
|
@@ -411,14 +408,6 @@ declare const GoogleImportedMarketModel: mongoose.Model<SchemaGoogleImportedMark
|
|
|
411
408
|
__v: number;
|
|
412
409
|
}, any>;
|
|
413
410
|
|
|
414
|
-
type PushTokenType = {
|
|
415
|
-
_id: string;
|
|
416
|
-
createdAt: Date;
|
|
417
|
-
platform: EnumOSPlatform;
|
|
418
|
-
token: string;
|
|
419
|
-
updatedAt: Date;
|
|
420
|
-
userId: string;
|
|
421
|
-
};
|
|
422
411
|
type SchemaPushTokenType = Omit<PushTokenType, "userId"> & {
|
|
423
412
|
userId: ObjectId;
|
|
424
413
|
};
|
|
@@ -439,7 +428,7 @@ declare const relationDatesSchema: mongoose.Schema<RelationDate, mongoose.Model<
|
|
|
439
428
|
} & {
|
|
440
429
|
__v: number;
|
|
441
430
|
}>;
|
|
442
|
-
type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId"> & {
|
|
431
|
+
type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId" | "apiMessage"> & {
|
|
443
432
|
eventId: ObjectId;
|
|
444
433
|
vendorId: ObjectId;
|
|
445
434
|
chatId: ObjectId;
|
|
@@ -449,7 +438,7 @@ type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId">
|
|
|
449
438
|
* It is used to define the structure of the relation type in the database.
|
|
450
439
|
* The schema is used by Mongoose to create a model for the relation type.
|
|
451
440
|
*/
|
|
452
|
-
declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.Model<SchemaRelationType, any, any, any, mongoose.Document<unknown, any, SchemaRelationType, any, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId"> & {
|
|
441
|
+
declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.Model<SchemaRelationType, any, any, any, mongoose.Document<unknown, any, SchemaRelationType, any, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId" | "apiMessage"> & {
|
|
453
442
|
eventId: ObjectId;
|
|
454
443
|
vendorId: ObjectId;
|
|
455
444
|
chatId: ObjectId;
|
|
@@ -462,7 +451,7 @@ declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.M
|
|
|
462
451
|
}> & {
|
|
463
452
|
__v: number;
|
|
464
453
|
}>;
|
|
465
|
-
declare const RelationModel: mongoose.Model<SchemaRelationType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaRelationType, {}, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId"> & {
|
|
454
|
+
declare const RelationModel: mongoose.Model<SchemaRelationType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaRelationType, {}, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId" | "apiMessage"> & {
|
|
466
455
|
eventId: ObjectId;
|
|
467
456
|
vendorId: ObjectId;
|
|
468
457
|
chatId: ObjectId;
|
|
@@ -722,10 +711,7 @@ declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: E
|
|
|
722
711
|
*/
|
|
723
712
|
declare function convertObjectIdsToStrings(obj: any): any;
|
|
724
713
|
|
|
725
|
-
type EventOrMarket =
|
|
726
|
-
_id: ObjectId | string;
|
|
727
|
-
name: string;
|
|
728
|
-
} | null;
|
|
714
|
+
type EventOrMarket = Pick<EventListItemType, "_id" | "name"> | null;
|
|
729
715
|
/**
|
|
730
716
|
* This function attempts to find an Event or a Google Imported Market by the given resource ID.
|
|
731
717
|
* It first normalizes the resource ID to a string format, then performs parallel queries to both collections.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
|
|
2
|
-
import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType, GameType, GameDocType, SchoolType, EnumUserLicence, DateTimeWithPriceType } from '@timardex/cluemart-shared';
|
|
2
|
+
import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, PosterUsageType, GoogleImportedMarket, PushTokenType, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType, GameType, GameDocType, SchoolType, EnumUserLicence, EventListItemType, DateTimeWithPriceType } from '@timardex/cluemart-shared';
|
|
3
3
|
import mongoose from 'mongoose';
|
|
4
4
|
export { default as mongoose } from 'mongoose';
|
|
5
5
|
import { NotificationCount, DateTimeType as DateTimeType$1 } from '@timardex/cluemart-shared/types';
|
|
6
6
|
import express from 'express';
|
|
7
7
|
export { default as express } from 'express';
|
|
8
|
-
import { EnumOSPlatform } from '@timardex/cluemart-shared/enums';
|
|
9
8
|
|
|
10
9
|
declare const AdModel: mongoose.Model<AdType, {}, {}, {}, mongoose.Document<unknown, {}, AdType, {}, {}> & AdType & Required<{
|
|
11
10
|
_id: string;
|
|
@@ -62,13 +61,11 @@ interface GraphQLContext {
|
|
|
62
61
|
type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
|
|
63
62
|
senderId: ObjectId;
|
|
64
63
|
};
|
|
65
|
-
type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"
|
|
64
|
+
type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"> & {
|
|
66
65
|
userId: ObjectId;
|
|
67
|
-
createdAt: Date;
|
|
68
66
|
};
|
|
69
|
-
type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"
|
|
67
|
+
type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"> & {
|
|
70
68
|
userId: ObjectId;
|
|
71
|
-
seenAt: Date;
|
|
72
69
|
};
|
|
73
70
|
type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
|
|
74
71
|
senderId: ObjectId;
|
|
@@ -411,14 +408,6 @@ declare const GoogleImportedMarketModel: mongoose.Model<SchemaGoogleImportedMark
|
|
|
411
408
|
__v: number;
|
|
412
409
|
}, any>;
|
|
413
410
|
|
|
414
|
-
type PushTokenType = {
|
|
415
|
-
_id: string;
|
|
416
|
-
createdAt: Date;
|
|
417
|
-
platform: EnumOSPlatform;
|
|
418
|
-
token: string;
|
|
419
|
-
updatedAt: Date;
|
|
420
|
-
userId: string;
|
|
421
|
-
};
|
|
422
411
|
type SchemaPushTokenType = Omit<PushTokenType, "userId"> & {
|
|
423
412
|
userId: ObjectId;
|
|
424
413
|
};
|
|
@@ -439,7 +428,7 @@ declare const relationDatesSchema: mongoose.Schema<RelationDate, mongoose.Model<
|
|
|
439
428
|
} & {
|
|
440
429
|
__v: number;
|
|
441
430
|
}>;
|
|
442
|
-
type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId"> & {
|
|
431
|
+
type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId" | "apiMessage"> & {
|
|
443
432
|
eventId: ObjectId;
|
|
444
433
|
vendorId: ObjectId;
|
|
445
434
|
chatId: ObjectId;
|
|
@@ -449,7 +438,7 @@ type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId">
|
|
|
449
438
|
* It is used to define the structure of the relation type in the database.
|
|
450
439
|
* The schema is used by Mongoose to create a model for the relation type.
|
|
451
440
|
*/
|
|
452
|
-
declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.Model<SchemaRelationType, any, any, any, mongoose.Document<unknown, any, SchemaRelationType, any, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId"> & {
|
|
441
|
+
declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.Model<SchemaRelationType, any, any, any, mongoose.Document<unknown, any, SchemaRelationType, any, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId" | "apiMessage"> & {
|
|
453
442
|
eventId: ObjectId;
|
|
454
443
|
vendorId: ObjectId;
|
|
455
444
|
chatId: ObjectId;
|
|
@@ -462,7 +451,7 @@ declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.M
|
|
|
462
451
|
}> & {
|
|
463
452
|
__v: number;
|
|
464
453
|
}>;
|
|
465
|
-
declare const RelationModel: mongoose.Model<SchemaRelationType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaRelationType, {}, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId"> & {
|
|
454
|
+
declare const RelationModel: mongoose.Model<SchemaRelationType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaRelationType, {}, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId" | "apiMessage"> & {
|
|
466
455
|
eventId: ObjectId;
|
|
467
456
|
vendorId: ObjectId;
|
|
468
457
|
chatId: ObjectId;
|
|
@@ -722,10 +711,7 @@ declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: E
|
|
|
722
711
|
*/
|
|
723
712
|
declare function convertObjectIdsToStrings(obj: any): any;
|
|
724
713
|
|
|
725
|
-
type EventOrMarket =
|
|
726
|
-
_id: ObjectId | string;
|
|
727
|
-
name: string;
|
|
728
|
-
} | null;
|
|
714
|
+
type EventOrMarket = Pick<EventListItemType, "_id" | "name"> | null;
|
|
729
715
|
/**
|
|
730
716
|
* This function attempts to find an Event or a Google Imported Market by the given resource ID.
|
|
731
717
|
* It first normalizes the resource ID to a string format, then performs parallel queries to both collections.
|
package/dist/index.mjs
CHANGED
|
@@ -7281,7 +7281,12 @@ var gameScreenIdentifierList = [
|
|
|
7281
7281
|
match: "/events/events-near-me"
|
|
7282
7282
|
},
|
|
7283
7283
|
{
|
|
7284
|
-
clue: "
|
|
7284
|
+
clue: "Where events appear as pins on a map.",
|
|
7285
|
+
id: "events-map",
|
|
7286
|
+
match: "/events/events-map"
|
|
7287
|
+
},
|
|
7288
|
+
{
|
|
7289
|
+
clue: "A collection of events worth attending.",
|
|
7285
7290
|
id: "events",
|
|
7286
7291
|
match: "/events"
|
|
7287
7292
|
},
|
|
@@ -7374,6 +7379,7 @@ function normalizeUrl(url) {
|
|
|
7374
7379
|
}
|
|
7375
7380
|
return url;
|
|
7376
7381
|
}
|
|
7382
|
+
var CLUEMART_MAIN_DOMAIN_URL = "https://cluemart.co.nz";
|
|
7377
7383
|
var SCHOOL_MIN_STUDENT_COUNT = 300;
|
|
7378
7384
|
var packagingTypes = [
|
|
7379
7385
|
"Biodegradable",
|
|
@@ -8779,7 +8785,6 @@ var USER_FIELDS_FRAGMENT = gql`
|
|
|
8779
8785
|
platform
|
|
8780
8786
|
preferredRegion
|
|
8781
8787
|
promoCodes
|
|
8782
|
-
refreshToken
|
|
8783
8788
|
role
|
|
8784
8789
|
school
|
|
8785
8790
|
termsAgreement {
|
|
@@ -9029,7 +9034,10 @@ var GET_EVENT_BY_PLACE_ID = gql`
|
|
|
9029
9034
|
${EVENT_LIST_ITEM}
|
|
9030
9035
|
`;
|
|
9031
9036
|
var GET_EVENTS_BY_REGION = gql`
|
|
9032
|
-
query getEventsByRegion(
|
|
9037
|
+
query getEventsByRegion(
|
|
9038
|
+
$region: String!
|
|
9039
|
+
$options: ResourcesByRegionOptions
|
|
9040
|
+
) {
|
|
9033
9041
|
eventsByRegion(region: $region, options: $options) {
|
|
9034
9042
|
...EventListItemFields
|
|
9035
9043
|
}
|
|
@@ -9037,7 +9045,7 @@ var GET_EVENTS_BY_REGION = gql`
|
|
|
9037
9045
|
${EVENT_LIST_ITEM}
|
|
9038
9046
|
`;
|
|
9039
9047
|
var SEARCH_EVENTS = gql`
|
|
9040
|
-
query searchEvents($region: String, $search: String
|
|
9048
|
+
query searchEvents($region: String, $search: String, $tags: [String]) {
|
|
9041
9049
|
eventsSearch(region: $region, search: $search, tags: $tags) {
|
|
9042
9050
|
...EventListItemFields
|
|
9043
9051
|
}
|
|
@@ -9261,8 +9269,11 @@ var GET_VENDOR = gql`
|
|
|
9261
9269
|
${VENDOR}
|
|
9262
9270
|
`;
|
|
9263
9271
|
var GET_VENDORS_BY_REGION = gql`
|
|
9264
|
-
query getVendorsByRegion(
|
|
9265
|
-
|
|
9272
|
+
query getVendorsByRegion(
|
|
9273
|
+
$region: String!
|
|
9274
|
+
$options: ResourcesByRegionOptions
|
|
9275
|
+
) {
|
|
9276
|
+
vendorsByRegion(region: $region, options: $options) {
|
|
9266
9277
|
...VendorFields
|
|
9267
9278
|
}
|
|
9268
9279
|
}
|
|
@@ -9658,8 +9669,11 @@ var GET_PARTNER = gql`
|
|
|
9658
9669
|
${PARTNER}
|
|
9659
9670
|
`;
|
|
9660
9671
|
var GET_PARTNERS_BY_REGION = gql`
|
|
9661
|
-
query getPartnersByRegion(
|
|
9662
|
-
|
|
9672
|
+
query getPartnersByRegion(
|
|
9673
|
+
$region: String!
|
|
9674
|
+
$options: ResourcesByRegionOptions
|
|
9675
|
+
) {
|
|
9676
|
+
partnersByRegion(region: $region, options: $options) {
|
|
9663
9677
|
...PartnerFields
|
|
9664
9678
|
}
|
|
9665
9679
|
}
|
|
@@ -10878,7 +10892,7 @@ var emailOptionalSchema = create$6().nullable().notRequired().transform(
|
|
|
10878
10892
|
(value) => !value || create$6().email().isValidSync(value)
|
|
10879
10893
|
).label("Email");
|
|
10880
10894
|
var mobileRegex = /^02\d{7,9}$/;
|
|
10881
|
-
var landlineRegex = /^
|
|
10895
|
+
var landlineRegex = /^0[34679]\d{7}$/;
|
|
10882
10896
|
var mobilePhoneSchema = create$6().label("Mobile Phone").nullable().notRequired().test(
|
|
10883
10897
|
"mobile-phone",
|
|
10884
10898
|
"Mobile must start with 02 and be 9\u201311 digits",
|
|
@@ -11263,12 +11277,12 @@ var validateVerificationTokenSchema = create$3().shape({
|
|
|
11263
11277
|
email: emailRequiredSchema,
|
|
11264
11278
|
verificationToken: create$6().required("Verification code is required").matches(/^\d{6}$/, "Verification code must be exactly 6 digits")
|
|
11265
11279
|
});
|
|
11266
|
-
var EnumAdShowOn = /* @__PURE__ */ ((
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
|
|
11271
|
-
return
|
|
11280
|
+
var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
|
|
11281
|
+
EnumAdShowOn2["EVENTS_PAGE"] = "Events_page";
|
|
11282
|
+
EnumAdShowOn2["FRONT_PAGE"] = "Front_page";
|
|
11283
|
+
EnumAdShowOn2["PARTNERS_PAGE"] = "Partners_page";
|
|
11284
|
+
EnumAdShowOn2["VENDORS_PAGE"] = "Vendors_page";
|
|
11285
|
+
return EnumAdShowOn2;
|
|
11272
11286
|
})(EnumAdShowOn || {});
|
|
11273
11287
|
var EnumAdStatus = /* @__PURE__ */ ((EnumAdStatus2) => {
|
|
11274
11288
|
EnumAdStatus2["ACTIVE"] = "Active";
|
|
@@ -11287,15 +11301,15 @@ var EnumAdStyle = /* @__PURE__ */ ((EnumAdStyle2) => {
|
|
|
11287
11301
|
return EnumAdStyle2;
|
|
11288
11302
|
})(EnumAdStyle || {});
|
|
11289
11303
|
var adResourceSchema = create$3({
|
|
11290
|
-
adDescription: create$6().
|
|
11291
|
-
adImage: create$6().
|
|
11292
|
-
adStyle: create$8().
|
|
11293
|
-
adTitle: create$6().
|
|
11294
|
-
adType: create$8().
|
|
11295
|
-
resourceId: create$6().
|
|
11296
|
-
resourceName: create$6().
|
|
11297
|
-
resourceRegion: create$6().
|
|
11298
|
-
resourceType: create$8().
|
|
11304
|
+
adDescription: create$6().trim().required("Ad description is required").max(150, "Ad description must be at most 150 characters"),
|
|
11305
|
+
adImage: create$6().required("Ad image is required"),
|
|
11306
|
+
adStyle: create$8().oneOf(Object.values(EnumAdStyle), "Please select a valid ad style").required("Ad style is required"),
|
|
11307
|
+
adTitle: create$6().trim().required("Ad title is required").max(30, "Ad title must be at most 30 characters"),
|
|
11308
|
+
adType: create$8().oneOf(Object.values(EnumAdType), "Please select a valid ad type").required("Ad type is required"),
|
|
11309
|
+
resourceId: create$6().required("Resource ID is required"),
|
|
11310
|
+
resourceName: create$6().required("Resource name is required"),
|
|
11311
|
+
resourceRegion: create$6().required("Resource region is required"),
|
|
11312
|
+
resourceType: create$8().oneOf(Object.values(EnumResourceType), "Please select Event or Vendor").required("Resource type is required")
|
|
11299
11313
|
});
|
|
11300
11314
|
var adSchema = create$3().shape({
|
|
11301
11315
|
active: create$7().required("Active status is required"),
|
|
@@ -11325,7 +11339,8 @@ var adSchema = create$3().shape({
|
|
|
11325
11339
|
if (!value) return false;
|
|
11326
11340
|
return value > /* @__PURE__ */ new Date();
|
|
11327
11341
|
}),
|
|
11328
|
-
|
|
11342
|
+
// Keep `start` optional (not null) when ACTIVE to match TS type `start?: Date`.
|
|
11343
|
+
otherwise: () => create$4().notRequired()
|
|
11329
11344
|
}),
|
|
11330
11345
|
targetRegion: create$2().of(create$6().required()).min(1, "At least one target region is required").required("Target region is required")
|
|
11331
11346
|
});
|
|
@@ -11453,6 +11468,31 @@ var contactUsSchema = create$3().shape({
|
|
|
11453
11468
|
lastName: create$6().label("Last Name").required("Last name is required"),
|
|
11454
11469
|
message: create$6().label("Message").required("Message is required")
|
|
11455
11470
|
});
|
|
11471
|
+
var defaultValues8 = {
|
|
11472
|
+
active: true,
|
|
11473
|
+
// Use a future default so yup "future date" rules pass on first submit.
|
|
11474
|
+
end: new Date(Date.now() + 7 * 24 * 60 * 60 * 1e3),
|
|
11475
|
+
resource: {
|
|
11476
|
+
adDescription: "",
|
|
11477
|
+
adImage: "",
|
|
11478
|
+
adStyle: "Bloom",
|
|
11479
|
+
adTitle: "",
|
|
11480
|
+
adType: "Sponsored",
|
|
11481
|
+
resourceId: "",
|
|
11482
|
+
resourceName: "",
|
|
11483
|
+
resourceRegion: "",
|
|
11484
|
+
resourceType: "event"
|
|
11485
|
+
/* EVENT */
|
|
11486
|
+
},
|
|
11487
|
+
showOn: [
|
|
11488
|
+
"Front_page"
|
|
11489
|
+
/* FRONT_PAGE */
|
|
11490
|
+
],
|
|
11491
|
+
// `start` is only required (and must be future) when status !== ACTIVE.
|
|
11492
|
+
start: void 0,
|
|
11493
|
+
status: "Active",
|
|
11494
|
+
targetRegion: []
|
|
11495
|
+
};
|
|
11456
11496
|
var schoolSchema = create$3().shape({
|
|
11457
11497
|
active: create$7().required("Active is required"),
|
|
11458
11498
|
contactDetails: contactDetailsSchema,
|
|
@@ -11514,8 +11554,9 @@ var badgeFiles = Object.fromEntries(
|
|
|
11514
11554
|
var logoIds = [
|
|
11515
11555
|
"googleMaps-logo-dark",
|
|
11516
11556
|
"googleMaps-logo-light",
|
|
11517
|
-
"logo",
|
|
11518
|
-
"logo-
|
|
11557
|
+
"logo-atr",
|
|
11558
|
+
"logo-dark",
|
|
11559
|
+
"logo"
|
|
11519
11560
|
];
|
|
11520
11561
|
var logoFiles = Object.fromEntries(
|
|
11521
11562
|
logoIds.map((id) => [id, `${id}${IMAGE_EXTENSION}`])
|
|
@@ -11523,6 +11564,7 @@ var logoFiles = Object.fromEntries(
|
|
|
11523
11564
|
var otherImagesIds = [
|
|
11524
11565
|
"banner-horizontal",
|
|
11525
11566
|
"banner-vertical",
|
|
11567
|
+
"gazebo-top",
|
|
11526
11568
|
"qr-code",
|
|
11527
11569
|
"store-android",
|
|
11528
11570
|
"store-ios"
|
|
@@ -11550,7 +11592,7 @@ var otherImages = Object.fromEntries(
|
|
|
11550
11592
|
);
|
|
11551
11593
|
var RELATION_SHARE_INVITATION = "invitation";
|
|
11552
11594
|
var RELATION_SHARE_APPLICATION = "application";
|
|
11553
|
-
var SHARE_SITE_URL =
|
|
11595
|
+
var SHARE_SITE_URL = CLUEMART_MAIN_DOMAIN_URL;
|
|
11554
11596
|
var SHARE_CALENDAR_ICON = "\u{1F4C5}";
|
|
11555
11597
|
var SHARE_MARKET_DATES_SECTION_HEADING = `${SHARE_CALENDAR_ICON} Market dates:`;
|
|
11556
11598
|
var SHARE_CHECKMARK_ICON = "\u2705";
|
|
@@ -11890,6 +11932,7 @@ var refundPolicySchema = new MongooseSchema4(
|
|
|
11890
11932
|
);
|
|
11891
11933
|
var schema2 = new MongooseSchema4(
|
|
11892
11934
|
{
|
|
11935
|
+
active: { default: true, type: Boolean },
|
|
11893
11936
|
applicationDeadlineHours: { required: true, type: Number },
|
|
11894
11937
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
11895
11938
|
eventId: {
|
|
@@ -12331,7 +12374,11 @@ var schema5 = new MongooseSchema9(
|
|
|
12331
12374
|
type: String
|
|
12332
12375
|
},
|
|
12333
12376
|
token: { required: true, type: String },
|
|
12334
|
-
userId: {
|
|
12377
|
+
userId: {
|
|
12378
|
+
ref: "User",
|
|
12379
|
+
required: true,
|
|
12380
|
+
type: mongoose9.Schema.Types.ObjectId
|
|
12381
|
+
}
|
|
12335
12382
|
},
|
|
12336
12383
|
{ timestamps: true }
|
|
12337
12384
|
);
|
|
@@ -12674,6 +12721,7 @@ var AttributesSchema = new MongooseSchema14(
|
|
|
12674
12721
|
);
|
|
12675
12722
|
var schema10 = new MongooseSchema14(
|
|
12676
12723
|
{
|
|
12724
|
+
active: { default: true, type: Boolean },
|
|
12677
12725
|
compliance: {
|
|
12678
12726
|
foodBeverageLicense: { default: false, required: false, type: Boolean },
|
|
12679
12727
|
liabilityInsurance: { default: false, required: false, type: Boolean }
|
|
@@ -13405,12 +13453,12 @@ async function removeAssociateFromResource({
|
|
|
13405
13453
|
// src/service/vendor.ts
|
|
13406
13454
|
async function updateVendorBasedOnUserLicense(userId, licenceType) {
|
|
13407
13455
|
try {
|
|
13408
|
-
const user = await UserModel.findById(userId).select("vendor").lean();
|
|
13456
|
+
const user = await UserModel.findById(userId).select("vendor").lean().exec();
|
|
13409
13457
|
if (!user?.vendor) {
|
|
13410
13458
|
console.warn(`[updateVendor] No vendor found for userId=${userId}`);
|
|
13411
13459
|
return;
|
|
13412
13460
|
}
|
|
13413
|
-
const vendor = await VendorModel.findById(user.vendor).lean();
|
|
13461
|
+
const vendor = await VendorModel.findById(user.vendor).lean().exec();
|
|
13414
13462
|
if (!vendor) {
|
|
13415
13463
|
console.warn(`[updateVendor] Vendor not found for id=${user.vendor}`);
|
|
13416
13464
|
return;
|