@timardex/cluemart-server-shared 1.0.291 → 1.0.293

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.
@@ -40,7 +40,7 @@ import {
40
40
  socialShareResourceSchema,
41
41
  termsAgreementSchema,
42
42
  userLicenseSchema
43
- } from "../chunk-IGEC5D7N.mjs";
43
+ } from "../chunk-YLRGIY2S.mjs";
44
44
  export {
45
45
  APP_SETTINGS_ID,
46
46
  AdModel,
@@ -3666,6 +3666,12 @@ var EnumGameType = /* @__PURE__ */ ((EnumGameType2) => {
3666
3666
  EnumGameType2["ODD_ONE_OUT"] = "oddOneOut";
3667
3667
  return EnumGameType2;
3668
3668
  })(EnumGameType || {});
3669
+ var EnumAffiliateParticipantType = /* @__PURE__ */ ((EnumAffiliateParticipantType2) => {
3670
+ EnumAffiliateParticipantType2["INDIVIDUAL"] = "INDIVIDUAL";
3671
+ EnumAffiliateParticipantType2["SOLE_TRADER"] = "SOLE_TRADER";
3672
+ EnumAffiliateParticipantType2["COMPANY"] = "COMPANY";
3673
+ return EnumAffiliateParticipantType2;
3674
+ })(EnumAffiliateParticipantType || {});
3669
3675
  var EnumAffiliateRewardType = /* @__PURE__ */ ((EnumAffiliateRewardType22) => {
3670
3676
  EnumAffiliateRewardType22["ACTIVE_EVENT_WITH_VENDOR_REGISTRATIONS"] = "ACTIVE_EVENT_WITH_VENDOR_REGISTRATIONS";
3671
3677
  EnumAffiliateRewardType22["ACTIVE_VENDOR_BONUS_REWARD"] = "ACTIVE_VENDOR_BONUS_REWARD";
@@ -7524,6 +7530,14 @@ var AFFILIATE_DETAILS_FIELDS_FRAGMENT = gql`
7524
7530
  contactDetails {
7525
7531
  mobilePhone
7526
7532
  }
7533
+ irdNumber
7534
+ participantType
7535
+ email
7536
+ firstName
7537
+ lastName
7538
+ location {
7539
+ ...LocationFields
7540
+ }
7527
7541
  region
7528
7542
  socialMedia {
7529
7543
  ...SocialMediaFields
@@ -7533,6 +7547,7 @@ var AFFILIATE_DETAILS_FIELDS_FRAGMENT = gql`
7533
7547
  }
7534
7548
  }
7535
7549
  ${AFFILIATE_BANK_ACCOUNT_DETAILS_FIELDS_FRAGMENT}
7550
+ ${LOCATION_FIELDS_FRAGMENT}
7536
7551
  ${SOCIAL_MEDIA_FIELDS_FRAGMENT}
7537
7552
  ${TERMS_AGREEMENT_FIELDS_FRAGMENT}
7538
7553
  `;
@@ -7598,6 +7613,14 @@ var DELETE_AFFILIATE_MUTATION = gql`
7598
7613
  deleteAffiliate(_id: $_id)
7599
7614
  }
7600
7615
  `;
7616
+ var REDEEM_AFFILIATE_REWARD_MUTATION = gql`
7617
+ mutation redeemAffiliateReward($affiliateId: ID!) {
7618
+ redeemAffiliateReward(affiliateId: $affiliateId) {
7619
+ ...AffiliateFields
7620
+ }
7621
+ }
7622
+ ${AFFILIATE_FIELDS_FRAGMENT}
7623
+ `;
7601
7624
  var PKG = "@timardex/cluemart-shared";
7602
7625
  var IMAGE_EXTENSION = ".webp";
7603
7626
  var posterIds = [
@@ -9333,6 +9356,16 @@ var affiliateDetailsSchema = new MongooseSchema25(
9333
9356
  type: affiliateBankAccountDetailsSchema
9334
9357
  },
9335
9358
  contactDetails: { required: true, type: affiliateContactDetailsSchema },
9359
+ email: { required: true, type: String },
9360
+ firstName: { required: true, type: String },
9361
+ irdNumber: { required: true, type: String },
9362
+ lastName: { required: true, type: String },
9363
+ location: { required: true, type: locationsSchema },
9364
+ participantType: {
9365
+ enum: Object.values(EnumAffiliateParticipantType),
9366
+ required: true,
9367
+ type: String
9368
+ },
9336
9369
  region: { required: true, type: String },
9337
9370
  socialMedia: { required: false, type: [SocialMediaTypeSchema] },
9338
9371
  termsAgreement: { required: true, type: termsAgreementSchema }
@@ -9853,14 +9886,16 @@ async function notifyUsers({
9853
9886
  try {
9854
9887
  await sendPushNotifications(payload);
9855
9888
  const uniqueUserIds = await saveNotificationsInDb(payload);
9856
- if (!pubsub) {
9857
- return;
9858
- }
9859
- for (const userId of uniqueUserIds) {
9860
- await publishNotificationEvents(userId, pubsub);
9889
+ const persisted = payload.userIds.length === 0 || uniqueUserIds.length > 0;
9890
+ if (pubsub) {
9891
+ for (const userId of uniqueUserIds) {
9892
+ await publishNotificationEvents(userId, pubsub);
9893
+ }
9861
9894
  }
9895
+ return persisted;
9862
9896
  } catch (error) {
9863
9897
  console.error("Error in notifyUsers:", error);
9898
+ return false;
9864
9899
  }
9865
9900
  }
9866
9901