@timardex/cluemart-server-shared 1.0.302 → 1.0.303

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.
@@ -4,9 +4,13 @@ import {
4
4
  EnumAdStatus,
5
5
  EnumAffiliateRewardType,
6
6
  EnumEventDateStatus,
7
+ EnumEventDateStatus2,
7
8
  EnumInviteStatus,
9
+ EnumInviteStatus2,
8
10
  EnumNotificationResourceType,
9
11
  EnumNotificationType,
12
+ EnumPaymentMethod,
13
+ EnumRegions,
10
14
  EnumResourceType,
11
15
  EnumSubscriptionStatus,
12
16
  EnumUserLicence,
@@ -18,7 +22,7 @@ import {
18
22
  VendorModel,
19
23
  dateFormat,
20
24
  timeFormat
21
- } from "../chunk-LOZFYYVW.mjs";
25
+ } from "../chunk-GQWLGM2W.mjs";
22
26
  import "../chunk-6PNG5BI5.mjs";
23
27
 
24
28
  // src/service/promoCode/constants.ts
@@ -36,6 +40,1207 @@ async function activeAffiliateCodeExists(affiliateCode) {
36
40
  return existing !== null;
37
41
  }
38
42
 
43
+ // node_modules/@timardex/cluemart-shared/dist/chunk-SWWVD4J5.mjs
44
+ import dayjs from "dayjs";
45
+ import customParseFormat from "dayjs/plugin/customParseFormat.js";
46
+ import isSameOrAfter from "dayjs/plugin/isSameOrAfter.js";
47
+ import timezone from "dayjs/plugin/timezone.js";
48
+ import utc from "dayjs/plugin/utc.js";
49
+ var mapArrayToOptions = (items) => items.map((item) => ({
50
+ label: item,
51
+ value: item
52
+ }));
53
+ dayjs.extend(customParseFormat);
54
+ dayjs.extend(utc);
55
+ dayjs.extend(timezone);
56
+ dayjs.extend(isSameOrAfter);
57
+ var futureTimePeriods = mapArrayToOptions(
58
+ Object.values(EnumEventDateStatus2)
59
+ ).filter(
60
+ (period) => period.value !== "Starting_Soon" && period.value !== "Canceled" && period.value !== "Rescheduled" && period.value !== "Started" && period.value !== "Ended" && period.value !== "Invalid"
61
+ /* INVALID */
62
+ ).map((period) => ({
63
+ label: period.value.replaceAll("_", " "),
64
+ value: period.value
65
+ }));
66
+ var RELATION_SHARE_INVITATION = "invitation";
67
+ var RELATION_SHARE_APPLICATION = "application";
68
+ var SHARE_SITE_URL = "https://cluemart.co.nz";
69
+ var SHARE_CALENDAR_ICON = "\u{1F4C5}";
70
+ var SHARE_MARKET_DATES_SECTION_HEADING = `${SHARE_CALENDAR_ICON} Market dates:`;
71
+ var SHARE_CHECKMARK_ICON = "\u2705";
72
+ var SHARE_REQUIREMENTS_SECTION_HEADING = `${SHARE_CHECKMARK_ICON} Requirements:`;
73
+ var SHARE_INFO_ICON = "\u2139\uFE0F";
74
+ var SHARE_TAGS_SECTION_HEADING = `${SHARE_INFO_ICON} Tags:`;
75
+ var SHARE_COMPLIANCE_PREFIX = `${SHARE_CHECKMARK_ICON} Compliance:`;
76
+ var SHARE_CATEGORY_ICON = "\u{1F3F7}\uFE0F";
77
+ var SHARE_CATEGORIES_SECTION_HEADING = `${SHARE_CATEGORY_ICON} Categories:`;
78
+ var SHARE_RULER_ICON = "\u{1F4CF}";
79
+ var SHARE_STALL_SIZE_PREFIX = `${SHARE_RULER_ICON} Stall size:`;
80
+ var SHARE_DOLLAR_ICON = "$";
81
+ var SHARE_PRICE_RANGE_PREFIX = `${SHARE_DOLLAR_ICON} Price range:`;
82
+ var SHARE_CLOCK_ICON = "\u23F0";
83
+ var SHARE_APPLICATION_DEADLINE_PREFIX = `${SHARE_CLOCK_ICON} Application deadline:`;
84
+ var DEFAULT_SHARE_OG_IMAGE = `${SHARE_SITE_URL}/assets/logo.webp`;
85
+ var SHARE_RESOURCE_LABEL = {
86
+ [RELATION_SHARE_APPLICATION]: "Application",
87
+ [RELATION_SHARE_INVITATION]: "Invitation",
88
+ clue_bites: "Clue Bites",
89
+ market_faces: "Market Faces",
90
+ play_and_win: "Play & Win",
91
+ market: "Market",
92
+ partner: "Partner",
93
+ stallholder: "Stallholder",
94
+ affiliate: "Affiliate",
95
+ school: "School"
96
+ };
97
+
98
+ // node_modules/@timardex/cluemart-shared/dist/chunk-43SLZVBF.mjs
99
+ var PROMO_CODE_PREFIX = "CM-";
100
+ var OBJECT_ID_PATH_SEGMENT = "[a-f0-9]{24}";
101
+ var OBJECT_ID_PATH_SEGMENT_END = `${OBJECT_ID_PATH_SEGMENT}$`;
102
+ var gameScreenIdentifierList = [
103
+ {
104
+ clue: "Where your actions turn into a timeline.",
105
+ id: "activities",
106
+ match: "/profile/activities"
107
+ },
108
+ {
109
+ clue: "Where conversations happen without speaking.",
110
+ id: "chat",
111
+ match: "/profile/chat"
112
+ },
113
+ {
114
+ clue: "The place to redefine who you are.",
115
+ id: "edit-profile",
116
+ match: "/profile/edit-profile"
117
+ },
118
+ {
119
+ clue: "A single moment worth showing up for.",
120
+ id: "single-event",
121
+ match: new RegExp(`^/events/${OBJECT_ID_PATH_SEGMENT_END}`)
122
+ },
123
+ {
124
+ clue: "What\u2019s happening around you, right now.",
125
+ id: "events-near-me",
126
+ match: "/events/events-near-me"
127
+ },
128
+ {
129
+ clue: "Where events appear as pins on a map.",
130
+ id: "events-map",
131
+ match: "/events/events-map"
132
+ },
133
+ {
134
+ clue: "A collection of events worth attending.",
135
+ id: "events",
136
+ match: "/events"
137
+ },
138
+ {
139
+ clue: "What\u2019s happening in a wider area \u2014 not just nearby.",
140
+ id: "events-region",
141
+ match: /^\/events\/region\/[^/]+$/
142
+ },
143
+ {
144
+ clue: "Where fun becomes a challenge.",
145
+ id: "games",
146
+ match: "/games"
147
+ },
148
+ {
149
+ clue: "Your starting point for everything.",
150
+ id: "home",
151
+ match: "/"
152
+ },
153
+ {
154
+ clue: "Where the app whispers what you shouldn\u2019t miss.",
155
+ id: "notifications",
156
+ match: "/notifications"
157
+ },
158
+ {
159
+ clue: "Where you fine-tune your experience.",
160
+ id: "options",
161
+ match: "/options"
162
+ },
163
+ {
164
+ clue: "An organisation or creator supporting the community.",
165
+ id: "single-partner",
166
+ match: new RegExp(`^/partners/${OBJECT_ID_PATH_SEGMENT_END}`)
167
+ },
168
+ {
169
+ clue: "Organisations and creators supporting the community.",
170
+ id: "partners",
171
+ match: "/partners"
172
+ },
173
+ {
174
+ clue: "A single published post in full view.",
175
+ id: "single-visitor-post",
176
+ match: new RegExp(`^/visitors/post/${OBJECT_ID_PATH_SEGMENT_END}`)
177
+ },
178
+ {
179
+ clue: "Your identity, on display.",
180
+ id: "profile",
181
+ match: "/profile"
182
+ },
183
+ {
184
+ clue: "One stallholder offering something valuable.",
185
+ id: "single-vendor",
186
+ match: new RegExp(`^/vendors/${OBJECT_ID_PATH_SEGMENT_END}`)
187
+ },
188
+ {
189
+ clue: "Where every stallholder waits under the right category.",
190
+ id: "vendors",
191
+ match: "/vendors"
192
+ },
193
+ {
194
+ clue: "Where you browse articles and posts from around the platform.",
195
+ id: "visitors",
196
+ match: "/visitors"
197
+ }
198
+ ];
199
+
200
+ // node_modules/@timardex/cluemart-shared/dist/chunk-MLNJAQVM.mjs
201
+ import dayjs2 from "dayjs";
202
+ var statusOptions = [
203
+ ...Object.values(EnumInviteStatus2).map((status) => ({
204
+ label: status,
205
+ value: status
206
+ })).sort((a, b) => a.label.localeCompare(b.label))
207
+ // Sort the options alphabetically
208
+ ];
209
+ var availableRegionTypes = Object.values(EnumRegions);
210
+ var availableRegionOptions = mapArrayToOptions(availableRegionTypes);
211
+ var paymentMethodOptions = mapArrayToOptions(
212
+ Object.values(EnumPaymentMethod)
213
+ );
214
+ var CM_SCHOOL_PROMO_CODE = `${PROMO_CODE_PREFIX}SCHOOL`;
215
+ var CM_AFFILIATE_PROMO_CODE = `${PROMO_CODE_PREFIX}AFFILIATE`;
216
+ var clothingAndFashion = [
217
+ {
218
+ id: "clothing-fashion",
219
+ name: "Clothing & Fashion",
220
+ description: "New, handmade, or upcycled clothing and accessories with a creative twist.",
221
+ subcategories: [
222
+ {
223
+ id: "apparel-babywear",
224
+ name: "Apparel & Babywear",
225
+ items: [
226
+ {
227
+ id: "apparel",
228
+ name: "Apparel",
229
+ description: "Dresses, t-shirts, jumpers, rompers, sets, kidswear."
230
+ },
231
+ {
232
+ id: "baby-toddler-apparel",
233
+ name: "Baby & Toddler Apparel",
234
+ description: "Handmade baby clothes, soft shoes, bibs, hats, knitted sets."
235
+ },
236
+ {
237
+ id: "upcycled-fashion",
238
+ name: "Upcycled Fashion",
239
+ description: "Reworked garments, patchwork pieces, restyled vintage."
240
+ },
241
+ {
242
+ id: "other-wearable-items",
243
+ name: "Other wearable items",
244
+ description: "Unique clothing not listed above."
245
+ }
246
+ ]
247
+ },
248
+ {
249
+ id: "fashion-accessories",
250
+ name: "Fashion Accessories",
251
+ items: [
252
+ {
253
+ id: "accessories",
254
+ name: "Accessories",
255
+ description: "Scarves, belts, gloves, hats, headbands, caps."
256
+ },
257
+ {
258
+ id: "shoes",
259
+ name: "Shoes",
260
+ description: "Handmade shoes, baby booties, sandals, slippers."
261
+ },
262
+ {
263
+ id: "bags-wallets",
264
+ name: "Bags & Wallets",
265
+ description: "Leather bags, fabric purses, wallets, backpacks, totes."
266
+ },
267
+ {
268
+ id: "other-accessories",
269
+ name: "Other accessories",
270
+ description: "Brooches, pins, or hybrid functional items."
271
+ }
272
+ ]
273
+ },
274
+ {
275
+ id: "jewelry-creative-wearables",
276
+ name: "Jewelry & Creative Wearables",
277
+ items: [
278
+ {
279
+ id: "jewelry",
280
+ name: "Jewelry",
281
+ description: "Necklaces, earrings, bracelets, rings, anklets."
282
+ },
283
+ {
284
+ id: "other-creative-wearables",
285
+ name: "Other creative wearables",
286
+ description: "Wearable art, statement pieces, bold handmade designs."
287
+ }
288
+ ]
289
+ },
290
+ {
291
+ id: "traditional-cultural-clothing-accessories",
292
+ name: "Traditional & Cultural Clothing and Accessories",
293
+ items: [
294
+ {
295
+ id: "traditional-clothing-accessories",
296
+ name: "Traditional Clothing & Accessories ",
297
+ description: "raditional clothing, jewellery, accessories and footwear from around the world, including both handmade and non-handmade items."
298
+ },
299
+ {
300
+ id: "other-traditional-cultural-items",
301
+ name: "Other Traditional & Cultural Items",
302
+ description: "traditional or culturally inspired wearables and decorative cultural pieces such as plates, table linens and similar items."
303
+ }
304
+ ]
305
+ }
306
+ ]
307
+ }
308
+ ];
309
+ var electronicsAndTechnology = [
310
+ {
311
+ id: "electronics-technology",
312
+ name: "Electronics & Technology",
313
+ description: "New, second-hand, or handmade tech and digital items commonly found at markets.",
314
+ subcategories: [
315
+ {
316
+ id: "mobile-everyday-tech",
317
+ name: "Mobile & Everyday Tech",
318
+ items: [
319
+ {
320
+ id: "mobile-phone-accessories",
321
+ name: "Mobile & Phone Accessories",
322
+ description: "Phone cases, holders, screen protectors, charging cables, power banks, grips."
323
+ },
324
+ {
325
+ id: "other-mobile-gadgets",
326
+ name: "Other mobile gadgets",
327
+ description: "Stands, styluses, SIM tools, cleaning kits, wallet accessories."
328
+ }
329
+ ]
330
+ },
331
+ {
332
+ id: "audio-music-creative-tech",
333
+ name: "Audio, Music & Creative Tech",
334
+ items: [
335
+ {
336
+ id: "audio-music-tech",
337
+ name: "Audio & Music Tech",
338
+ description: "Portable speakers, headphones, mini radios, Bluetooth adapters, sound accessories."
339
+ },
340
+ {
341
+ id: "instruments-music-gear",
342
+ name: "Instruments & Music Gear",
343
+ description: "Small electronic instruments, DIY synth kits, drum pads, loop machines."
344
+ },
345
+ {
346
+ id: "recording-creative-devices",
347
+ name: "Recording & Creative Devices",
348
+ description: "USB microphones, podcast tools, voice recorders, mobile lighting, content tools."
349
+ },
350
+ {
351
+ id: "other-audio-music-items",
352
+ name: "Other audio or music-related items",
353
+ description: "Musical gadgets or creative gear not listed above."
354
+ }
355
+ ]
356
+ },
357
+ {
358
+ id: "diy-gadgets-secondhand-finds",
359
+ name: "DIY, Gadgets & Second-Hand Finds",
360
+ items: [
361
+ {
362
+ id: "diy-electronics-tools",
363
+ name: "DIY Electronics & Tools",
364
+ description: "LED lights, USB gadgets, circuit boards, repair kits, tech-themed toys, novelty items."
365
+ },
366
+ {
367
+ id: "other-tech-finds",
368
+ name: "Other Tech Finds",
369
+ description: "Used electronics, smart gadgets, wearable tech, calculators, tablet stands, e-waste upcycles."
370
+ },
371
+ {
372
+ id: "other-technology-innovation-items",
373
+ name: "Other technology or innovation-related items",
374
+ description: "Anything not covered but clearly tech-driven."
375
+ }
376
+ ]
377
+ }
378
+ ]
379
+ }
380
+ ];
381
+ var foodAndBeverages = [
382
+ {
383
+ id: "food-beverages",
384
+ name: "Food & Beverages",
385
+ description: "Fresh produce, drinks, sweet and savoury street food, ready-to-eat meals, and packaged goods.",
386
+ subcategories: [
387
+ {
388
+ id: "fresh-food-groceries",
389
+ name: "Fresh Food & Groceries",
390
+ items: [
391
+ {
392
+ id: "fruits-vegetables",
393
+ name: "Fruits & Vegetables",
394
+ description: "Fresh seasonal fruit, organic vegetables, specialty produce, berries, tropical fruit, heritage varieties."
395
+ },
396
+ {
397
+ id: "meat-seafood",
398
+ name: "Meat & Seafood",
399
+ description: "Butcher cuts, fresh fish, smoked meats, sausages, seafood platters, artisanal jerky."
400
+ },
401
+ {
402
+ id: "dairy-eggs",
403
+ name: "Dairy & Eggs",
404
+ description: "Farm eggs, handmade cheeses, yoghurt, fresh milk, goat\u2019s milk products."
405
+ },
406
+ {
407
+ id: "bakery-pastries",
408
+ name: "Bakery & Pastries",
409
+ description: "Freshly baked bread, sourdough, bagels, croissants, focaccia, traditional baked goods."
410
+ },
411
+ {
412
+ id: "spices-condiments",
413
+ name: "Spices & Condiments",
414
+ description: "Dried herbs, spice blends, specialty salts, hot sauces, infused oils, chutneys."
415
+ },
416
+ {
417
+ id: "packaged-specialty-foods",
418
+ name: "Packaged & Specialty Foods",
419
+ description: "Honey, jams, preserves, pickles, nut butters, sauces, pre-packaged snacks."
420
+ },
421
+ {
422
+ id: "other-fresh-food-items",
423
+ name: "Other fresh food items",
424
+ description: "Items that don\u2019t fit above, e.g. fermented foods, plant-based substitutes."
425
+ }
426
+ ]
427
+ },
428
+ {
429
+ id: "beverages-specialty-drinks",
430
+ name: "Beverages & Specialty Drinks",
431
+ items: [
432
+ {
433
+ id: "fresh-juices-smoothies",
434
+ name: "Fresh Juices & Smoothies",
435
+ description: "Cold-pressed juices, detox blends, fruit smoothies, tropical mixes."
436
+ },
437
+ {
438
+ id: "coffee-teas",
439
+ name: "Coffee & Teas",
440
+ description: "Espresso, pour-over coffee, herbal teas, matcha, bubble tea, locally blended tea."
441
+ },
442
+ {
443
+ id: "dairy-plant-based-drinks",
444
+ name: "Dairy & Plant-Based Drinks",
445
+ description: "Milkshakes, lassis, almond/oat milk drinks, coconut water."
446
+ },
447
+ {
448
+ id: "alcoholic-beverages",
449
+ name: "Alcoholic Beverages",
450
+ description: "Local wines, craft beer, mead, cider, infused spirits, cocktail kits."
451
+ },
452
+ {
453
+ id: "other-beverages",
454
+ name: "Other beverages",
455
+ description: "Kombucha, kefir, energy drinks, non-alcoholic wines or beers."
456
+ }
457
+ ]
458
+ },
459
+ {
460
+ id: "savoury-prepared-foods-street-food",
461
+ name: "Savoury Prepared Foods & Street Food",
462
+ items: [
463
+ {
464
+ id: "local-specialties",
465
+ name: "Local Specialties",
466
+ description: "Meat pies, hangi, seafood chowder, fry bread, traditional NZ dishes."
467
+ },
468
+ {
469
+ id: "asian-cuisine",
470
+ name: "Asian Cuisine",
471
+ description: "Sushi, bao buns, dumplings, ramen, satay, spring rolls, fried rice."
472
+ },
473
+ {
474
+ id: "mediterranean-cuisine",
475
+ name: "Mediterranean Cuisine",
476
+ description: "Falafel, hummus wraps, souvlaki, Greek salad, dolma."
477
+ },
478
+ {
479
+ id: "italian-delights",
480
+ name: "Italian Delights",
481
+ description: "Pizza, calzone, focaccia, fresh pasta, arancini."
482
+ },
483
+ {
484
+ id: "bbq-grilled-foods",
485
+ name: "BBQ & Grilled Foods",
486
+ description: "Kebabs, grilled chicken, ribs, burgers, sausages."
487
+ },
488
+ {
489
+ id: "savoury-crepes-pancakes",
490
+ name: "Savoury Crepes & Pancakes",
491
+ description: "Filled savoury crepes, mini savoury pancakes."
492
+ },
493
+ {
494
+ id: "savoury-baked-goods-pastries",
495
+ name: "Savoury Baked Goods & Pastries",
496
+ description: "Quiches, savoury muffins, filled savoury pastries, empanadas."
497
+ },
498
+ {
499
+ id: "vegan-vegetarian-dishes",
500
+ name: "Vegan & Vegetarian Dishes",
501
+ description: "Buddha bowls, plant-based burgers, salads, vegan sushi."
502
+ },
503
+ {
504
+ id: "other-savoury-foods",
505
+ name: "Other Savoury Foods",
506
+ description: "Fusion dishes, mixed platters, savoury meal kits."
507
+ }
508
+ ]
509
+ },
510
+ {
511
+ id: "sweet-prepared-foods",
512
+ name: "Sweet Prepared Foods",
513
+ items: [
514
+ {
515
+ id: "sweet-crepes-pancakes-fried-treats",
516
+ name: "Sweet Crepes, Pancakes & Fried Treats",
517
+ description: "Crepes, waffles, mini pancakes, muffins, doughnuts."
518
+ },
519
+ {
520
+ id: "sweet-baked-goods-desserts",
521
+ name: "Sweet Baked Goods & Desserts",
522
+ description: "Cakes, pastries, slices, trifles, layered desserts."
523
+ },
524
+ {
525
+ id: "fruit-based-snacks",
526
+ name: "Fruit-Based Snacks",
527
+ description: "Fruit skewers, dried fruit packs, chocolate-dipped fruit."
528
+ },
529
+ {
530
+ id: "candy-confectionery",
531
+ name: "Candy & Confectionery",
532
+ description: "Fudge, handmade candies, toffee, nougat, brittle."
533
+ },
534
+ {
535
+ id: "other-sweet-foods",
536
+ name: "Other Sweet Foods",
537
+ description: "Fusion desserts, sweet platters, sweet meal kits."
538
+ }
539
+ ]
540
+ }
541
+ ]
542
+ }
543
+ ];
544
+ var handmadeAndLocalProducts = [
545
+ {
546
+ id: "handmade-local-products",
547
+ name: "Handmade & Local Products",
548
+ description: "Unique, handmade, or locally produced artisan goods.",
549
+ subcategories: [
550
+ {
551
+ id: "home-living",
552
+ name: "Home & Living",
553
+ items: [
554
+ {
555
+ id: "ceramics-pottery",
556
+ name: "Ceramics & Pottery",
557
+ description: "Handmade mugs, vases, bowls, decorative plates, plant pots."
558
+ },
559
+ {
560
+ id: "candles-home-scents",
561
+ name: "Candles & Home Scents",
562
+ description: "Soy candles, beeswax candles, wax melts, incense sticks, room sprays and herbal sachets."
563
+ },
564
+ {
565
+ id: "botanical-crafts",
566
+ name: "Botanical Crafts",
567
+ description: "Dried-flower d\xE9cor and pressed-flower crafts"
568
+ },
569
+ {
570
+ id: "textiles-embroidery",
571
+ name: "Textiles & Embroidery",
572
+ description: "Handsewn items, embroidered napkins, home linens, aprons, fabric gift wraps, handmade fabric bags, quilted goods, personalized textile gifts."
573
+ },
574
+ {
575
+ id: "woodcraft-metalcraft",
576
+ name: "Woodcraft & Metalcraft",
577
+ description: "Wooden boards, handmade frames, sculptures, metal signs, furniture."
578
+ },
579
+ {
580
+ id: "handmade-soaps-natural-body-goods",
581
+ name: "Handmade Soaps & Natural Body Goods",
582
+ description: "Handmade soaps, balms, oils, bath items"
583
+ },
584
+ {
585
+ id: "seasonal-festive-crafts",
586
+ name: "Seasonal & Festive Crafts",
587
+ description: "Christmas, Easter and seasonal handmade decor"
588
+ },
589
+ {
590
+ id: "other-home-living-products",
591
+ name: "Other home & living products",
592
+ description: "Items that don't fit above but serve home-related purposes."
593
+ }
594
+ ]
595
+ },
596
+ {
597
+ id: "art-personal-expression",
598
+ name: "Art & Personal Expression",
599
+ items: [
600
+ {
601
+ id: "paintings-illustrations",
602
+ name: "Paintings & Illustrations",
603
+ description: "Paintings, canvas art, hand-drawn illustrations, digital prints, graphic art and calligraphy pieces."
604
+ },
605
+ {
606
+ id: "sculptures-carvings",
607
+ name: "Sculptures & Carvings ",
608
+ description: "Sculptures made from wood, stone, metal, clay or resin, carved decorative pieces and artistic 3D works."
609
+ },
610
+ {
611
+ id: "creative-handmade-alternative-art",
612
+ name: "Creative Handmade & Alternative Art",
613
+ description: "Handmade textile d\xE9cor, fabric ornaments, mixed-media art, creative craft pieces and modern handmade artworks."
614
+ },
615
+ {
616
+ id: "handmade-mini-figures-decor",
617
+ name: "Handmade Mini Figures & D\xE9cor",
618
+ description: "Small handmade figures, tiny houses and crafted mini decorative items."
619
+ },
620
+ {
621
+ id: "other-artistic-expressive-products",
622
+ name: "Other Artistic or Expressive Products",
623
+ description: "Custom artworks, specialty handmade d\xE9cor, unique crafts."
624
+ }
625
+ ]
626
+ },
627
+ {
628
+ id: "handmade-jewellery-accessories-cultural-crafts",
629
+ name: "Handmade Jewellery, Accessories & Cultural Crafts",
630
+ items: [
631
+ {
632
+ id: "jewellery-handmade-items-nz-traditional-materials",
633
+ name: "Jewellery & Handmade Items from NZ Traditional Materials",
634
+ description: "Handmade jewellery and decorative or functional items crafted from pounamu, bone, wood and other traditional New Zealand materials."
635
+ },
636
+ {
637
+ id: "maori-pasifika-cultural-crafts-clothing",
638
+ name: "M\u0101ori & Pasifika Cultural Crafts and Clothing",
639
+ description: "Culturally inspired handmade items, accessories and garments featuring M\u0101ori or Pasifika motifs, traditional patterns and regional craftsmanship."
640
+ },
641
+ {
642
+ id: "traditional-handmade-clothing-jewellery-crafts-global-cultures",
643
+ name: "Traditional Handmade Clothing, Jewellery & Crafts from Global Cultures",
644
+ description: "Handcrafted clothing, jewellery and cultural items from diverse traditions \u2014 including Asian, African, European, Middle Eastern, Indian, Chinese, Japanese, Pacific, and other culturally significant handmade pieces."
645
+ },
646
+ {
647
+ id: "other-handmade-cultural-items",
648
+ name: "Other Handmade Cultural Items",
649
+ description: "Unique or culturally inspired handmade pieces not specifically covered in the categories above."
650
+ }
651
+ ]
652
+ },
653
+ {
654
+ id: "gift-ideas-accessories",
655
+ name: "Gift Ideas & Accessories",
656
+ items: [
657
+ {
658
+ id: "handmade-pens-keychains-fridge-magnets",
659
+ name: "Handmade Pens, Keychains and Fridge Magnets",
660
+ description: null
661
+ },
662
+ {
663
+ id: "gift-packaging-wrapping-accessories",
664
+ name: "Gift Packaging & Wrapping Accessories",
665
+ description: null
666
+ },
667
+ {
668
+ id: "handmade-crochet-knitting-fibre-crafts",
669
+ name: "Handmade Crochet, Knitting & Fibre Crafts",
670
+ description: "Handmade crochet and knitted items, fabric-based crafts, small decorative pieces, creative fibre artworks and unique handcrafted accessories."
671
+ },
672
+ {
673
+ id: "handmade-toys-mini-play-items",
674
+ name: "Handmade Toys & Mini Play Items",
675
+ description: "small handmade toys, soft toys, wooden miniatures, crochet or felt play pieces"
676
+ },
677
+ {
678
+ id: "other-small-handmade-gifts-accessories",
679
+ name: "Other small handmade gifts or accessories",
680
+ description: "Compact creative items made to surprise or delight."
681
+ }
682
+ ]
683
+ }
684
+ ]
685
+ }
686
+ ];
687
+ var healthAndWellness = [
688
+ {
689
+ id: "health-wellness",
690
+ name: "Health & Wellness",
691
+ description: "Natural products and services that promote wellbeing, body care, and holistic health.",
692
+ subcategories: [
693
+ {
694
+ id: "body-skincare",
695
+ name: "Body & Skincare",
696
+ items: [
697
+ {
698
+ id: "skincare-body-products",
699
+ name: "Skincare & Body Products",
700
+ description: "Soaps, creams, lip balms, bath salts, bath bombs, body oils, natural deodorants."
701
+ },
702
+ {
703
+ id: "other-body-care-items",
704
+ name: "Other body care items",
705
+ description: "Additional handmade or eco-conscious personal care goods."
706
+ }
707
+ ]
708
+ },
709
+ {
710
+ id: "aromatherapy-herbal-wellness",
711
+ name: "Aromatherapy & Herbal Wellness",
712
+ items: [
713
+ {
714
+ id: "aromatherapy-herbal-remedies",
715
+ name: "Aromatherapy & Herbal Remedies",
716
+ description: "Essential oils, herbal balms, massage oils, salves, natural teas, rollers."
717
+ },
718
+ {
719
+ id: "other-herbal-aroma-products",
720
+ name: "Other herbal or aroma-based products",
721
+ description: "Wellness blends, herb sachets, custom infusions."
722
+ }
723
+ ]
724
+ },
725
+ {
726
+ id: "wellness-tools-accessories",
727
+ name: "Wellness Tools & Accessories",
728
+ items: [
729
+ {
730
+ id: "wellness-accessories",
731
+ name: "Wellness Accessories",
732
+ description: "Yoga mats, meditation cushions, eye pillows, incense, smudging sticks, eco water bottles, wellness journals."
733
+ },
734
+ {
735
+ id: "spiritual-tools-crystals",
736
+ name: "Spiritual Tools & Crystals",
737
+ description: "Healing crystals, gemstone bracelets, pendulums, sprays, spiritual kits, altar decor."
738
+ },
739
+ {
740
+ id: "other-wellness-spiritual-items",
741
+ name: "Other wellness or spiritual items",
742
+ description: "Items that aid relaxation, focus, or inner work."
743
+ }
744
+ ]
745
+ }
746
+ ]
747
+ }
748
+ ];
749
+ var homeGardenHousehold = [
750
+ {
751
+ id: "home-garden-household-goods",
752
+ name: "Home, Garden & Household Goods",
753
+ description: "Functional, decorative, and eco-conscious products designed for everyday use indoors and outdoors.",
754
+ subcategories: [
755
+ {
756
+ id: "home-decor-living",
757
+ name: "Home Decor & Living",
758
+ items: [
759
+ {
760
+ id: "home-decor",
761
+ name: "Home Decor",
762
+ description: "Cushions, wall art, table runners, vases, trays, mirrors, handmade centerpieces."
763
+ },
764
+ {
765
+ id: "kitchenware-dining",
766
+ name: "Kitchenware & Dining",
767
+ description: "Mugs, bowls, cutting boards, utensils, jars, coasters, kitchen textiles."
768
+ },
769
+ {
770
+ id: "mini-figures-decor",
771
+ name: "Mini Figures & D\xE9cor",
772
+ description: "handmade or non-handmade small figures, tiny houses and miniature decorative items."
773
+ },
774
+ {
775
+ id: "other-indoor-home-items",
776
+ name: "Other indoor home items",
777
+ description: "Any decorative or practical household items not listed above."
778
+ }
779
+ ]
780
+ },
781
+ {
782
+ id: "cleaning-eco-essentials",
783
+ name: "Cleaning & Eco Essentials",
784
+ items: [
785
+ {
786
+ id: "cleaning-eco-supplies",
787
+ name: "Cleaning & Eco Supplies",
788
+ description: "Beeswax wraps, reusable cloths, brushes, natural soaps, detergent bars, eco sponges."
789
+ },
790
+ {
791
+ id: "other-eco-cleaning-items",
792
+ name: "Other eco or cleaning items",
793
+ description: "Environmentally friendly goods not listed above."
794
+ }
795
+ ]
796
+ },
797
+ {
798
+ id: "garden-outdoor-living",
799
+ name: "Garden & Outdoor Living",
800
+ items: [
801
+ {
802
+ id: "plants-botanical-decor",
803
+ name: "Plants & Botanical Decor",
804
+ description: "Potted herbs, succulents, dried flowers, terrariums, plant-based ornaments."
805
+ },
806
+ {
807
+ id: "fresh-flowers-botanical-bouquets",
808
+ name: "Fresh Flowers & Botanical Bouquets",
809
+ description: "Cut flowers, seasonal bouquets, simple floral arrangements, native flower selections, and other fresh botanical items."
810
+ },
811
+ {
812
+ id: "natural-decor-nature-inspired-elements",
813
+ name: "Natural Decor & Nature-Inspired Elements",
814
+ description: "Seashell d\xE9cor, driftwood pieces, sand ornaments, natural wood accents, stone or mineral decorations, and other nature-based decorative items."
815
+ },
816
+ {
817
+ id: "garden-tools-outdoor-items",
818
+ name: "Garden Tools & Outdoor Items",
819
+ description: "Plant markers, garden signs, stakes, small tools, wind chimes, gifts."
820
+ },
821
+ {
822
+ id: "other-outdoor-garden-products",
823
+ name: "Other outdoor or garden products",
824
+ description: "Functional or decorative items for outside use."
825
+ }
826
+ ]
827
+ }
828
+ ]
829
+ }
830
+ ];
831
+ var petProductsAndAnimalGoods = [
832
+ {
833
+ id: "pet-products-animal-goods",
834
+ name: "Pet Products & Animal Goods",
835
+ description: "Items for pets, pet lovers, or animal-themed market stalls.",
836
+ subcategories: [
837
+ {
838
+ id: "products-for-pets",
839
+ name: "Products for Pets",
840
+ items: [
841
+ {
842
+ id: "pet-food-treats",
843
+ name: "Pet Food & Treats",
844
+ description: "Homemade dog biscuits, cat snacks, natural chews, pet-safe cakes, training treats."
845
+ },
846
+ {
847
+ id: "apparel-toys-accessories",
848
+ name: "Apparel, Toys & Accessories",
849
+ description: "Leashes, collars, harnesses, toys, grooming tools, beds, travel gear, jumpers, bandanas."
850
+ },
851
+ {
852
+ id: "other-pet-products",
853
+ name: "Other pet products",
854
+ description: "Any pet-related items not listed above."
855
+ }
856
+ ]
857
+ },
858
+ {
859
+ id: "small-pets-birds-exotic-animals",
860
+ name: "Small Pets, Birds & Exotic Animals",
861
+ items: [
862
+ {
863
+ id: "products-small-pets-birds-exotics",
864
+ name: "Products for Small Pets, Birds & Exotics",
865
+ description: "Toys, enclosures, perches, feeding bowls, bedding, habitat decor, transport gear, and care items for birds, rabbits, hamsters, reptiles, turtles, aquarium pets, and other exotic species."
866
+ },
867
+ {
868
+ id: "other-small-exotic-animal-items",
869
+ name: "Other small or exotic animal items",
870
+ description: "Unusual accessories for non-mainstream pets."
871
+ }
872
+ ]
873
+ },
874
+ {
875
+ id: "farm-working-animals",
876
+ name: "Farm & Working Animals",
877
+ items: [
878
+ {
879
+ id: "goods-for-farm-working-animals",
880
+ name: "Goods for Farm & Working Animals",
881
+ description: "Treats, care products, equipment, signage and accessories for chickens, goats, alpacas, horses, and other livestock."
882
+ },
883
+ {
884
+ id: "other-farm-animal-items",
885
+ name: "Other farm animal-related items",
886
+ description: "Rural, barnyard, or utility-specific gear not listed above."
887
+ }
888
+ ]
889
+ },
890
+ {
891
+ id: "animal-themed-gifts-custom-items",
892
+ name: "Animal-Themed Gifts & Custom Items",
893
+ items: [
894
+ {
895
+ id: "pet-art-custom-gifts",
896
+ name: "Pet Art & Custom Gifts",
897
+ description: "Pet portraits, name tags, personalized bowls, breed-specific items, pet-themed home decor and stationery."
898
+ },
899
+ {
900
+ id: "other-animal-themed-gifts",
901
+ name: "Other animal-themed gifts",
902
+ description: "Artistic or sentimental items made for animal lovers."
903
+ }
904
+ ]
905
+ }
906
+ ]
907
+ }
908
+ ];
909
+ var serviceAndExperience = [
910
+ {
911
+ id: "services-experiences",
912
+ name: "Services & Experiences",
913
+ description: "On-site offerings that provide entertainment, personal care, learning, or interactive activities beyond products.",
914
+ subcategories: [
915
+ {
916
+ id: "personal-care-body-art",
917
+ name: "Personal Care & Body Art",
918
+ items: [
919
+ {
920
+ id: "nails-handcare",
921
+ name: "Nails & Handcare",
922
+ description: "Nail painting, decoration, quick manicures, temporary nail extensions."
923
+ },
924
+ {
925
+ id: "hair-styling-braiding",
926
+ name: "Hair Styling & Braiding",
927
+ description: "Hair braiding, plaits, child-friendly festival hairstyles."
928
+ },
929
+ {
930
+ id: "face-body-decoration",
931
+ name: "Face & Body Decoration",
932
+ description: "Henna, glitter tattoos, face painting, light makeup, eyelash styling, professional tattooing (where permitted)."
933
+ },
934
+ {
935
+ id: "other-beauty-grooming-services",
936
+ name: "Other beauty or grooming services",
937
+ description: "Small-scale personal care options offered on-site."
938
+ }
939
+ ]
940
+ },
941
+ {
942
+ id: "practical-wellness-services",
943
+ name: "Practical & Wellness Services",
944
+ items: [
945
+ {
946
+ id: "mobile-practical-services",
947
+ name: "Mobile & Practical Services",
948
+ description: "Shoe repair, phone repairs, knife sharpening, key cutting, battery replacement, bike repairs, engraving."
949
+ },
950
+ {
951
+ id: "wellness-alternative-therapies",
952
+ name: "Wellness & Alternative Therapies",
953
+ description: "Massage, aromatherapy, reflexology, energy healing (e.g. Reiki), natural consultations."
954
+ },
955
+ {
956
+ id: "other-service-based-offerings",
957
+ name: "Other service-based offerings",
958
+ description: "Wellness or functional services not listed above."
959
+ }
960
+ ]
961
+ },
962
+ {
963
+ id: "creative-educational-experiences",
964
+ name: "Creative & Educational Experiences",
965
+ items: [
966
+ {
967
+ id: "creative-workshops-maker-services",
968
+ name: "Creative Workshops & Maker Services",
969
+ description: "Candle making, pottery, jewelry crafting, soap or balm workshops, calligraphy, seasonal crafts."
970
+ },
971
+ {
972
+ id: "education-awareness-stalls",
973
+ name: "Education & Awareness Stalls",
974
+ description: "Eco awareness, cultural storytelling, local history, first aid demos, health booths, sustainability education, kids\u2019 science displays."
975
+ },
976
+ {
977
+ id: "other-creative-educational-services",
978
+ name: "Other creative or educational services",
979
+ description: "Informal learning, demonstrations, or community-focused sessions."
980
+ }
981
+ ]
982
+ },
983
+ {
984
+ id: "kids-activities-family-fun",
985
+ name: "Kids\u2019 Activities & Family Fun",
986
+ items: [
987
+ {
988
+ id: "kids-activities-fun",
989
+ name: "Kids\u2019 Activities & Fun",
990
+ description: "Face painting, glitter tattoos, pony rides, bouncy castles, small amusement rides, balloon twisting, animal petting zones."
991
+ },
992
+ {
993
+ id: "other-family-oriented-activities",
994
+ name: "Other family-oriented activities",
995
+ description: "On-site entertainment that engages children or family groups."
996
+ }
997
+ ]
998
+ }
999
+ ]
1000
+ }
1001
+ ];
1002
+ var toysChildren = [
1003
+ {
1004
+ id: "toys-childrens-items",
1005
+ name: "Toys & Children\u2019s Items",
1006
+ description: "Products and services made for or inspired by children.",
1007
+ subcategories: [
1008
+ {
1009
+ id: "toys-playthings",
1010
+ name: "Toys & Playthings",
1011
+ items: [
1012
+ {
1013
+ id: "toys-classic-electric-character",
1014
+ name: "Toys \u2013 Classic, Electric & Character-Based",
1015
+ description: "Building blocks, dolls, puzzles, plush animals, toy vehicles, remote-control toys, light-up gadgets, character figurines, themed playsets."
1016
+ },
1017
+ {
1018
+ id: "handmade-toys-crafty-playthings",
1019
+ name: "Handmade Toys & Crafty Playthings",
1020
+ description: "Wooden puzzles, crocheted animals, felt toys, fabric dolls, DIY kits, nature-inspired games, sensory toys."
1021
+ },
1022
+ {
1023
+ id: "other-play-items",
1024
+ name: "Other play items",
1025
+ description: "Toys not listed above, including limited-edition or hybrid items."
1026
+ }
1027
+ ]
1028
+ },
1029
+ {
1030
+ id: "educational-developmental",
1031
+ name: "Educational & Developmental",
1032
+ items: [
1033
+ {
1034
+ id: "educational-developmental-tools",
1035
+ name: "Educational & Developmental Tools",
1036
+ description: "STEM kits, Montessori toys, storybooks, picture books, flashcards, early learning games, language tools."
1037
+ },
1038
+ {
1039
+ id: "other-educational-experience-based-items",
1040
+ name: "Other educational or experience-based items",
1041
+ description: "Creative experiences or learning aids not listed above."
1042
+ }
1043
+ ]
1044
+ },
1045
+ {
1046
+ id: "baby-kidswear-accessories",
1047
+ name: "Baby & Kidswear + Accessories",
1048
+ items: [
1049
+ {
1050
+ id: "baby-kidswear-accessories",
1051
+ name: "Baby & Kidswear + Accessories",
1052
+ description: "Handmade baby clothes, toddler outfits, bibs, hats, headbands, bags, pacifier clips, soft shoes."
1053
+ },
1054
+ {
1055
+ id: "baby-developmental-soft-toys",
1056
+ name: "Baby Developmental Soft Toys",
1057
+ description: "Sensory toys, rattles, fabric books, teething items, high-contrast cards, and early-skill. Montessori materials designed to support infants\u2019 cognitive and motor development."
1058
+ },
1059
+ {
1060
+ id: "other-childrens-clothing-accessories",
1061
+ name: "Other children\u2019s clothing or accessories",
1062
+ description: "Unique fashion or functional pieces for kids."
1063
+ }
1064
+ ]
1065
+ }
1066
+ ]
1067
+ }
1068
+ ];
1069
+ var vintageAndAntique = [
1070
+ {
1071
+ id: "vintage-antique",
1072
+ name: "Vintage & Antique",
1073
+ description: "Unique, historic, or nostalgic items with collectible or decorative value.",
1074
+ subcategories: [
1075
+ {
1076
+ id: "vintage-antique-clothing-accessories",
1077
+ name: "Vintage & Antique Clothing & Accessories",
1078
+ items: [
1079
+ {
1080
+ id: "clothing-vintage-fashion",
1081
+ name: "Clothing and wearable items from past eras",
1082
+ description: "Vintage dresses, jackets, hats, gloves, belts, bags, shoes, jewellery."
1083
+ },
1084
+ {
1085
+ id: "other-clothing-accessory-items",
1086
+ name: "Other clothing-related items",
1087
+ description: "Hair clips, brooches, pins, scarf rings, small fashion accessories."
1088
+ }
1089
+ ]
1090
+ },
1091
+ {
1092
+ id: "collectibles-memorabilia",
1093
+ name: "Collectibles & Memorabilia",
1094
+ items: [
1095
+ {
1096
+ id: "small-collectible-items",
1097
+ name: "Small collectible items with historical or nostalgic significance",
1098
+ description: "Coins, stamps, toys, postcards, comics, sports cards, vintage packaging."
1099
+ },
1100
+ {
1101
+ id: "other-collectible-items",
1102
+ name: "Other collectible items",
1103
+ description: "Rare small objects, miniature figurines, special-edition items."
1104
+ }
1105
+ ]
1106
+ },
1107
+ {
1108
+ id: "homewares-decor-curiosities",
1109
+ name: "Homewares, Decor & Curiosities",
1110
+ items: [
1111
+ {
1112
+ id: "decorative-functional-vintage-items",
1113
+ name: "Decorative or functional items with a vintage or antique aesthetic",
1114
+ description: "Teacups, plates, vases, mirrors, clocks, furniture, old tools, lanterns, typewriters, curiosities."
1115
+ },
1116
+ {
1117
+ id: "handmade-vintage-art",
1118
+ name: "Handmade vintage art",
1119
+ description: "Paintings, sculptures, crafted pieces."
1120
+ },
1121
+ {
1122
+ id: "other-home-decor-items",
1123
+ name: "Other home or decor items",
1124
+ description: "Decorative pieces not listed above, unique household objects."
1125
+ }
1126
+ ]
1127
+ },
1128
+ {
1129
+ id: "vintage-media-printed-nostalgia",
1130
+ name: "Vintage Media & Printed Nostalgia",
1131
+ items: [
1132
+ {
1133
+ id: "older-media-printed-works",
1134
+ name: "Older media formats and printed works",
1135
+ description: "Vinyl records, cassette tapes, CDs, DVDs, books, magazines, board games, posters."
1136
+ },
1137
+ {
1138
+ id: "other-media-printed-items",
1139
+ name: "Other media or printed items",
1140
+ description: "Maps, manuals, leaflets, out-of-print materials."
1141
+ }
1142
+ ]
1143
+ },
1144
+ {
1145
+ id: "other-vintage-antique-items",
1146
+ name: "Other Vintage & Antique Items",
1147
+ items: [
1148
+ {
1149
+ id: "any-vintage-antique-items-not-listed",
1150
+ name: "Any vintage or antique items not listed above",
1151
+ description: "Unique, rare or uncategorised pieces."
1152
+ }
1153
+ ]
1154
+ }
1155
+ ]
1156
+ }
1157
+ ];
1158
+ var categoryColors = {
1159
+ "clothing-fashion": "#9D4EDD",
1160
+ "electronics-technology": "#3AF3FF",
1161
+ "food-beverages": "#FF0D1F",
1162
+ "handmade-local-products": "#EE7E54",
1163
+ "health-wellness": "#E23794",
1164
+ "home-garden-household-goods": "#067325",
1165
+ "pet-products-animal-goods": "#68E788",
1166
+ "services-experiences": "#2E16A5",
1167
+ "toys-childrens-items": "#FFF966",
1168
+ "vintage-antique": "#8D6748"
1169
+ };
1170
+ var assignColorToCategories = (categories) => {
1171
+ const result = categories.map((category) => ({
1172
+ ...category,
1173
+ color: categoryColors[category.id]
1174
+ }));
1175
+ return result;
1176
+ };
1177
+ var availableCategories = assignColorToCategories([
1178
+ ...foodAndBeverages,
1179
+ ...handmadeAndLocalProducts,
1180
+ ...clothingAndFashion,
1181
+ ...homeGardenHousehold,
1182
+ ...toysChildren,
1183
+ ...healthAndWellness,
1184
+ ...electronicsAndTechnology,
1185
+ ...vintageAndAntique,
1186
+ ...petProductsAndAnimalGoods,
1187
+ ...serviceAndExperience
1188
+ ]);
1189
+ var AFFILIATE_REWARDS = {
1190
+ [
1191
+ "NEW_EVENT_REGISTRATION"
1192
+ /* NEW_EVENT_REGISTRATION */
1193
+ ]: {
1194
+ description: "10 points for new event registration (one-time reward)",
1195
+ value: 10
1196
+ },
1197
+ [
1198
+ "NEW_VENDOR_REGISTRATION"
1199
+ /* NEW_VENDOR_REGISTRATION */
1200
+ ]: {
1201
+ description: "5 points for new vendor registration (one-time reward)",
1202
+ value: 5
1203
+ },
1204
+ [
1205
+ "ACTIVE_VENDOR_PRO_SUBSCRIPTION"
1206
+ /* ACTIVE_VENDOR_PRO_SUBSCRIPTION */
1207
+ ]: {
1208
+ description: "3 points for active vendor pro subscription (monthly reward)",
1209
+ value: 3
1210
+ },
1211
+ [
1212
+ "ACTIVE_VENDOR_STANDARD_SUBSCRIPTION"
1213
+ /* ACTIVE_VENDOR_STANDARD_SUBSCRIPTION */
1214
+ ]: {
1215
+ description: "1 point for active vendor standard subscription (monthly reward)",
1216
+ value: 1
1217
+ },
1218
+ [
1219
+ "ACTIVE_VENDOR_BONUS_REWARD"
1220
+ /* ACTIVE_VENDOR_BONUS_REWARD */
1221
+ ]: {
1222
+ description: "5 bonus points for every 10th active vendor (one-time reward)",
1223
+ value: 5
1224
+ },
1225
+ [
1226
+ "ACTIVE_EVENT_WITH_VENDOR_REGISTRATIONS"
1227
+ /* ACTIVE_EVENT_WITH_VENDOR_REGISTRATIONS */
1228
+ ]: {
1229
+ description: "40 points for active event with vendor registrations (one-time reward)",
1230
+ value: 40
1231
+ }
1232
+ };
1233
+ function createAffiliateReward(rewardType, createdAt) {
1234
+ const reward = AFFILIATE_REWARDS[rewardType];
1235
+ return {
1236
+ createdAt,
1237
+ redeemedAt: null,
1238
+ rewardDescription: reward.description,
1239
+ rewardType,
1240
+ rewardValue: reward.value
1241
+ };
1242
+ }
1243
+
39
1244
  // src/service/promoCode/normalizePromoCode.ts
