@timardex/cluemart-server-shared 1.1.21 → 1.1.23

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.
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, ReportChatUser, GoogleImportedMarket, PushTokenType, ResourceActivityType, UserActivityEvent, UserType, VendorProductList, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType, CouponType, CouponDataType, CouponReward, CouponParticipantUserType, ProductCoupon } from '@timardex/cluemart-shared';
2
+ import { AdType, ReportChatUser, GoogleImportedMarket, PushTokenType, ResourceActivityType, UserActivityEvent, UserType, VendorProductList, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType, CouponType, CouponDataType, CouponParticipantUserType, ProductCoupon } from '@timardex/cluemart-shared';
3
3
  import mongoose__default from 'mongoose';
4
4
  import { O as ObjectId } from '../Chat-Wn7yfc3v.mjs';
5
5
  export { C as ChatModel, N as NotificationModel, a as SchemaChatMessageReactionType, S as SchemaChatMessageReplyPreviewType, b as SchemaChatMessageSeenType, c as SchemaChatMessageType, e as SchemaChatType, f as SchemaCreateBulkNotificationInput, g as SchemaNotificationType, d as SchemaParticipantType } from '../Chat-Wn7yfc3v.mjs';
@@ -296,12 +296,14 @@ declare const SchoolModel: mongoose__default.Model<SchoolDocument, {}, {}, {}, m
296
296
  type SchemaCouponParticipantUserType = Omit<CouponParticipantUserType, "userId"> & {
297
297
  userId: ObjectId;
298
298
  };
