@timardex/cluemart-shared 1.5.801 → 1.5.803

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.
@@ -230,6 +230,10 @@ type AffiliateResourceType = {
230
230
  resourceType: EnumResourceType;
231
231
  rewards: AffiliateRewardType[];
232
232
  };
233
+ type RedeemHistoryType = {
234
+ redeemedAt: Date;
235
+ rewardValue: number;
236
+ };
233
237
  interface AffiliateType {
234
238
  _id: string;
235
239
  active: boolean;
@@ -239,12 +243,9 @@ interface AffiliateType {
239
243
  affiliateResources: AffiliateResourceType[];
240
244
  createdAt: Date;
241
245
  deletedAt: Date | null;
242
- lastRewardRedemptions: {
243
- redeemedAt: Date;
244
- rewardValue: number;
245
- }[];
246
246
  overallPoints: number;
247
247
  owner: OwnerType;
248
+ redeemHistory?: RedeemHistoryType[] | null;
248
249
  updatedAt: Date | null;
249
250
  }
250
251
  type AffiliateFormData = AffiliateDetailsType & Pick<AffiliateType, "_id">;
@@ -351,4 +352,4 @@ interface AdType extends AdFormData {
351
352
  updatedAt: Date | null;
352
353
  }
353
354
 
354
- export { type SchoolRegisteredUserType as $, type AuthPayloadType as A, type AffiliateBankAccountDetailsType as B, type CreateUserFormData as C, type AffiliateContactDetails as D, EnumAdStatus as E, type AffiliateDetailsType as F, type AffiliateResourceType as G, type AffiliateRewardType as H, type CreateAdFormData as I, EnumAdShowOn as J, EnumAdStyle as K, EnumAdType as L, EnumAffiliateRewardType as M, EnumVerificationType as N, type LoginFormData as O, type PartnerType as P, type MarketingMaterialRequestInputType as Q, type RefreshTokenPayloadType as R, type SafeUserType as S, type PosterInputType as T, type UserFormData as U, type RedeemRewardInput as V, type RedeemedReward as W, type RegisterFormData as X, type RequestPasswordResetFormData as Y, type ResetPasswordFormData as Z, type SchoolCampaignType as _, type RedeemRewardResponse as a, type StripeSubscription as a0, type SubscriptionPlanData as a1, type SubscriptionPricingData as a2, type UserActivity as a3, type UserActivityEvent as a4, type UserType as a5, type ValidateVerificationTokenFormData as a6, type ResourceByUser as b, type AdType as c, type SubscriptionPlansResponse as d, type SubscriptionStatusData as e, type AppSettingsType as f, type SchoolReturnType as g, type SchoolType as h, type AffiliateType as i, type CreateLoginFormData as j, type CreateRegisterFormData as k, type CreateRequestPasswordResetFormData as l, type CreateValidateVerificationTokenFormData as m, type CreateResetPasswordFormData as n, type AffiliateFormData as o, type PartnerFormData as p, type AdFormData as q, type CreateAdFormState as r, type CreatePartnerFormData as s, type AppSettingsFormData as t, type CreateAppSettingsFormData as u, type SchoolFormData as v, type CreateSchoolFormData as w, type CreateAffiliateFormData as x, type AdFormState as y, type AdResource as z };
355
+ export { type SchoolCampaignType as $, type AuthPayloadType as A, type AffiliateBankAccountDetailsType as B, type CreateUserFormData as C, type AffiliateContactDetails as D, EnumAdStatus as E, type AffiliateDetailsType as F, type AffiliateResourceType as G, type AffiliateRewardType as H, type CreateAdFormData as I, EnumAdShowOn as J, EnumAdStyle as K, EnumAdType as L, EnumAffiliateRewardType as M, EnumVerificationType as N, type LoginFormData as O, type PartnerType as P, type MarketingMaterialRequestInputType as Q, type RefreshTokenPayloadType as R, type SafeUserType as S, type PosterInputType as T, type UserFormData as U, type RedeemHistoryType as V, type RedeemRewardInput as W, type RedeemedReward as X, type RegisterFormData as Y, type RequestPasswordResetFormData as Z, type ResetPasswordFormData as _, type RedeemRewardResponse as a, type SchoolRegisteredUserType as a0, type StripeSubscription as a1, type SubscriptionPlanData as a2, type SubscriptionPricingData as a3, type UserActivity as a4, type UserActivityEvent as a5, type UserType as a6, type ValidateVerificationTokenFormData as a7, type ResourceByUser as b, type AdType as c, type SubscriptionPlansResponse as d, type SubscriptionStatusData as e, type AppSettingsType as f, type SchoolReturnType as g, type SchoolType as h, type AffiliateType as i, type CreateLoginFormData as j, type CreateRegisterFormData as k, type CreateRequestPasswordResetFormData as l, type CreateValidateVerificationTokenFormData as m, type CreateResetPasswordFormData as n, type AffiliateFormData as o, type PartnerFormData as p, type AdFormData as q, type CreateAdFormState as r, type CreatePartnerFormData as s, type AppSettingsFormData as t, type CreateAppSettingsFormData as u, type SchoolFormData as v, type CreateSchoolFormData as w, type CreateAffiliateFormData as x, type AdFormState as y, type AdResource as z };
@@ -230,6 +230,10 @@ type AffiliateResourceType = {
230
230
  resourceType: EnumResourceType;
231
231
  rewards: AffiliateRewardType[];
232
232
  };
233
+ type RedeemHistoryType = {
234
+ redeemedAt: Date;
235
+ rewardValue: number;
236
+ };
233
237
  interface AffiliateType {
234
238
  _id: string;
235
239
  active: boolean;
@@ -239,12 +243,9 @@ interface AffiliateType {
239
243
  affiliateResources: AffiliateResourceType[];
240
244
  createdAt: Date;
241
245
  deletedAt: Date | null;
242
- lastRewardRedemptions: {
243
- redeemedAt: Date;
244
- rewardValue: number;
245
- }[];
246
246
  overallPoints: number;
247
247
  owner: OwnerType;
248
+ redeemHistory?: RedeemHistoryType[] | null;
248
249
  updatedAt: Date | null;
249
250
  }
250
251
  type AffiliateFormData = AffiliateDetailsType & Pick<AffiliateType, "_id">;
@@ -351,4 +352,4 @@ interface AdType extends AdFormData {
351
352
  updatedAt: Date | null;
352
353
  }
353
354
 
354
- export { type SchoolRegisteredUserType as $, type AuthPayloadType as A, type AffiliateBankAccountDetailsType as B, type CreateUserFormData as C, type AffiliateContactDetails as D, EnumAdStatus as E, type AffiliateDetailsType as F, type AffiliateResourceType as G, type AffiliateRewardType as H, type CreateAdFormData as I, EnumAdShowOn as J, EnumAdStyle as K, EnumAdType as L, EnumAffiliateRewardType as M, EnumVerificationType as N, type LoginFormData as O, type PartnerType as P, type MarketingMaterialRequestInputType as Q, type RefreshTokenPayloadType as R, type SafeUserType as S, type PosterInputType as T, type UserFormData as U, type RedeemRewardInput as V, type RedeemedReward as W, type RegisterFormData as X, type RequestPasswordResetFormData as Y, type ResetPasswordFormData as Z, type SchoolCampaignType as _, type RedeemRewardResponse as a, type StripeSubscription as a0, type SubscriptionPlanData as a1, type SubscriptionPricingData as a2, type UserActivity as a3, type UserActivityEvent as a4, type UserType as a5, type ValidateVerificationTokenFormData as a6, type ResourceByUser as b, type AdType as c, type SubscriptionPlansResponse as d, type SubscriptionStatusData as e, type AppSettingsType as f, type SchoolReturnType as g, type SchoolType as h, type AffiliateType as i, type CreateLoginFormData as j, type CreateRegisterFormData as k, type CreateRequestPasswordResetFormData as l, type CreateValidateVerificationTokenFormData as m, type CreateResetPasswordFormData as n, type AffiliateFormData as o, type PartnerFormData as p, type AdFormData as q, type CreateAdFormState as r, type CreatePartnerFormData as s, type AppSettingsFormData as t, type CreateAppSettingsFormData as u, type SchoolFormData as v, type CreateSchoolFormData as w, type CreateAffiliateFormData as x, type AdFormState as y, type AdResource as z };
355
+ export { type SchoolCampaignType as $, type AuthPayloadType as A, type AffiliateBankAccountDetailsType as B, type CreateUserFormData as C, type AffiliateContactDetails as D, EnumAdStatus as E, type AffiliateDetailsType as F, type AffiliateResourceType as G, type AffiliateRewardType as H, type CreateAdFormData as I, EnumAdShowOn as J, EnumAdStyle as K, EnumAdType as L, EnumAffiliateRewardType as M, EnumVerificationType as N, type LoginFormData as O, type PartnerType as P, type MarketingMaterialRequestInputType as Q, type RefreshTokenPayloadType as R, type SafeUserType as S, type PosterInputType as T, type UserFormData as U, type RedeemHistoryType as V, type RedeemRewardInput as W, type RedeemedReward as X, type RegisterFormData as Y, type RequestPasswordResetFormData as Z, type ResetPasswordFormData as _, type RedeemRewardResponse as a, type SchoolRegisteredUserType as a0, type StripeSubscription as a1, type SubscriptionPlanData as a2, type SubscriptionPricingData as a3, type UserActivity as a4, type UserActivityEvent as a5, type UserType as a6, type ValidateVerificationTokenFormData as a7, type ResourceByUser as b, type AdType as c, type SubscriptionPlansResponse as d, type SubscriptionStatusData as e, type AppSettingsType as f, type SchoolReturnType as g, type SchoolType as h, type AffiliateType as i, type CreateLoginFormData as j, type CreateRegisterFormData as k, type CreateRequestPasswordResetFormData as l, type CreateValidateVerificationTokenFormData as m, type CreateResetPasswordFormData as n, type AffiliateFormData as o, type PartnerFormData as p, type AdFormData as q, type CreateAdFormState as r, type CreatePartnerFormData as s, type AppSettingsFormData as t, type CreateAppSettingsFormData as u, type SchoolFormData as v, type CreateSchoolFormData as w, type CreateAffiliateFormData as x, type AdFormState as y, type AdResource as z };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  PROMO_CODE_PREFIX,
3
3
  gameScreenIdentifierList
4
- } from "./chunk-2PFUE6DY.mjs";
4
+ } from "./chunk-YVIZ4AWF.mjs";
5
5
  import {
6
6
  dateFormat,
7
7
  formatDate,
@@ -1554,4 +1554,4 @@ export {
1554
1554
  getVendorEventRelationDateOptions,
1555
1555
  getVendorEventsEmptyMessage
1556
1556
  };
1557
- //# sourceMappingURL=chunk-AM4MMUVW.mjs.map
1557
+ //# sourceMappingURL=chunk-6633VMDB.mjs.map
@@ -5136,7 +5136,7 @@ var AFFILIATE_FIELDS_FRAGMENT = gql40`
5136
5136
  }
5137
5137
  createdAt
5138
5138
  deletedAt
5139
- lastRewardRedemptions {
5139
+ redeemHistory {
5140
5140
  redeemedAt
5141
5141
  rewardValue
5142
5142
  }
@@ -5216,6 +5216,14 @@ var DELETE_AFFILIATE_MUTATION = gql41`
5216
5216
  deleteAffiliate(_id: $_id)
5217
5217
  }
