@timardex/cluemart-server-shared 1.0.89 → 1.0.91

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/index.cjs CHANGED
@@ -1707,6 +1707,7 @@ __export(index_exports, {
1707
1707
  locationGeoSchema: () => locationGeoSchema,
1708
1708
  locationsSchema: () => locationsSchema,
1709
1709
  mongoose: () => import_mongoose22.default,
1710
+ refundPolicySchema: () => refundPolicySchema,
1710
1711
  relationDatesSchema: () => relationDatesSchema,
1711
1712
  resourceRelationsSchema: () => resourceRelationsSchema,
1712
1713
  saveNotificationsInDb: () => saveNotificationsInDb,
@@ -8488,6 +8489,11 @@ var EVENT_INFO = gql`
8488
8489
  link
8489
8490
  paymentMethod
8490
8491
  }
8492
+ refundPolicy {
8493
+ category
8494
+ label
8495
+ value
8496
+ }
8491
8497
  requirements {
8492
8498
  category
8493
8499
  label
@@ -10390,7 +10396,14 @@ var eventInfoSchema = create$3().shape({
10390
10396
  return value < applicationDeadlineHours;
10391
10397
  }
10392
10398
  ),
10393
- paymentInfo: create$2().of(paymentInfoSchema).min(1, "At least one payment method is required").required("Payment info is required")
10399
+ paymentInfo: create$2().of(paymentInfoSchema).min(1, "At least one payment method is required").required("Payment info is required"),
10400
+ refundPolicy: create$2().of(
10401
+ create$3({
10402
+ category: create$8().required("Category is required"),
10403
+ label: create$6().required("Label is required"),
10404
+ value: create$7().required("Value is required")
10405
+ })
10406
+ ).min(1, "At least one refund policy item is required").required("Refund policy is required")
10394
10407
  });
10395
10408
  var vendroMenuSchema = create$3().shape({
10396
10409
  description: create$6().trim().nullable().defined().test(
@@ -10443,15 +10456,27 @@ var vendorInfoSchema = create$3().shape({
10443
10456
  ).min(1, "Food flavors list must contain at least one item").required("Food flavors are required"),
10444
10457
  packaging: create$2().of(create$6().defined()).min(1, "Packaging list must contain at least one item").required("Packaging is required"),
10445
10458
  priceRange: create$3().shape({
10446
- max: create$5().min(1).required("Max price is required").test(
10459
+ max: create$6().required("Max price is required").test(
10460
+ "is-number",
10461
+ "Max price must be a valid number",
10462
+ (value) => value !== void 0 && value !== "" && !isNaN(Number(value))
10463
+ ).test(
10447
10464
  "is-greater",
10448
10465
  "Max price must be greater than or equal to Min price",
10449
10466
  function(max) {
10450
10467
  const { min } = this.parent;
10451
- return max >= min;
10468
+ if (!max || !min) return true;
10469
+ const maxNum = Number(max);
10470
+ const minNum = Number(min);
10471
+ if (isNaN(maxNum) || isNaN(minNum)) return true;
10472
+ return maxNum >= minNum;
10452
10473
  }
10453
10474
  ),
10454
- min: create$5().min(1).required("Min price is required")
10475
+ min: create$6().required("Min price is required").test(
10476
+ "is-number",
10477
+ "Min price must be a valid number",
10478
+ (value) => value !== void 0 && value !== "" && !isNaN(Number(value))
10479
+ )
10455
10480
  }),
10456
10481
  producedIn: create$2().of(create$6().defined()).min(1, "Produced in list must contain at least one item").required("Produced in is required")
10457
10482
  }),
@@ -10489,8 +10514,24 @@ var vendorInfoSchema = create$3().shape({
10489
10514
  }).optional(),
10490
10515
  stallInfo: create$3().shape({
10491
10516
  size: create$3().shape({
10492
- depth: create$5().min(1).required("Depth is required"),
10493
- width: create$5().min(1).required("Width is required")
10517
+ depth: create$6().required("Depth is required").test(
10518
+ "is-number",
10519
+ "Depth must be a valid number",
10520
+ (value) => value !== void 0 && value !== "" && !isNaN(Number(value))
10521
+ ).test(
10522
+ "is-positive",
10523
+ "Depth must be greater than 0",
10524
+ (value) => value !== void 0 && value !== "" && Number(value) > 0
10525
+ ),
10526
+ width: create$6().required("Width is required").test(
10527
+ "is-number",
10528
+ "Width must be a valid number",
10529
+ (value) => value !== void 0 && value !== "" && !isNaN(Number(value))
10530
+ ).test(
10531
+ "is-positive",
10532
+ "Width must be greater than 0",
10533
+ (value) => value !== void 0 && value !== "" && Number(value) > 0
10534
+ )
10494
10535
  })
10495
10536
  }),
10496
10537
  vendorId: create$6().trim().required("Vendor ID is required")
@@ -10728,7 +10769,6 @@ var EnumPostType = /* @__PURE__ */ ((EnumPostType2) => {
10728
10769
  return EnumPostType2;
10729
10770
  })(EnumPostType || {});
10730
10771
  var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
10731
- EnumPostContentType2["COVER"] = "cover";
10732
10772
  EnumPostContentType2["IMAGE"] = "image";
10733
10773
  EnumPostContentType2["LIST"] = "list";
10734
10774
  EnumPostContentType2["TEXTAREA"] = "textarea";
@@ -10914,19 +10954,28 @@ var requirementsSchema = new MongooseSchema(
10914
10954
  // Prevents Mongoose from creating an additional _id field for
10915
10955
  }
10916
10956
  );
10957
+ var refundPolicySchema = new MongooseSchema(
10958
+ {
10959
+ category: { required: true, type: String },
10960
+ label: { required: true, type: String },
10961
+ value: { required: true, type: Boolean }
10962
+ },
10963
+ { _id: false }
10964
+ );
10917
10965
  var schema = new MongooseSchema(
10918
10966
  {
10919
10967
  applicationDeadlineHours: { required: true, type: Number },
10920
- dateTime: [dateTimeSchema2],
10968
+ dateTime: { required: true, type: [dateTimeSchema2] },
10921
10969
  eventId: {
10922
10970
  ref: "Event",
10923
- required: false,
10971
+ required: true,
10924
10972
  type: import_mongoose.default.Schema.Types.ObjectId
10925
10973
  },
10926
10974
  packInTime: { required: true, type: Number },
10927
10975
  paymentDueHours: { required: true, type: Number },
10928
- paymentInfo: [paymentInfoSchema2],
10929
- requirements: [requirementsSchema]
10976
+ paymentInfo: { required: true, type: [paymentInfoSchema2] },
10977
+ refundPolicy: { required: true, type: [refundPolicySchema] },
10978
+ requirements: { required: false, type: [requirementsSchema] }
10930
10979
  },
10931
10980
  { timestamps: true }
10932
10981
  );
@@ -11079,6 +11128,11 @@ var userLicenseSchema = new MongooseSchema3(
11079
11128
  enum: Object.values(EnumUserLicence),
11080
11129
  required: true,
11081
11130
  type: String
11131
+ },
11132
+ prevLicenceType: {
11133
+ enum: Object.values(EnumUserLicence),
11134
+ required: false,
11135
+ type: String
11082
11136
  }
11083
11137
  },
11084
11138
  { _id: false, timestamps: false }
@@ -12036,8 +12090,8 @@ var schema10 = new MongooseSchema15(
12036
12090
  },
12037
12091
  packaging: { required: true, type: [String] },
12038
12092
  priceRange: {
12039
- max: { required: true, type: Number },
12040
- min: { required: true, type: Number }
12093
+ max: { required: true, type: String },
12094
+ min: { required: true, type: String }
12041
12095
  },
12042
12096
  producedIn: { required: true, type: [String] }
12043
12097
  },
@@ -12048,8 +12102,8 @@ var schema10 = new MongooseSchema15(
12048
12102
  },
12049
12103
  stallInfo: {
12050
12104
  size: {
12051
- depth: { required: true, type: Number },
12052
- width: { required: true, type: Number }
12105
+ depth: { required: true, type: String },
12106
+ width: { required: true, type: String }
12053
12107
  }
12054
12108
  },
12055
12109
  vendorId: {
@@ -12449,6 +12503,7 @@ var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
12449
12503
  locationGeoSchema,
12450
12504
  locationsSchema,
12451
12505
  mongoose,
12506
+ refundPolicySchema,
12452
12507
  relationDatesSchema,
12453
12508
  resourceRelationsSchema,
12454
12509
  saveNotificationsInDb,