@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.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, CreateBulkNotificationInput, NotificationType, ChatMessageType, ParticipantType, ChatType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, ResourceContactDetailsType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, TesterType, UserActivityEvent, UserType, VendorType, VendorInfoType, EventType, StallType, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType } from '@timardex/cluemart-shared';
2
+ import { AdType, CreateBulkNotificationInput, NotificationType, ChatMessageType, ParticipantType, ChatType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, ResourceContactDetailsType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, TesterType, UserActivityEvent, UserType, VendorType, VendorInfoType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType } from '@timardex/cluemart-shared';
3
3
  import mongoose from 'mongoose';
4
4
  export { default as mongoose } from 'mongoose';
5
5
  import { NotificationCount } from '@timardex/cluemart-shared/types';
@@ -570,6 +570,15 @@ declare const StallTypeSchema: mongoose.Schema<StallType, mongoose.Model<StallTy
570
570
  } & {
571
571
  __v: number;
572
572
  }>;
573
+ declare const refundPolicySchema: mongoose.Schema<RefundPolicy, mongoose.Model<RefundPolicy, any, any, any, mongoose.Document<unknown, any, RefundPolicy, any, {}> & RefundPolicy & {
574
+ _id: mongoose.Types.ObjectId;
575
+ } & {
576
+ __v: number;
577
+ }, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, RefundPolicy, mongoose.Document<unknown, {}, mongoose.FlatRecord<RefundPolicy>, {}, mongoose.ResolveSchemaOptions<mongoose.DefaultSchemaOptions>> & mongoose.FlatRecord<RefundPolicy> & {
578
+ _id: mongoose.Types.ObjectId;
579
+ } & {
580
+ __v: number;
581
+ }>;
573
582
  type SchemaEventInfoType = Omit<EventInfoType, "eventId"> & {
574
583
  eventId: ObjectId;
575
584
  };
@@ -644,4 +653,4 @@ declare function sendPushNotifications({ data, message, title, userIds, }: Schem
644
653
  */
645
654
  declare function updateAdStatuses(): Promise<void>;
646
655
 
647
- export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, ChatReportModel, EnumPubSubEvents, EventInfoModel, EventModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, ParticipantSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, TesterModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, dateTimeSchema, locationGeoSchema, locationsSchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, userLicenseSchema };
656
+ export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, ChatReportModel, EnumPubSubEvents, EventInfoModel, EventModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, ParticipantSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, TesterModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, dateTimeSchema, locationGeoSchema, locationsSchema, refundPolicySchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, userLicenseSchema };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, CreateBulkNotificationInput, NotificationType, ChatMessageType, ParticipantType, ChatType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, ResourceContactDetailsType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, TesterType, UserActivityEvent, UserType, VendorType, VendorInfoType, EventType, StallType, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType } from '@timardex/cluemart-shared';
2
+ import { AdType, CreateBulkNotificationInput, NotificationType, ChatMessageType, ParticipantType, ChatType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, ResourceContactDetailsType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, TesterType, UserActivityEvent, UserType, VendorType, VendorInfoType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType } from '@timardex/cluemart-shared';
3
3
  import mongoose from 'mongoose';
4
4
  export { default as mongoose } from 'mongoose';
5
5
  import { NotificationCount } from '@timardex/cluemart-shared/types';
@@ -570,6 +570,15 @@ declare const StallTypeSchema: mongoose.Schema<StallType, mongoose.Model<StallTy
570
570
  } & {
571
571
  __v: number;
572
572
  }>;
573
+ declare const refundPolicySchema: mongoose.Schema<RefundPolicy, mongoose.Model<RefundPolicy, any, any, any, mongoose.Document<unknown, any, RefundPolicy, any, {}> & RefundPolicy & {
574
+ _id: mongoose.Types.ObjectId;
575
+ } & {
576
+ __v: number;
577
+ }, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, RefundPolicy, mongoose.Document<unknown, {}, mongoose.FlatRecord<RefundPolicy>, {}, mongoose.ResolveSchemaOptions<mongoose.DefaultSchemaOptions>> & mongoose.FlatRecord<RefundPolicy> & {
578
+ _id: mongoose.Types.ObjectId;
579
+ } & {
580
+ __v: number;
581
+ }>;
573
582
  type SchemaEventInfoType = Omit<EventInfoType, "eventId"> & {
574
583
  eventId: ObjectId;
575
584
  };
