@timardex/cluemart-server-shared 1.0.260 → 1.0.262

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.
@@ -39,7 +39,7 @@ import {
39
39
  socialShareResourceSchema,
40
40
  termsAgreementSchema,
41
41
  userLicenseSchema
42
- } from "../chunk-JFVETLOC.mjs";
42
+ } from "../chunk-YRFUGDQ4.mjs";
43
43
  export {
44
44
  APP_SETTINGS_ID,
45
45
  AdModel,
@@ -3420,6 +3420,7 @@ var EnumUserRole = /* @__PURE__ */ ((EnumUserRole22) => {
3420
3420
  EnumUserRole22["MARKETING"] = "marketing";
3421
3421
  EnumUserRole22["MODERATOR"] = "moderator";
3422
3422
  EnumUserRole22["SUPPORT"] = "support";
3423
+ EnumUserRole22["AFFILIATE"] = "affiliate";
3423
3424
  return EnumUserRole22;
3424
3425
  })(EnumUserRole || {});
3425
3426
  var EnumEventDateStatus = /* @__PURE__ */ ((EnumEventDateStatus22) => {
@@ -5020,6 +5021,12 @@ var REDEEMED_REWARD_FIELDS_FRAGMENT = gql`
5020
5021
  redeemedAt
5021
5022
  }
5022
5023
  `;
5024
+ var AFFILIATE_FIELDS_FRAGMENT = gql`
5025
+ fragment AffiliateFields on AffiliateType {
5026
+ affiliateCode
5027
+ pointsAvailable
5028
+ }
5029
+ `;
5023
5030
  var USER_FIELDS_FRAGMENT = gql`
5024
5031
  fragment UserFields on UserType {
5025
5032
  _id
@@ -5027,6 +5034,9 @@ var USER_FIELDS_FRAGMENT = gql`
5027
5034
  associates {
5028
5035
  ...AssociatesFields
5029
5036
  }
5037
+ affiliate {
5038
+ ...AffiliateFields
5039
+ }
5030
5040
  avatar {
5031
5041
  ...ResourceImageFields
5032
5042
  }
@@ -5070,6 +5080,7 @@ var USER_FIELDS_FRAGMENT = gql`
5070
5080
  ${LICENCE_FIELDS_FRAGMENT}
5071
5081
  ${LOCATION_FIELDS_FRAGMENT}
5072
5082
  ${REDEEMED_REWARD_FIELDS_FRAGMENT}
5083
+ ${AFFILIATE_FIELDS_FRAGMENT}
5073
5084
  `;
5074
5085
  var STALL_TYPE_FIELDS_FRAGMENT = gql`
5075
5086
  fragment StallTypeFields on StallTypeType {
@@ -5331,7 +5342,7 @@ var GET_EVENTS_BY_REGION = gql`
5331
5342
  `;
5332
5343
  var SEARCH_EVENTS = gql`
5333
5344
  query searchEvents(
5334
- $region: String
5345
+ $region: String!
5335
5346
  $search: String
5336
5347
  $tags: [String]
5337
5348
  $dateStatus: EventDateStatusEnumType
@@ -5597,7 +5608,7 @@ var GET_VENDORS_BY_REGION = gql`
5597
5608
  ${VENDOR}
5598
5609
  `;
5599
5610
  var SEARCH_VENDORS = gql`
5600
- query searchVendors($search: String!, $region: String) {
5611
+ query searchVendors($search: String!, $region: String!) {
5601
5612
  vendorSearch(search: $search, region: $region) {
5602
5613
  ...VendorFields
5603
5614
  }
@@ -5728,7 +5739,7 @@ var GET_PARTNERS_BY_REGION = gql`
5728
5739
  ${PARTNER}
5729
5740
  `;
5730
5741
  var SEARCH_PARTNERS = gql`
5731
- query searchPartners($search: String!, $region: String) {
5742
+ query searchPartners($search: String!, $region: String!) {
5732
5743
  partnersSearch(search: $search, region: $region) {
5733
5744
  ...PartnerFields
5734
5745
  }
@@ -7611,7 +7622,7 @@ async function saveNotificationsInDb(payload) {
7611
7622
  // src/service/sendPushNotifications.ts
7612
7623
  var import_expo_server_sdk = require("expo-server-sdk");
7613
7624
 
7614
- // node_modules/@timardex/cluemart-shared/dist/chunk-4SNW63TJ.mjs
7625
+ // node_modules/@timardex/cluemart-shared/dist/chunk-KZTOISPA.mjs
7615
7626
  var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
7616
7627
  EnumOSPlatform22["ANDROID"] = "android";
7617
7628
  EnumOSPlatform22["IOS"] = "ios";
@@ -8564,9 +8575,20 @@ var redeemedRewardSchema = new MongooseSchema11(
8564
8575
  },
8565
8576
  { _id: false }
8566
8577
  );
8578
+ var affiliateSchema = new MongooseSchema11(
8579
+ {
8580
+ affiliateCode: { required: true, type: String },
8581
+ pointsAvailable: { required: true, type: Number }
8582
+ },
8583
+ { _id: false }
8584
+ );
8567
8585
  var schema7 = new MongooseSchema11(
8568
8586
  {
8569
8587
  active: { default: false, required: true, type: Boolean },
8588
+ affiliate: {
8589
+ required: false,
8590
+ type: affiliateSchema
8591
+ },
8570
8592
  associates: {
8571
8593
  required: false,
8572
8594
  type: [associatesSchema]
@@ -8665,6 +8687,7 @@ var schema7 = new MongooseSchema11(
8665
8687
  },
8666
8688
  { strict: false, timestamps: true }
8667
8689
  );
8690
+ schema7.index({ "affiliate.affiliateCode": 1 }, { sparse: true, unique: true });
8668
8691
  schema7.index({ "associates.email": 1 });
8669
8692
  schema7.index({ "licences.expiryDate": 1 });
8670
8693
  schema7.index({ "licences.licenceType": 1 });
@@ -9247,6 +9270,7 @@ var schema16 = new MongooseSchema24(
9247
9270
  },
9248
9271
  { timestamps: true }
9249
9272
  );
9273
+ schema16.index({ schoolCode: 1 }, { unique: true });
9250
9274
  var SchoolModel = import_mongoose25.default.models.School || import_mongoose25.default.model("School", schema16);
9251
9275
 
9252
9276
  // src/service/updateAdStatus.ts