5218
5218
  `;
5219
+ var REDEEM_AFFILIATE_REWARD_MUTATION = gql41`
5220
+ mutation redeemAffiliateReward($affiliateId: ID!) {
5221
+ redeemAffiliateReward(affiliateId: $affiliateId) {
5222
+ ...AffiliateFields
5223
+ }
5224
+ }
5225
+ ${AFFILIATE_FIELDS_FRAGMENT}
5226
+ `;
5219
5227
 
5220
5228
  // src/graphql/hooks/affiliate/hooksMutation.ts
5221
5229
  var useUpdateAffiliateDetails = () => {
@@ -5242,6 +5250,20 @@ var useDeleteAffiliate = () => {
5242
5250
  );
5243
5251
  return { deleteAffiliate, error, loading };
5244
5252
  };
5253
+ var useRedeemAffiliateReward = () => {
5254
+ const [redeemAffiliateReward, { loading, error }] = useMutation20(
5255
+ REDEEM_AFFILIATE_REWARD_MUTATION,
5256
+ {
5257
+ awaitRefetchQueries: true,
5258
+ refetchQueries: (mutationResult) => {
5259
+ const affiliateId = mutationResult?.data?.redeemAffiliateReward?._id;
5260
+ if (!affiliateId) return [];
5261
+ return [{ query: GET_AFFILIATE, variables: { _id: affiliateId } }];
5262
+ }
5263
+ }
5264
+ );
5265
+ return { error, loading, redeemAffiliateReward };
5266
+ };
5245
5267
 
5246
5268
  export {
5247
5269
  GET_EVENT,
@@ -5396,6 +5418,7 @@ export {
5396
5418
  useGetAffiliate,
5397
5419
  useGetAffiliates,
5398
5420
  useUpdateAffiliateDetails,
5399
- useDeleteAffiliate
5421
+ useDeleteAffiliate,
5422
+ useRedeemAffiliateReward
5400
5423
  };
5401
- //# sourceMappingURL=chunk-EAL3VN4V.mjs.map
5424
+ //# sourceMappingURL=chunk-G76ILLVZ.mjs.map