@@ -644,4 +653,4 @@ declare function sendPushNotifications({ data, message, title, userIds, }: Schem
644
653
  */
645
654
  declare function updateAdStatuses(): Promise<void>;
646
655
 
647
- export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, ChatReportModel, EnumPubSubEvents, EventInfoModel, EventModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, ParticipantSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, TesterModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, dateTimeSchema, locationGeoSchema, locationsSchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, userLicenseSchema };
656
+ export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, ChatReportModel, EnumPubSubEvents, EventInfoModel, EventModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, ParticipantSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, TesterModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, dateTimeSchema, locationGeoSchema, locationsSchema, refundPolicySchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, userLicenseSchema };
package/dist/index.mjs CHANGED
@@ -8435,6 +8435,11 @@ var EVENT_INFO = gql`
8435
8435
  link
8436
8436
  paymentMethod
8437
8437
  }
8438
+ refundPolicy {
8439
+ category
8440
+ label
8441
+ value
8442
+ }
8438
8443
  requirements {
8439
8444
  category
8440
8445
  label
@@ -10337,7 +10342,14 @@ var eventInfoSchema = create$3().shape({
10337
10342
  return value < applicationDeadlineHours;
10338
10343
  }
10339
10344
  ),
10340
- paymentInfo: create$2().of(paymentInfoSchema).min(1, "At least one payment method is required").required("Payment info is required")
10345
+ paymentInfo: create$2().of(paymentInfoSchema).min(1, "At least one payment method is required").required("Payment info is required"),
10346
+ refundPolicy: create$2().of(
10347
+ create$3({
10348
+ category: create$8().required("Category is required"),
10349
+ label: create$6().required("Label is required"),
10350
+ value: create$7().required("Value is required")
10351
+ })
10352
+ ).min(1, "At least one refund policy item is required").required("Refund policy is required")
10341
10353
  });
10342
10354
  var vendroMenuSchema = create$3().shape({
10343
10355
  description: create$6().trim().nullable().defined().test(
@@ -10390,15 +10402,27 @@ var vendorInfoSchema = create$3().shape({
10390
10402
  ).min(1, "Food flavors list must contain at least one item").required("Food flavors are required"),
10391
10403
  packaging: create$2().of(create$6().defined()).min(1, "Packaging list must contain at least one item").required("Packaging is required"),
10392
10404
  priceRange: create$3().shape({
10393
- max: create$5().min(1).required("Max price is required").test(
10405
+ max: create$6().required("Max price is required").test(
10406
+ "is-number",
10407
+ "Max price must be a valid number",
10408
+ (value) => value !== void 0 && value !== "" && !isNaN(Number(value))
10409
+ ).test(
10394
10410
  "is-greater",
10395
10411
  "Max price must be greater than or equal to Min price",
10396
10412
  function(max) {
10397
10413
  const { min } = this.parent;
10398
- return max >= min;
10414
+ if (!max || !min) return true;
10415
+ const maxNum = Number(max);
10416
+ const minNum = Number(min);
10417
+ if (isNaN(maxNum) || isNaN(minNum)) return true;
10418
+ return maxNum >= minNum;
10399
10419
  }
10400
10420
  ),
10401
- min: create$5().min(1).required("Min price is required")
10421
+ min: create$6().required("Min price is required").test(
10422
+ "is-number",
10423
+ "Min price must be a valid number",
10424
+ (value) => value !== void 0 && value !== "" && !isNaN(Number(value))
10425
+ )
10402
10426
  }),
10403
10427
  producedIn: create$2().of(create$6().defined()).min(1, "Produced in list must contain at least one item").required("Produced in is required")
10404
10428
  }),
@@ -10436,8 +10460,24 @@ var vendorInfoSchema = create$3().shape({
10436
10460
  }).optional(),
10437
10461
  stallInfo: create$3().shape({
10438
10462
  size: create$3().shape({
10439
- depth: create$5().min(1).required("Depth is required"),
10440
- width: create$5().min(1).required("Width is required")
10463
+ depth: create$6().required("Depth is required").test(
10464
+ "is-number",
10465
+ "Depth must be a valid number",
10466
+ (value) => value !== void 0 && value !== "" && !isNaN(Number(value))
10467
+ ).test(
10468
+ "is-positive",
10469
+ "Depth must be greater than 0",
10470
+ (value) => value !== void 0 && value !== "" && Number(value) > 0
10471
+ ),
10472
+ width: create$6().required("Width is required").test(
10473
+ "is-number",
10474
+ "Width must be a valid number",
10475
+ (value) => value !== void 0 && value !== "" && !isNaN(Number(value))
10476
+ ).test(
10477
+ "is-positive",
10478
+ "Width must be greater than 0",
10479
+ (value) => value !== void 0 && value !== "" && Number(value) > 0
10480
+ )
10441
10481
  })
10442
10482
  }),
10443
10483
  vendorId: create$6().trim().required("Vendor ID is required")
@@ -10675,7 +10715,6 @@ var EnumPostType = /* @__PURE__ */ ((EnumPostType2) => {
10675
10715
  return EnumPostType2;
10676
10716
  })(EnumPostType || {});
10677
10717
  var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
10678
- EnumPostContentType2["COVER"] = "cover";
10679
10718
  EnumPostContentType2["IMAGE"] = "image";
10680
10719
  EnumPostContentType2["LIST"] = "list";
10681
10720
  EnumPostContentType2["TEXTAREA"] = "textarea";
@@ -10861,19 +10900,28 @@ var requirementsSchema = new MongooseSchema(
10861
10900
  // Prevents Mongoose from creating an additional _id field for
10862
10901
  }
10863
10902
  );
10903
+ var refundPolicySchema = new MongooseSchema(
10904
+ {
10905
+ category: { required: true, type: String },
10906
+ label: { required: true, type: String },
10907
+ value: { required: true, type: Boolean }
10908
+ },
10909
+ { _id: false }
10910
+ );
10864
10911
  var schema = new MongooseSchema(
10865
10912
  {
10866
10913
  applicationDeadlineHours: { required: true, type: Number },
10867
- dateTime: [dateTimeSchema2],
10914
+ dateTime: { required: true, type: [dateTimeSchema2] },
10868
10915
  eventId: {
10869
10916
  ref: "Event",
10870
- required: false,
10917
+ required: true,
10871
10918
  type: mongoose.Schema.Types.ObjectId
10872
10919
  },
10873
10920
  packInTime: { required: true, type: Number },
10874
10921
  paymentDueHours: { required: true, type: Number },
10875
- paymentInfo: [paymentInfoSchema2],
10876
- requirements: [requirementsSchema]
10922
+ paymentInfo: { required: true, type: [paymentInfoSchema2] },
10923
+ refundPolicy: { required: true, type: [refundPolicySchema] },
10924
+ requirements: { required: false, type: [requirementsSchema] }
10877
10925
  },
10878
10926
  { timestamps: true }
10879
10927
  );
@@ -11026,6 +11074,11 @@ var userLicenseSchema = new MongooseSchema3(
11026
11074
  enum: Object.values(EnumUserLicence),
11027
11075
  required: true,
11028
11076
  type: String
11077
+ },
11078
+ prevLicenceType: {
11079
+ enum: Object.values(EnumUserLicence),
11080
+ required: false,
11081
+ type: String
11029
11082
  }
11030
11083
  },
11031
11084
  { _id: false, timestamps: false }
@@ -11983,8 +12036,8 @@ var schema10 = new MongooseSchema15(
11983
12036
  },
11984
12037
  packaging: { required: true, type: [String] },
11985
12038
  priceRange: {
11986
- max: { required: true, type: Number },
11987
- min: { required: true, type: Number }
12039
+ max: { required: true, type: String },
12040
+ min: { required: true, type: String }
11988
12041
  },
11989
12042
  producedIn: { required: true, type: [String] }
11990
12043
  },
@@ -11995,8 +12048,8 @@ var schema10 = new MongooseSchema15(
11995
12048
  },
11996
12049
  stallInfo: {
11997
12050
  size: {
11998
- depth: { required: true, type: Number },
11999
- width: { required: true, type: Number }
12051
+ depth: { required: true, type: String },
12052
+ width: { required: true, type: String }
12000
12053
  }
12001
12054
  },
12002
12055
  vendorId: {
@@ -12395,6 +12448,7 @@ export {
12395
12448
  locationGeoSchema,
12396
12449
  locationsSchema,
12397
12450
  mongoose21 as mongoose,
12451
+ refundPolicySchema,
12398
12452
  relationDatesSchema,
12399
12453
  resourceRelationsSchema,
12400
12454
  saveNotificationsInDb,