@timardex/cluemart-server-shared 1.0.212 → 1.0.214

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.
@@ -64,6 +64,7 @@ __export(mongoose_exports, {
64
64
  locationGeoSchema: () => locationGeoSchema,
65
65
  locationsSchema: () => locationsSchema,
66
66
  refundPolicySchema: () => refundPolicySchema,
67
+ relatedPostSchema: () => relatedPostSchema,
67
68
  relationDatesSchema: () => relationDatesSchema,
68
69
  resourceRelationsSchema: () => resourceRelationsSchema,
69
70
  termsAgreementSchema: () => termsAgreementSchema,
@@ -3551,10 +3552,64 @@ var gameScreenIdentifierList = [
3551
3552
  match: "/visitors"
3552
3553
  }
3553
3554
  ];
3554
- import_dayjs.default.extend(import_customParseFormat.default);
3555
- import_dayjs.default.extend(import_utc.default);
3556
- import_dayjs.default.extend(import_timezone.default);
3557
- import_dayjs.default.extend(import_isSameOrAfter.default);
3555
+ var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
3556
+ EnumAdShowOn2["EVENTS_PAGE"] = "Events_page";
3557
+ EnumAdShowOn2["FRONT_PAGE"] = "Front_page";
3558
+ EnumAdShowOn2["PARTNERS_PAGE"] = "Partners_page";
3559
+ EnumAdShowOn2["VENDORS_PAGE"] = "Vendors_page";
3560
+ return EnumAdShowOn2;
3561
+ })(EnumAdShowOn || {});
3562
+ var EnumAdStatus = /* @__PURE__ */ ((EnumAdStatus2) => {
3563
+ EnumAdStatus2["ACTIVE"] = "Active";
3564
+ EnumAdStatus2["PAUSED"] = "Paused";
3565
+ EnumAdStatus2["EXPIRED"] = "Expired";
3566
+ return EnumAdStatus2;
3567
+ })(EnumAdStatus || {});
3568
+ var EnumAdType = /* @__PURE__ */ ((EnumAdType2) => {
3569
+ EnumAdType2["SPONSORED"] = "Sponsored";
3570
+ EnumAdType2["FREE"] = "Free";
3571
+ return EnumAdType2;
3572
+ })(EnumAdType || {});
3573
+ var EnumAdStyle = /* @__PURE__ */ ((EnumAdStyle2) => {
3574
+ EnumAdStyle2["BLOOM"] = "Bloom";
3575
+ EnumAdStyle2["RISE"] = "Rise";
3576
+ return EnumAdStyle2;
3577
+ })(EnumAdStyle || {});
3578
+ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
3579
+ EnumActivity2["FAVORITE"] = "FAVORITE";
3580
+ EnumActivity2["GOING"] = "GOING";
3581
+ EnumActivity2["INTERESTED"] = "INTERESTED";
3582
+ EnumActivity2["PRESENT"] = "PRESENT";
3583
+ EnumActivity2["VIEW"] = "VIEW";
3584
+ return EnumActivity2;
3585
+ })(EnumActivity || {});
3586
+ var EnumPostType = /* @__PURE__ */ ((EnumPostType2) => {
3587
+ EnumPostType2["MARKET_FACES"] = "market_faces";
3588
+ EnumPostType2["CLUE_BITES"] = "clue_bites";
3589
+ EnumPostType2["PLAY_AND_WIN"] = "play_and_win";
3590
+ return EnumPostType2;
3591
+ })(EnumPostType || {});
3592
+ var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
3593
+ EnumPostContentType2["GAME"] = "game";
3594
+ EnumPostContentType2["IMAGE"] = "image";
3595
+ EnumPostContentType2["LIST"] = "list";
3596
+ EnumPostContentType2["TEXTAREA"] = "textarea";
3597
+ EnumPostContentType2["VIDEO"] = "video";
3598
+ return EnumPostContentType2;
3599
+ })(EnumPostContentType || {});
3600
+ var EnumGameStatus = /* @__PURE__ */ ((EnumGameStatus2) => {
3601
+ EnumGameStatus2["GAME_COMPLETED"] = "GAME_COMPLETED";
3602
+ EnumGameStatus2["GAME_IN_PROGRESS"] = "GAME_IN_PROGRESS";
3603
+ EnumGameStatus2["GAME_LEFT"] = "GAME_LEFT";
3604
+ EnumGameStatus2["GAME_STARTED"] = "GAME_STARTED";
3605
+ return EnumGameStatus2;
3606
+ })(EnumGameStatus || {});
3607
+ var EnumGameType = /* @__PURE__ */ ((EnumGameType2) => {
3608
+ EnumGameType2["DAILY_CLUE"] = "dailyClue";
3609
+ EnumGameType2["MINI_QUIZ"] = "miniQuiz";
3610
+ EnumGameType2["ODD_ONE_OUT"] = "oddOneOut";
3611
+ return EnumGameType2;
3612
+ })(EnumGameType || {});
3558
3613
  var mapArrayToOptions = (items) => items.map((item) => ({
3559
3614
  label: item,
3560
3615
  value: item
@@ -3572,6 +3627,19 @@ var paymentMethodOptions = mapArrayToOptions(
3572
3627
  Object.values(EnumPaymentMethod)
3573
3628
  );
3574
3629
  var CLUEMART_MAIN_DOMAIN_URL = "https://cluemart.co.nz";
3630
+ import_dayjs.default.extend(import_customParseFormat.default);
3631
+ import_dayjs.default.extend(import_utc.default);
3632
+ import_dayjs.default.extend(import_timezone.default);
3633
+ import_dayjs.default.extend(import_isSameOrAfter.default);
3634
+ var futureTimePeriods = mapArrayToOptions(
3635
+ Object.values(EnumEventDateStatus)
3636
+ ).filter(
3637
+ (period) => period.value !== "Starting_Soon" && period.value !== "Canceled" && period.value !== "Rescheduled" && period.value !== "Started" && period.value !== "Ended" && period.value !== "Invalid"
3638
+ /* INVALID */
3639
+ ).map((period) => ({
3640
+ label: period.value.replaceAll("_", " "),
3641
+ value: period.value
3642
+ }));
3575
3643
  var packagingTypes = [
3576
3644
  "Biodegradable",
3577
3645
  "Compostable",
@@ -5106,6 +5174,12 @@ var EVENT_LIST_ITEM = gql`
5106
5174
  ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
5107
5175
  ${RELATION_DATES_FRAGMENT}
5108
5176
  `;
5177
+ var RELATED_POST_FIELDS_FRAGMENT = gql`
5178
+ fragment RelatedPostFields on RelatedPostType {
5179
+ postId
5180
+ postType
5181
+ }
5182
+ `;
5109
5183
  var EVENT_INFO = gql`
5110
5184
  fragment EventInfoFields on EventInfoType {
5111
5185
  _id
@@ -5195,6 +5269,9 @@ var EVENT = gql`
5195
5269
  rating
5196
5270
  reviewCount
5197
5271
  rainOrShine
5272
+ relatedPost {
5273
+ ...RelatedPostFields
5274
+ }
5198
5275
  socialMedia {
5199
5276
  ...SocialMediaFields
5200
5277
  }
@@ -5214,6 +5291,7 @@ var EVENT = gql`
5214
5291
  ${CONTACT_DETAILS_FIELDS_FRAGMENT}
5215
5292
  ${TERMS_AGREEMENT_FIELDS_FRAGMENT}
5216
5293
  ${RELATION_DATES_FRAGMENT}
5294
+ ${RELATED_POST_FIELDS_FRAGMENT}
5217
5295
  `;
5218
5296
  var GET_EVENTS = gql`
5219
5297
  query getEvents($dateStatus: EventDateStatusEnumType) {
@@ -5380,6 +5458,9 @@ var VENDOR = gql`
5380
5458
  rating
5381
5459
  region
5382
5460
  reviewCount
5461
+ relatedPost {
5462
+ ...RelatedPostFields
5463
+ }
5383
5464
  relations {
5384
5465
  relationId
5385
5466
  relationDates {
@@ -5408,6 +5489,7 @@ var VENDOR = gql`
5408
5489
  ${CONTACT_DETAILS_FIELDS_FRAGMENT}
5409
5490
  ${TERMS_AGREEMENT_FIELDS_FRAGMENT}
5410
5491
  ${RELATION_DATES_FRAGMENT}
5492
+ ${RELATED_POST_FIELDS_FRAGMENT}
5411
5493
  `;
5412
5494
  var VENDOR_ATTRIBUTES_FRAGMENT = gql`
5413
5495
  fragment VendorAttributesFields on VendorAttributesType {
@@ -5866,6 +5948,9 @@ var PARTNER = gql`
5866
5948
  rating
5867
5949
  region
5868
5950
  reviewCount
5951
+ relatedPost {
5952
+ ...RelatedPostFields
5953
+ }
5869
5954
  socialMedia {
5870
5955
  ...SocialMediaFields
5871
5956
  }
@@ -5882,6 +5967,7 @@ var PARTNER = gql`
5882
5967
  ${POSTER_USAGE_FIELDS_FRAGMENT}
5883
5968
  ${SOCIAL_MEDIA_FIELDS_FRAGMENT}
5884
5969
  ${CONTACT_DETAILS_FIELDS_FRAGMENT}
5970
+ ${RELATED_POST_FIELDS_FRAGMENT}
5885
5971
  `;
5886
5972
  var GET_PARTNERS = gql`
5887
5973
  query getPartners {
@@ -7217,16 +7303,16 @@ var RESOURCE_SHARE_TYPES = [
7217
7303
  "partner"
7218
7304
  ];
7219
7305
  var POST_SHARE_RESOURCE_TYPES = [
7220
- "daily_meets",
7221
- "daily_tips",
7222
- "daily_games"
7306
+ "market_faces",
7307
+ "clue_bites",
7308
+ "play_and_win"
7223
7309
  ];
7224
7310
  var SHARE_RESOURCE_LABEL = {
7225
7311
  [RELATION_SHARE_APPLICATION]: "Application",
7226
7312
  [RELATION_SHARE_INVITATION]: "Invitation",
7227
- daily_games: "Daily Game",
7228
- daily_meets: "Daily Meet",
7229
- daily_tips: "Daily Tip",
7313
+ clue_bites: "Clue Bites",
7314
+ market_faces: "Market Faces",
7315
+ play_and_win: "Play & Win",
7230
7316
  market: "Market",
7231
7317
  partner: "Partner",
7232
7318
  stallholder: "Stallholder"
@@ -7240,64 +7326,6 @@ var SHARE_TYPE_PATH_REGEX = [
7240
7326
  RELATION_SHARE_APPLICATION,
7241
7327
  RELATION_SHARE_INVITATION
7242
7328
  ].join("|");
7243
- var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
7244
- EnumAdShowOn2["EVENTS_PAGE"] = "Events_page";
7245
- EnumAdShowOn2["FRONT_PAGE"] = "Front_page";
7246
- EnumAdShowOn2["PARTNERS_PAGE"] = "Partners_page";
7247
- EnumAdShowOn2["VENDORS_PAGE"] = "Vendors_page";
7248
- return EnumAdShowOn2;
7249
- })(EnumAdShowOn || {});
7250
- var EnumAdStatus = /* @__PURE__ */ ((EnumAdStatus2) => {
7251
- EnumAdStatus2["ACTIVE"] = "Active";
7252
- EnumAdStatus2["PAUSED"] = "Paused";
7253
- EnumAdStatus2["EXPIRED"] = "Expired";
7254
- return EnumAdStatus2;
7255
- })(EnumAdStatus || {});
7256
- var EnumAdType = /* @__PURE__ */ ((EnumAdType2) => {
7257
- EnumAdType2["SPONSORED"] = "Sponsored";
7258
- EnumAdType2["FREE"] = "Free";
7259
- return EnumAdType2;
7260
- })(EnumAdType || {});
7261
- var EnumAdStyle = /* @__PURE__ */ ((EnumAdStyle2) => {
7262
- EnumAdStyle2["BLOOM"] = "Bloom";
7263
- EnumAdStyle2["RISE"] = "Rise";
7264
- return EnumAdStyle2;
7265
- })(EnumAdStyle || {});
7266
- var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
7267
- EnumActivity2["FAVORITE"] = "FAVORITE";
7268
- EnumActivity2["GOING"] = "GOING";
7269
- EnumActivity2["INTERESTED"] = "INTERESTED";
7270
- EnumActivity2["PRESENT"] = "PRESENT";
7271
- EnumActivity2["VIEW"] = "VIEW";
7272
- return EnumActivity2;
7273
- })(EnumActivity || {});
7274
- var EnumPostType = /* @__PURE__ */ ((EnumPostType2) => {
7275
- EnumPostType2["DAILY_MEETS"] = "daily_meets";
7276
- EnumPostType2["DAILY_TIPS"] = "daily_tips";
7277
- EnumPostType2["DAILY_GAMES"] = "daily_games";
7278
- return EnumPostType2;
7279
- })(EnumPostType || {});
7280
- var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
7281
- EnumPostContentType2["GAME"] = "game";
7282
- EnumPostContentType2["IMAGE"] = "image";
7283
- EnumPostContentType2["LIST"] = "list";
7284
- EnumPostContentType2["TEXTAREA"] = "textarea";
7285
- EnumPostContentType2["VIDEO"] = "video";
7286
- return EnumPostContentType2;
7287
- })(EnumPostContentType || {});
7288
- var EnumGameStatus = /* @__PURE__ */ ((EnumGameStatus2) => {
7289
- EnumGameStatus2["GAME_COMPLETED"] = "GAME_COMPLETED";
7290
- EnumGameStatus2["GAME_IN_PROGRESS"] = "GAME_IN_PROGRESS";
7291
- EnumGameStatus2["GAME_LEFT"] = "GAME_LEFT";
7292
- EnumGameStatus2["GAME_STARTED"] = "GAME_STARTED";
7293
- return EnumGameStatus2;
7294
- })(EnumGameStatus || {});
7295
- var EnumGameType = /* @__PURE__ */ ((EnumGameType2) => {
7296
- EnumGameType2["DAILY_CLUE"] = "dailyClue";
7297
- EnumGameType2["MINI_QUIZ"] = "miniQuiz";
7298
- EnumGameType2["ODD_ONE_OUT"] = "oddOneOut";
7299
- return EnumGameType2;
7300
- })(EnumGameType || {});
7301
7329
 
7302
7330
  // src/mongoose/Ad.ts
7303
7331
  var import_mongoose = __toESM(require("mongoose"));
@@ -7848,6 +7876,22 @@ var locationsSchema = new MongooseSchema6(
7848
7876
  { _id: false }
7849
7877
  // Prevents Mongoose from creating an additional _id field for subdocuments
7850
7878
  );
7879
+ var relatedPostSchema = new MongooseSchema6(
7880
+ {
7881
+ postId: {
7882
+ ref: "Post",
7883
+ required: true,
7884
+ type: import_mongoose6.default.Schema.Types.ObjectId
7885
+ },
7886
+ postType: {
7887
+ enum: Object.values(EnumPostType),
7888
+ required: true,
7889
+ type: String
7890
+ }
7891
+ },
7892
+ { _id: false }
7893
+ // Prevents Mongoose from creating an additional _id field for subdocuments
7894
+ );
7851
7895
  var baseResourceFields = {
7852
7896
  active: { default: false, required: true, type: Boolean },
7853
7897
  adIds: {
@@ -7877,6 +7921,7 @@ var baseResourceFields = {
7877
7921
  promoCodes: { required: false, type: [String] },
7878
7922
  rating: { required: false, type: Number },
7879
7923
  region: { required: true, type: String },
7924
+ relatedPost: { required: false, type: relatedPostSchema },
7880
7925
  reviewCount: { required: false, type: Number },
7881
7926
  socialMedia: { required: false, type: [SocialMediaTypeSchema] },
7882
7927
  termsAgreement: { required: true, type: termsAgreementSchema }
@@ -8854,6 +8899,7 @@ var SchoolModel = import_mongoose24.default.models.School || import_mongoose24.d
8854
8899
  locationGeoSchema,
8855
8900
  locationsSchema,
8856
8901
  refundPolicySchema,
8902
+ relatedPostSchema,
8857
8903
  relationDatesSchema,
8858
8904
  resourceRelationsSchema,
8859
8905
  termsAgreementSchema,