40
1245
  function normalizePromoCode(decoratedPromoCode) {
41
1246
  const normalized = decoratedPromoCode?.trim().toUpperCase();
@@ -175,44 +1380,6 @@ async function sendPushNotifications({
175
1380
  }
176
1381
  }
177
1382
 
178
- // src/service/affiliate/createAffiliateReward.ts
179
- var AFFILIATE_REWARDS = {
180
- [EnumAffiliateRewardType.NEW_EVENT_REGISTRATION]: {
181
- description: "10 points for new event registration (one-time reward)",
182
- value: 10
183
- },
184
- [EnumAffiliateRewardType.NEW_VENDOR_REGISTRATION]: {
185
- description: "5 points for new vendor registration (one-time reward)",
186
- value: 5
187
- },
188
- [EnumAffiliateRewardType.ACTIVE_VENDOR_PRO_SUBSCRIPTION]: {
189
- description: "3 points for active vendor pro subscription (monthly reward)",
190
- value: 3
191
- },
192
- [EnumAffiliateRewardType.ACTIVE_VENDOR_STANDARD_SUBSCRIPTION]: {
193
- description: "1 point for active vendor standard subscription (monthly reward)",
194
- value: 1
195
- },
196
- [EnumAffiliateRewardType.ACTIVE_VENDOR_BONUS_REWARD]: {
197
- description: "5 bonus points for every 10th active vendor (one-time reward)",
198
- value: 5
199
- },
200
- [EnumAffiliateRewardType.ACTIVE_EVENT_WITH_VENDOR_REGISTRATIONS]: {
201
- description: "40 points for active event with vendor registrations (one-time reward)",
202
- value: 40
203
- }
204
- };
205
- function createAffiliateReward(rewardType, createdAt) {
206
- const reward = AFFILIATE_REWARDS[rewardType];
207
- return {
208
- createdAt,
209
- redeemedAt: null,
210
- rewardDescription: reward.description,
211
- rewardType,
212
- rewardValue: reward.value
213
- };
214
- }
215
-
216
1383
  // src/service/affiliate/vendorSubscriptionRewards.ts
217
1384
  function isPayingStripeSubscription(stripe) {
218
1385
  if (!stripe?.subscriptionId) return false;
@@ -611,11 +1778,11 @@ function convertObjectIdsToStrings(obj) {
611
1778
  }
612
1779
 
613
1780
  // src/service/event/updateAllEventDateTimeStatuses.ts
614
- import dayjs from "dayjs";
615
- import customParseFormat from "dayjs/plugin/customParseFormat";
1781
+ import dayjs3 from "dayjs";
1782
+ import customParseFormat2 from "dayjs/plugin/customParseFormat";
616
1783
  import isoWeek from "dayjs/plugin/isoWeek";
617
- dayjs.extend(customParseFormat);
618
- dayjs.extend(isoWeek);
1784
+ dayjs3.extend(customParseFormat2);
1785
+ dayjs3.extend(isoWeek);
619
1786
  function getFutureEventStatus(startDateTime, now) {
620
1787
  const hoursUntilStart = startDateTime.diff(now, "hour", true);
621
1788
  if (hoursUntilStart > 0 && hoursUntilStart <= 4) {
@@ -635,14 +1802,14 @@ function getFutureEventStatus(startDateTime, now) {
635
1802
  }
636
1803
  return EnumEventDateStatus.UPCOMING;
637
1804
  }
638
- function updateSingleDateTimeStatus(dateTime, now = dayjs()) {
1805
+ function updateSingleDateTimeStatus(dateTime, now = dayjs3()) {
639
1806
  const dateTimeFormat = `${dateFormat} ${timeFormat}`;
640
- const startDateTime = dayjs(
1807
+ const startDateTime = dayjs3(
641
1808
  `${dateTime.startDate} ${dateTime.startTime}`,
642
1809
  dateTimeFormat,
643
1810
  true
644
1811
  );
645
- const endDateTime = dayjs(
1812
+ const endDateTime = dayjs3(
646
1813
  `${dateTime.endDate} ${dateTime.endTime}`,
647
1814
  dateTimeFormat,
648
1815
  true
@@ -724,7 +1891,7 @@ async function updateModelDateTimeStatuses(model, now) {
724
1891
  return updated;
725
1892
  }
726
1893
  async function updateAllEventDateTimeStatuses() {
727
- const now = dayjs();
1894
+ const now = dayjs3();
728
1895
  const [eventCount, marketCount] = await Promise.all([
729
1896
  updateModelDateTimeStatuses(EventModel, now),
730
1897
  updateModelDateTimeStatuses(
@@ -774,12 +1941,10 @@ function updateRelationDatesToUnavailable(relationDates, eventDateTime) {
774
1941
  }
775
1942
  export {
776
1943
  ACTIVE_NOT_DELETED_FILTER,
777
- AFFILIATE_REWARDS,
778
1944
  activeAffiliateCodeExists,
779
1945
  awardAffiliateVendorSubscriptionRewards,
780
1946
  connectToDatabase,
781
1947
  convertObjectIdsToStrings,
782
- createAffiliateReward,
783
1948
  didRemoveAnyEventDates,
784
1949
  findAffiliateByPromoCode,
785
1950
  findEventOrImportedMarketById,