@timardex/cluemart-server-shared 1.1.20 → 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-WDKTIULG.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 = [
@@ -7798,6 +7799,9 @@ var COUPON_CODE_FIELDS_FRAGMENT = gql`
7798
7799
  qrCode {
7799
7800
  ...ResourceImageFields
7800
7801
  }
7802
+ shareableQrCode {
7803
+ ...ResourceImageFields
7804
+ }
7801
7805
  }
7802
7806
  ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
7803
7807
  `;
@@ -7819,20 +7823,22 @@ var COUPON_OPTION_FIELDS_FRAGMENT = gql`
7819
7823
  visits
7820
7824
  }
7821
7825
  `;
7822
- var COUPON_REWARD_FIELDS_FRAGMENT = gql`
7823
- fragment CouponRewardFields on CouponRewardType {
7826
+ var COUPON_VENDOR_PRODUCT_FIELDS_FRAGMENT = gql`
7827
+ fragment CouponVendorProductFields on CouponVendorProductType {
7828
+ couponId
7824
7829
  vendorId
7825
7830
  productId
7826
- quantity
7827
- unit
7831
+ vendorCouponId
7828
7832
  }
7829
7833
  `;
7830
7834
  var COUPON_DATA_PRODUCTS_FIELDS_FRAGMENT = gql`
7831
7835
  fragment CouponDataProductsFields on CouponDataProductsType {
7832
7836
  active
7837
+ couponId
7833
7838
  productsList {
7834
7839
  ...VendorProductListFields
7835
7840
  }
7841
+ vendorId
7836
7842
  vendorLogo {
7837
7843
  ...ResourceImageFields
7838
7844
  }
@@ -7852,8 +7858,8 @@ var COUPON_DATA_FIELDS_FRAGMENT = gql`
7852
7858
  couponOption {
7853
7859
  ...CouponOptionFields
7854
7860
  }
7855
- couponRewards {
7856
- ...CouponRewardFields
7861
+ couponVendorProducts {
7862
+ ...CouponVendorProductFields
7857
7863
  }
7858
7864
  createdAt
7859
7865
  endDate
@@ -7871,7 +7877,7 @@ var COUPON_DATA_FIELDS_FRAGMENT = gql`
7871
7877
  ${COUPON_CODE_FIELDS_FRAGMENT}
7872
7878
  ${COUPON_OPTION_FIELDS_FRAGMENT}
7873
7879
  ${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
7874
- ${COUPON_REWARD_FIELDS_FRAGMENT}
7880
+ ${COUPON_VENDOR_PRODUCT_FIELDS_FRAGMENT}
7875
7881
  ${COUPON_DATA_PRODUCTS_FIELDS_FRAGMENT}
7876
7882
  `;
7877
7883
  var COUPON = gql`
@@ -7892,8 +7898,8 @@ var COUPON = gql`
7892
7898
  ${COUPON_DATA_FIELDS_FRAGMENT}
7893
7899
  `;
7894
7900
  var GET_COUPONS = gql`
7895
- query getCoupons {
7896
- coupons {
7901
+ query getCoupons($region: String, $category: String) {
7902
+ coupons(region: $region, category: $category) {
7897
7903
  active {
7898
7904
  listName
7899
7905
  data {
@@ -7924,14 +7930,6 @@ var GET_COUPON = gql`
7924
7930
  }
7925
7931
  ${COUPON}
7926
7932
  `;
7927
- var GET_RESOURCE_COUPONS = gql`
7928
- query getResourceCoupons($resourceId: ID!, $resourceType: ResourceTypeEnum!) {
7929
- resourceCoupons(resourceId: $resourceId, resourceType: $resourceType) {
7930
- ...CouponFields
7931
- }
7932
- }
7933
- ${COUPON}
7934
- `;
7935
7933
  var CREATE_COUPON_MUTATION = gql`
7936
7934
  mutation createCoupon($input: CouponInputType!) {
7937
7935
  createCoupon(input: $input) {
@@ -7963,8 +7961,16 @@ var UPDATE_COUPON_MUTATION = gql`
7963
7961
  ${COUPON}
7964
7962
  `;
7965
7963
  var DELETE_COUPON_MUTATION = gql`
7966
- mutation deleteCoupon($couponDocumentId: ID!, $couponId: ID!) {
7967
- 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) {
7968
7974
  data
7969
7975
  message
7970
7976
  }
@@ -9142,14 +9148,20 @@ var couponOptionSchema = new MongooseSchema13(
9142
9148
  },
9143
9149
  { _id: false }
9144
9150
  );
9145
- var couponRewardSchema = new MongooseSchema13(
9151
+ var couponVendorProductSchema = new MongooseSchema13(
9146
9152
  {
9153
+ couponId: {
9154
+ required: true,
9155
+ type: import_mongoose13.default.Schema.Types.ObjectId
9156
+ },
9147
9157
  productId: {
9148
9158
  required: true,
9149
9159
  type: import_mongoose13.default.Schema.Types.ObjectId
9150
9160
  },
9151
- quantity: { required: true, type: Number },
9152
- unit: { required: true, type: String },
9161
+ vendorCouponId: {
9162
+ required: false,
9163
+ type: import_mongoose13.default.Schema.Types.ObjectId
9164
+ },
9153
9165
  vendorId: {
9154
9166
  ref: "Vendor",
9155
9167
  required: true,
@@ -9161,7 +9173,8 @@ var couponRewardSchema = new MongooseSchema13(
9161
9173
  var couponCodeSchema = new MongooseSchema13(
9162
9174
  {
9163
9175
  code: { required: true, type: String },
9164
- qrCode: { required: true, type: ResourceImageTypeSchema }
9176
+ qrCode: { required: true, type: ResourceImageTypeSchema },
9177
+ shareableQrCode: { required: true, type: ResourceImageTypeSchema }
9165
9178
  },
9166
9179
  { _id: false }
9167
9180
  );
@@ -9183,7 +9196,10 @@ var couponDataSchema = new MongooseSchema13(
9183
9196
  couponCode: { required: true, type: couponCodeSchema },
9184
9197
  couponDescription: { required: true, type: String },
9185
9198
  couponOption: { required: true, type: couponOptionSchema },
9186
- couponRewards: { required: false, type: [couponRewardSchema] },
9199
+ couponVendorProducts: {
9200
+ required: false,
9201
+ type: [couponVendorProductSchema]
9202
+ },
9187
9203
  endDate: { required: true, type: Date },
9188
9204
  participantUsers: {
9189
9205
  default: null,
@@ -9980,7 +9996,7 @@ var SHARE_RESOURCE_LABEL2 = {
9980
9996
  school: "School"
9981
9997
  };
9982
9998
 
9983
- // node_modules/@timardex/cluemart-shared/dist/chunk-3HRC67D3.mjs
9999
+ // node_modules/@timardex/cluemart-shared/dist/chunk-LA47T6CY.mjs
9984
10000
  var PROMO_CODE_PREFIX2 = "CM-";
9985
10001
  var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
9986
10002
  var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
@@ -10082,7 +10098,7 @@ var gameScreenIdentifierList2 = [
10082
10098
  }
10083
10099
  ];
10084
10100
 
10085
- // node_modules/@timardex/cluemart-shared/dist/chunk-E7KKXQDI.mjs
10101
+ // node_modules/@timardex/cluemart-shared/dist/chunk-Q2ZUHS2F.mjs
10086
10102
  var import_dayjs4 = __toESM(require("dayjs"), 1);
10087
10103
  var statusOptions2 = [
10088
10104
  ...Object.values(EnumInviteStatus2).map((status) => ({