299
- type SchemaCouponRewardType = Omit<CouponReward, "productId" | "vendorId"> & {
299
+ type SchemaCouponVendorProductType = {
300
+ couponId: ObjectId;
300
301
  productId: ObjectId;
302
+ vendorCouponId?: ObjectId;
301
303
  vendorId: ObjectId;
302
304
  };
303
- type SchemaCouponDataType = Omit<CouponDataType, "participantUsers" | "couponRewards"> & {
304
- couponRewards?: SchemaCouponRewardType[];
305
+ type SchemaCouponDataType = Omit<CouponDataType, "participantUsers" | "couponVendorProducts"> & {
306
+ couponVendorProducts?: SchemaCouponVendorProductType[];
305
307
  participantUsers: SchemaCouponParticipantUserType[] | null;
306
308
  };
307
309
  type SchemaProductCouponType = Omit<ProductCoupon, "couponDocumentId" | "couponId"> & {
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, ReportChatUser, GoogleImportedMarket, PushTokenType, ResourceActivityType, UserActivityEvent, UserType, VendorProductList, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType, CouponType, CouponDataType, CouponReward, CouponParticipantUserType, ProductCoupon } from '@timardex/cluemart-shared';
2
+ import { AdType, ReportChatUser, GoogleImportedMarket, PushTokenType, ResourceActivityType, UserActivityEvent, UserType, VendorProductList, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType, CouponType, CouponDataType, CouponParticipantUserType, ProductCoupon } from '@timardex/cluemart-shared';
3
3
  import mongoose__default from 'mongoose';
4
4
  import { O as ObjectId } from '../Chat-Wn7yfc3v.js';
5
5
  export { C as ChatModel, N as NotificationModel, a as SchemaChatMessageReactionType, S as SchemaChatMessageReplyPreviewType, b as SchemaChatMessageSeenType, c as SchemaChatMessageType, e as SchemaChatType, f as SchemaCreateBulkNotificationInput, g as SchemaNotificationType, d as SchemaParticipantType } from '../Chat-Wn7yfc3v.js';
@@ -296,12 +296,14 @@ declare const SchoolModel: mongoose__default.Model<SchoolDocument, {}, {}, {}, m
296
296
  type SchemaCouponParticipantUserType = Omit<CouponParticipantUserType, "userId"> & {
297
297
  userId: ObjectId;
298
298
  };
299
- type SchemaCouponRewardType = Omit<CouponReward, "productId" | "vendorId"> & {
299
+ type SchemaCouponVendorProductType = {
300
+ couponId: ObjectId;
300
301
  productId: ObjectId;
302
+ vendorCouponId?: ObjectId;
301
303
  vendorId: ObjectId;
302
304
  };
303
- type SchemaCouponDataType = Omit<CouponDataType, "participantUsers" | "couponRewards"> & {
304
- couponRewards?: SchemaCouponRewardType[];
305
+ type SchemaCouponDataType = Omit<CouponDataType, "participantUsers" | "couponVendorProducts"> & {
306
+ couponVendorProducts?: SchemaCouponVendorProductType[];
305
307
  participantUsers: SchemaCouponParticipantUserType[] | null;
306
308
  };
307
309
  type SchemaProductCouponType = Omit<ProductCoupon, "couponDocumentId" | "couponId"> & {
@@ -42,7 +42,7 @@ import {
42
42
  termsAgreementSchema,
43
43
  userLicenseSchema,
44
44
  vendorProductTypeSchema
45
- } from "../chunk-3JRVRK2N.mjs";
45
+ } from "../chunk-6LIZONJ6.mjs";
46
46
  export {
47
47
  APP_SETTINGS_ID,
48
48
  AdModel,
@@ -3682,6 +3682,7 @@ var EnumAffiliateRewardType = /* @__PURE__ */ ((EnumAffiliateRewardType22) => {
3682
3682
  var EnumCouponQualificationType = /* @__PURE__ */ ((EnumCouponQualificationType2) => {
3683
3683
  EnumCouponQualificationType2["PURCHASE"] = "PURCHASE";
3684
3684
  EnumCouponQualificationType2["MARKET_VISIT"] = "MARKET_VISIT";
3685
+ EnumCouponQualificationType2["MARKET_PASSPORT"] = "MARKET_PASSPORT";
3685
3686
  return EnumCouponQualificationType2;
3686
3687
  })(EnumCouponQualificationType || {});
3687
3688
  var statusOptions = [
@@ -7822,20 +7823,22 @@ var COUPON_OPTION_FIELDS_FRAGMENT = gql`
7822
7823
  visits
7823
7824
  }
7824
7825
  `;
7825
- var COUPON_REWARD_FIELDS_FRAGMENT = gql`
7826
- fragment CouponRewardFields on CouponRewardType {
7826
+ var COUPON_VENDOR_PRODUCT_FIELDS_FRAGMENT = gql`
7827
+ fragment CouponVendorProductFields on CouponVendorProductType {
7828
+ couponId
7827
7829
  vendorId
7828
7830
  productId
7829
- quantity
7830
- unit
7831
+ vendorCouponId
7831
7832
  }
7832
7833
  `;
7833
7834
  var COUPON_DATA_PRODUCTS_FIELDS_FRAGMENT = gql`
7834
7835
  fragment CouponDataProductsFields on CouponDataProductsType {
7835
7836
  active
7837
+ couponId
7836
7838
  productsList {
7837
7839
  ...VendorProductListFields
7838
7840
  }
7841
+ vendorId
7839
7842
  vendorLogo {
7840
7843
  ...ResourceImageFields
7841
7844
  }
@@ -7855,8 +7858,8 @@ var COUPON_DATA_FIELDS_FRAGMENT = gql`
7855
7858
  couponOption {
7856
7859
  ...CouponOptionFields
7857
7860
  }
7858
- couponRewards {
7859
- ...CouponRewardFields
7861
+ couponVendorProducts {
7862
+ ...CouponVendorProductFields
7860
7863
  }
7861
7864
  createdAt
7862
7865
  endDate
@@ -7874,7 +7877,7 @@ var COUPON_DATA_FIELDS_FRAGMENT = gql`
7874
7877
  ${COUPON_CODE_FIELDS_FRAGMENT}
7875
7878
  ${COUPON_OPTION_FIELDS_FRAGMENT}
7876
7879
  ${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
7877
- ${COUPON_REWARD_FIELDS_FRAGMENT}
7880
+ ${COUPON_VENDOR_PRODUCT_FIELDS_FRAGMENT}
7878
7881
  ${COUPON_DATA_PRODUCTS_FIELDS_FRAGMENT}
7879
7882
  `;
7880
7883
  var COUPON = gql`
@@ -7895,8 +7898,8 @@ var COUPON = gql`
7895
7898
  ${COUPON_DATA_FIELDS_FRAGMENT}
7896
7899
  `;
7897
7900
  var GET_COUPONS = gql`
7898
- query getCoupons {
7899
- coupons {
7901
+ query getCoupons($region: String, $category: String) {
7902
+ coupons(region: $region, category: $category) {
7900
7903
  active {
7901
7904
  listName
7902
7905
  data {
@@ -7958,8 +7961,16 @@ var UPDATE_COUPON_MUTATION = gql`
7958
7961
  ${COUPON}
7959
7962
  `;
7960
7963
  var DELETE_COUPON_MUTATION = gql`
7961
- mutation deleteCoupon($couponDocumentId: ID!, $couponId: ID!) {
7962
- deleteCoupon(couponDocumentId: $couponDocumentId, couponId: $couponId) {
7964
+ mutation deleteCoupon($input: ProductCouponInputType!) {
7965
+ deleteCoupon(input: $input) {
7966
+ data
7967
+ message
7968
+ }
7969
+ }
7970
+ `;
7971
+ var SCAN_COUPON_MUTATION = gql`
7972
+ mutation scanCoupon($input: ProductCouponInputType!) {
7973
+ scanCoupon(input: $input) {
7963
7974
  data
7964
7975
  message
7965
7976
  }
@@ -9137,14 +9148,20 @@ var couponOptionSchema = new MongooseSchema13(
9137
9148
  },
9138
9149
  { _id: false }
9139
9150
  );
9140
- var couponRewardSchema = new MongooseSchema13(
9151
+ var couponVendorProductSchema = new MongooseSchema13(
9141
9152
  {
9153
+ couponId: {
9154
+ required: true,
9155
+ type: import_mongoose13.default.Schema.Types.ObjectId
9156
+ },
9142
9157
  productId: {
9143
9158
  required: true,
9144
9159
  type: import_mongoose13.default.Schema.Types.ObjectId
9145
9160
  },
9146
- quantity: { required: true, type: Number },
9147
- unit: { required: true, type: String },
9161
+ vendorCouponId: {
9162
+ required: false,
9163
+ type: import_mongoose13.default.Schema.Types.ObjectId
9164
+ },
9148
9165
  vendorId: {
9149
9166
  ref: "Vendor",
9150
9167
  required: true,
@@ -9179,7 +9196,10 @@ var couponDataSchema = new MongooseSchema13(
9179
9196
  couponCode: { required: true, type: couponCodeSchema },
9180
9197
  couponDescription: { required: true, type: String },
9181
9198
  couponOption: { required: true, type: couponOptionSchema },
9182
- couponRewards: { required: false, type: [couponRewardSchema] },
9199
+ couponVendorProducts: {
9200
+ required: false,
9201
+ type: [couponVendorProductSchema]
9202
+ },
9183
9203
  endDate: { required: true, type: Date },
9184
9204
  participantUsers: {
9185
9205
  default: null,
@@ -9976,7 +9996,7 @@ var SHARE_RESOURCE_LABEL2 = {
9976
9996
  school: "School"
9977
9997
  };
9978
9998
 
9979
- // node_modules/@timardex/cluemart-shared/dist/chunk-Q3X2EHHF.mjs
9999
+ // node_modules/@timardex/cluemart-shared/dist/chunk-LA47T6CY.mjs
9980
10000
  var PROMO_CODE_PREFIX2 = "CM-";
9981
10001
  var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
9982
10002
  var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
@@ -10078,7 +10098,7 @@ var gameScreenIdentifierList2 = [
10078
10098
  }
10079
10099
  ];
10080
10100
 
10081
- // node_modules/@timardex/cluemart-shared/dist/chunk-UGWEWOUM.mjs
10101
+ // node_modules/@timardex/cluemart-shared/dist/chunk-Q2ZUHS2F.mjs
10082
10102
  var import_dayjs4 = __toESM(require("dayjs"), 1);
10083
10103
  var statusOptions2 = [
10084
10104
  ...Object.values(EnumInviteStatus2).map((status) => ({