@timardex/cluemart-shared 1.5.788 → 1.5.790

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.
Files changed (39) hide show
  1. package/dist/{affiliate-0oKa4qBB.d.ts → affiliate-B1RBuV0w.d.ts} +7 -2
  2. package/dist/{affiliate-msmhMpNi.d.mts → affiliate-qEbJvGVD.d.mts} +7 -2
  3. package/dist/{chunk-JP76OR4F.mjs → chunk-B6DDY5XL.mjs} +11 -1
  4. package/dist/{chunk-JP76OR4F.mjs.map → chunk-B6DDY5XL.mjs.map} +1 -1
  5. package/dist/{chunk-63F5FP5R.mjs → chunk-LPPBP3LJ.mjs} +1 -1
  6. package/dist/{chunk-63F5FP5R.mjs.map → chunk-LPPBP3LJ.mjs.map} +1 -1
  7. package/dist/{chunk-G4LVRM53.mjs → chunk-Q23R46FE.mjs} +2 -2
  8. package/dist/{chunk-UGA3F23W.mjs → chunk-R6ONCJE5.mjs} +2 -2
  9. package/dist/{chunk-ZZBBANGP.mjs → chunk-TWPPOPRF.mjs} +2 -2
  10. package/dist/formFields/index.mjs +3 -3
  11. package/dist/graphql/index.cjs +10 -0
  12. package/dist/graphql/index.cjs.map +1 -1
  13. package/dist/graphql/index.d.mts +1 -1
  14. package/dist/graphql/index.d.ts +1 -1
  15. package/dist/graphql/index.mjs +1 -1
  16. package/dist/hooks/index.cjs +69 -7
  17. package/dist/hooks/index.cjs.map +1 -1
  18. package/dist/hooks/index.d.mts +4 -2
  19. package/dist/hooks/index.d.ts +4 -2
  20. package/dist/hooks/index.mjs +62 -12
  21. package/dist/hooks/index.mjs.map +1 -1
  22. package/dist/index.cjs +10 -0
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.mts +7 -2
  25. package/dist/index.d.ts +7 -2
  26. package/dist/index.mjs +10 -0
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/sharing/index.mjs +3 -3
  29. package/dist/types/index.cjs.map +1 -1
  30. package/dist/types/index.d.mts +1 -1
  31. package/dist/types/index.d.ts +1 -1
  32. package/dist/types/index.mjs +1 -1
  33. package/dist/utils/index.d.mts +1 -1
  34. package/dist/utils/index.d.ts +1 -1
  35. package/dist/utils/index.mjs +2 -2
  36. package/package.json +1 -1
  37. /package/dist/{chunk-G4LVRM53.mjs.map → chunk-Q23R46FE.mjs.map} +0 -0
  38. /package/dist/{chunk-UGA3F23W.mjs.map → chunk-R6ONCJE5.mjs.map} +0 -0
  39. /package/dist/{chunk-ZZBBANGP.mjs.map → chunk-TWPPOPRF.mjs.map} +0 -0
@@ -4,7 +4,7 @@ import { EnumResourceType, EnumEventDateStatus } from '../enums/index.mjs';
4
4
  import { A as AuthPayloadType, R as RefreshTokenPayloadType, S as SafeUserType, a as RedeemRewardResponse, P as PartnerType, b as ResourceByUser, c as AdType, E as EnumAdStatus, d as SubscriptionPlansResponse, e as SubscriptionStatusData, f as AppSettingsType, g as SchoolReturnType, h as SchoolType } from '../ad-kAjUceeE.mjs';
5
5
  import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-zczOntNk.mjs';
6
6
  import { E as EventType, c as EventListItemType, d as EventInfoType, U as UseGetResourcesByRegionOptions, e as RelationType, f as ResourceConnectionsType, g as UnregisteredVendorType, V as VendorType, h as VendorInfoType, i as UserLicenceType, P as PostType, j as EnumPostType, G as GameDocType, k as GameLeaderboard } from '../global-BUUfmCo7.mjs';
7
- import { A as AffiliateType } from '../affiliate-msmhMpNi.mjs';
7
+ import { A as AffiliateType } from '../affiliate-qEbJvGVD.mjs';
8
8
  import '../images/index.mjs';
9
9
  import 'react-hook-form';
10
10
 
@@ -4,7 +4,7 @@ import { EnumResourceType, EnumEventDateStatus } from '../enums/index.js';
4
4
  import { A as AuthPayloadType, R as RefreshTokenPayloadType, S as SafeUserType, a as RedeemRewardResponse, P as PartnerType, b as ResourceByUser, c as AdType, E as EnumAdStatus, d as SubscriptionPlansResponse, e as SubscriptionStatusData, f as AppSettingsType, g as SchoolReturnType, h as SchoolType } from '../ad-BmDOVKmE.js';
5
5
  import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-BL_12IAo.js';
6
6
  import { E as EventType, c as EventListItemType, d as EventInfoType, U as UseGetResourcesByRegionOptions, e as RelationType, f as ResourceConnectionsType, g as UnregisteredVendorType, V as VendorType, h as VendorInfoType, i as UserLicenceType, P as PostType, j as EnumPostType, G as GameDocType, k as GameLeaderboard } from '../global-fKbMmluy.js';
7
- import { A as AffiliateType } from '../affiliate-0oKa4qBB.js';
7
+ import { A as AffiliateType } from '../affiliate-B1RBuV0w.js';
8
8
  import '../images/index.js';
9
9
  import 'react-hook-form';
10
10
 
@@ -152,7 +152,7 @@ import {
152
152
  useUpdateVendor,
153
153
  useUpdateVendorInfo,
154
154
  useValidateVerificationToken
155
- } from "../chunk-JP76OR4F.mjs";
155
+ } from "../chunk-B6DDY5XL.mjs";
156
156
  import "../chunk-LETM2YHF.mjs";
157
157
  export {
158
158
  GET_EVENT,
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/hooks/index.ts
31
31
  var hooks_exports = {};
32
32
  __export(hooks_exports, {
33
+ defaultAffiliateFormValues: () => defaultAffiliateFormValues,
33
34
  defaultEventFormValues: () => defaultEventFormValues,
34
35
  defaultEventInfoFormValues: () => defaultEventInfoFormValues,
35
36
  defaultLocation: () => defaultLocation,
@@ -38,6 +39,7 @@ __export(hooks_exports, {
38
39
  defaultVendorFormValues: () => defaultVendorFormValues,
39
40
  defaultVendorInfoFormValues: () => defaultVendorInfoFormValues,
40
41
  globalDefaultValues: () => globalDefaultValues,
42
+ mapAffiliateToFormData: () => mapAffiliateToFormData,
41
43
  mapBaseResourceTypeToFormData: () => mapBaseResourceTypeToFormData,
42
44
  useAdForm: () => useAdForm,
43
45
  useAffiliateForm: () => useAffiliateForm,
@@ -5018,8 +5020,17 @@ var AFFILIATE_RESOURCE_FIELDS_FRAGMENT = import_client74.gql`
5018
5020
  }
5019
5021
  ${AFFILIATE_REWARD_FIELDS_FRAGMENT}
5020
5022
  `;
5023
+ var AFFILIATE_BANK_ACCOUNT_DETAILS_FIELDS_FRAGMENT = import_client74.gql`
5024
+ fragment AffiliateBankAccountDetailsFields on AffiliateBankAccountDetailsType {
5025
+ accountHolderName
5026
+ accountNumber
5027
+ }
5028
+ `;
5021
5029
  var AFFILIATE_DETAILS_FIELDS_FRAGMENT = import_client74.gql`
5022
5030
  fragment AffiliateDetailsFields on AffiliateDetailsType {
5031
+ bankAccountDetails {
5032
+ ...AffiliateBankAccountDetailsFields
5033
+ }
5023
5034
  contactDetails {
5024
5035
  mobilePhone
5025
5036
  }
@@ -5031,6 +5042,7 @@ var AFFILIATE_DETAILS_FIELDS_FRAGMENT = import_client74.gql`
5031
5042
  ...TermsAgreementFields
5032
5043
  }
5033
5044
  }
5045
+ ${AFFILIATE_BANK_ACCOUNT_DETAILS_FIELDS_FRAGMENT}
5034
5046
  ${SOCIAL_MEDIA_FIELDS_FRAGMENT}
5035
5047
  ${TERMS_AGREEMENT_FIELDS_FRAGMENT}
5036
5048
  `;
@@ -5385,6 +5397,34 @@ var defaultVendorInfoFormValues = {
5385
5397
  },
5386
5398
  vendorId: ""
5387
5399
  };
5400
+ var defaultAffiliateFormValues = {
5401
+ _id: "",
5402
+ bankAccountDetails: {
5403
+ accountHolderName: "",
5404
+ accountNumber: ""
5405
+ },
5406
+ contactDetails: {
5407
+ mobilePhone: ""
5408
+ },
5409
+ region: "",
5410
+ socialMedia: null,
5411
+ termsAgreement: null
5412
+ };
5413
+ function mapAffiliateToFormData(affiliate) {
5414
+ return {
5415
+ _id: affiliate._id,
5416
+ bankAccountDetails: affiliate.affiliateDetails?.bankAccountDetails ?? {
5417
+ accountHolderName: "",
5418
+ accountNumber: ""
5419
+ },
5420
+ contactDetails: affiliate.affiliateDetails?.contactDetails ?? {
5421
+ mobilePhone: ""
5422
+ },
5423
+ region: affiliate.affiliateDetails?.region ?? "",
5424
+ socialMedia: affiliate.affiliateDetails?.socialMedia ?? null,
5425
+ termsAgreement: affiliate.affiliateDetails?.termsAgreement ?? null
5426
+ };
5427
+ }
5388
5428
  function mapBaseResourceTypeToFormData(data) {
5389
5429
  return {
5390
5430
  _id: data._id,
@@ -6543,12 +6583,17 @@ var affiliateContactDetailsSchema = yup12.object({
6543
6583
  (value) => mobileRegex.test(value)
6544
6584
  )
6545
6585
  });
6586
+ var bankAccountDetailsSchema = yup12.object({
6587
+ accountHolderName: yup12.string().required("Account holder name is required"),
6588
+ accountNumber: yup12.string().required("Account number is required")
6589
+ });
6546
6590
  var affiliateSchema = yup12.object().shape({
6547
6591
  _id: yup12.string().required(),
6548
- contactDetails: affiliateContactDetailsSchema.nullable().default(null).test(
6549
- "contact-details-required",
6550
- "Mobile phone is required",
6551
- (value) => Boolean(value?.mobilePhone?.trim())
6592
+ bankAccountDetails: bankAccountDetailsSchema.required(
6593
+ "Bank account details are required"
6594
+ ),
6595
+ contactDetails: affiliateContactDetailsSchema.required(
6596
+ "Contact details are required"
6552
6597
  ),
6553
6598
  region: yup12.string().trim().required("Region is required"),
6554
6599
  socialMedia: yup12.array().of(socialMediaSchema).nullable().default(null)
@@ -6565,22 +6610,37 @@ function useAffiliateForm(data) {
6565
6610
  setValue,
6566
6611
  watch
6567
6612
  } = (0, import_react_hook_form18.useForm)({
6568
- defaultValues: data,
6613
+ defaultValues: defaultAffiliateFormValues,
6569
6614
  resolver: (0, import_yup18.yupResolver)(affiliateSchema)
6570
6615
  });
6571
6616
  (0, import_react6.useEffect)(() => {
6572
6617
  reset({
6573
6618
  _id: data._id,
6619
+ bankAccountDetails: data.bankAccountDetails,
6574
6620
  contactDetails: data.contactDetails,
6575
6621
  region: data.region,
6576
6622
  socialMedia: data.socialMedia,
6577
6623
  termsAgreement: data.termsAgreement
6578
6624
  });
6579
6625
  }, [data, reset]);
6580
- const { _id, contactDetails, region, socialMedia: socialMedia2, termsAgreement } = getValues();
6626
+ const {
6627
+ _id,
6628
+ bankAccountDetails,
6629
+ contactDetails,
6630
+ region,
6631
+ socialMedia: socialMedia2,
6632
+ termsAgreement
6633
+ } = getValues();
6581
6634
  return {
6582
6635
  control,
6583
- fields: { _id, contactDetails, region, socialMedia: socialMedia2, termsAgreement },
6636
+ fields: {
6637
+ _id,
6638
+ bankAccountDetails,
6639
+ contactDetails,
6640
+ region,
6641
+ socialMedia: socialMedia2,
6642
+ termsAgreement
6643
+ },
6584
6644
  formState,
6585
6645
  getValues,
6586
6646
  handleSubmit,
@@ -6591,6 +6651,7 @@ function useAffiliateForm(data) {
6591
6651
  }
6592
6652
  // Annotate the CommonJS export names for ESM import in node:
6593
6653
  0 && (module.exports = {
6654
+ defaultAffiliateFormValues,
6594
6655
  defaultEventFormValues,
6595
6656
  defaultEventInfoFormValues,
6596
6657
  defaultLocation,
@@ -6599,6 +6660,7 @@ function useAffiliateForm(data) {
6599
6660
  defaultVendorFormValues,
6600
6661
  defaultVendorInfoFormValues,
6601
6662
  globalDefaultValues,
6663
+ mapAffiliateToFormData,
6602
6664
  mapBaseResourceTypeToFormData,
6603
6665
  useAdForm,
6604
6666
  useAffiliateForm,