@lyxa.ai/core 1.4.306-alpha-4 → 1.4.306-alpha-5

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 (98) hide show
  1. package/dist/libraries/map/providers/osrm.js +3 -3
  2. package/dist/libraries/map/providers/osrm.js.map +1 -1
  3. package/dist/libraries/mongo/models/banner.model.js.map +1 -1
  4. package/dist/libraries/mongo/models/category.model.d.ts +2 -2
  5. package/dist/libraries/mongo/models/category.model.js +1 -1
  6. package/dist/libraries/mongo/models/category.model.js.map +1 -1
  7. package/dist/libraries/mongo/models/deal-setting.model.d.ts +1 -2
  8. package/dist/libraries/mongo/models/deal-setting.model.js +1 -2
  9. package/dist/libraries/mongo/models/deal-setting.model.js.map +1 -1
  10. package/dist/libraries/mongo/models/featured-setting.model.js.map +1 -1
  11. package/dist/libraries/mongo/models/filter-container.model.js.map +1 -1
  12. package/dist/libraries/mongo/models/index.d.ts +3 -0
  13. package/dist/libraries/mongo/models/index.js +6 -3
  14. package/dist/libraries/mongo/models/index.js.map +1 -1
  15. package/dist/libraries/mongo/models/line-item.model.d.ts +2 -2
  16. package/dist/libraries/mongo/models/line-item.model.js +1 -1
  17. package/dist/libraries/mongo/models/line-item.model.js.map +1 -1
  18. package/dist/libraries/mongo/models/list-container.model.d.ts +2 -2
  19. package/dist/libraries/mongo/models/list-container.model.js +1 -1
  20. package/dist/libraries/mongo/models/list-container.model.js.map +1 -1
  21. package/dist/libraries/mongo/models/order.model.js.map +1 -1
  22. package/dist/libraries/mongo/models/parent.model.d.ts +2 -2
  23. package/dist/libraries/mongo/models/parent.model.js +1 -1
  24. package/dist/libraries/mongo/models/parent.model.js.map +1 -1
  25. package/dist/libraries/mongo/models/product.model.d.ts +2 -2
  26. package/dist/libraries/mongo/models/product.model.js +1 -1
  27. package/dist/libraries/mongo/models/product.model.js.map +1 -1
  28. package/dist/libraries/mongo/models/providers/custom-coupon.model.js.map +1 -1
  29. package/dist/libraries/mongo/models/providers/individual-store-coupon.model.js.map +1 -1
  30. package/dist/libraries/mongo/models/providers/individual-user-coupon.model.js.map +1 -1
  31. package/dist/libraries/mongo/models/providers/new-user-discount-marketing.model.d.ts +19 -0
  32. package/dist/libraries/mongo/models/providers/new-user-discount-marketing.model.js +73 -0
  33. package/dist/libraries/mongo/models/providers/new-user-discount-marketing.model.js.map +1 -0
  34. package/dist/libraries/mongo/models/providers/shops-categories-coupon.model.js.map +1 -1
  35. package/dist/libraries/mongo/models/shop.model.d.ts +2 -2
  36. package/dist/libraries/mongo/models/shop.model.js +1 -1
  37. package/dist/libraries/mongo/models/shop.model.js.map +1 -1
  38. package/dist/libraries/mongo/models/tag.model.d.ts +2 -2
  39. package/dist/libraries/mongo/models/tag.model.js +1 -1
  40. package/dist/libraries/mongo/models/tag.model.js.map +1 -1
  41. package/dist/libraries/mongo/models/user.model.d.ts +1 -0
  42. package/dist/libraries/mongo/models/user.model.js +5 -0
  43. package/dist/libraries/mongo/models/user.model.js.map +1 -1
  44. package/dist/types/README.md +1 -1
  45. package/dist/types/libraries/map/providers/osrm.js +3 -3
  46. package/dist/types/libraries/map/providers/osrm.js.map +1 -1
  47. package/dist/types/libraries/mongo/models/banner.model.js.map +1 -1
  48. package/dist/types/libraries/mongo/models/category.model.d.ts +2 -2
  49. package/dist/types/libraries/mongo/models/category.model.js +1 -1
  50. package/dist/types/libraries/mongo/models/category.model.js.map +1 -1
  51. package/dist/types/libraries/mongo/models/deal-setting.model.d.ts +1 -2
  52. package/dist/types/libraries/mongo/models/deal-setting.model.js +1 -2
  53. package/dist/types/libraries/mongo/models/deal-setting.model.js.map +1 -1
  54. package/dist/types/libraries/mongo/models/featured-setting.model.js.map +1 -1
  55. package/dist/types/libraries/mongo/models/filter-container.model.js.map +1 -1
  56. package/dist/types/libraries/mongo/models/index.d.ts +3 -0
  57. package/dist/types/libraries/mongo/models/index.js +6 -3
  58. package/dist/types/libraries/mongo/models/index.js.map +1 -1
  59. package/dist/types/libraries/mongo/models/line-item.model.d.ts +2 -2
  60. package/dist/types/libraries/mongo/models/line-item.model.js +1 -1
  61. package/dist/types/libraries/mongo/models/line-item.model.js.map +1 -1
  62. package/dist/types/libraries/mongo/models/list-container.model.d.ts +2 -2
  63. package/dist/types/libraries/mongo/models/list-container.model.js +1 -1
  64. package/dist/types/libraries/mongo/models/list-container.model.js.map +1 -1
  65. package/dist/types/libraries/mongo/models/order.model.js.map +1 -1
  66. package/dist/types/libraries/mongo/models/parent.model.d.ts +2 -2
  67. package/dist/types/libraries/mongo/models/parent.model.js +1 -1
  68. package/dist/types/libraries/mongo/models/parent.model.js.map +1 -1
  69. package/dist/types/libraries/mongo/models/product.model.d.ts +2 -2
  70. package/dist/types/libraries/mongo/models/product.model.js +1 -1
  71. package/dist/types/libraries/mongo/models/product.model.js.map +1 -1
  72. package/dist/types/libraries/mongo/models/providers/custom-coupon.model.js.map +1 -1
  73. package/dist/types/libraries/mongo/models/providers/individual-store-coupon.model.js.map +1 -1
  74. package/dist/types/libraries/mongo/models/providers/individual-user-coupon.model.js.map +1 -1
  75. package/dist/types/libraries/mongo/models/providers/new-user-discount-marketing.model.d.ts +19 -0
  76. package/dist/types/libraries/mongo/models/providers/new-user-discount-marketing.model.js +73 -0
  77. package/dist/types/libraries/mongo/models/providers/new-user-discount-marketing.model.js.map +1 -0
  78. package/dist/types/libraries/mongo/models/providers/shops-categories-coupon.model.js.map +1 -1
  79. package/dist/types/libraries/mongo/models/shop.model.d.ts +2 -2
  80. package/dist/types/libraries/mongo/models/shop.model.js +1 -1
  81. package/dist/types/libraries/mongo/models/shop.model.js.map +1 -1
  82. package/dist/types/libraries/mongo/models/tag.model.d.ts +2 -2
  83. package/dist/types/libraries/mongo/models/tag.model.js +1 -1
  84. package/dist/types/libraries/mongo/models/tag.model.js.map +1 -1
  85. package/dist/types/libraries/mongo/models/user.model.d.ts +1 -0
  86. package/dist/types/libraries/mongo/models/user.model.js +5 -0
  87. package/dist/types/libraries/mongo/models/user.model.js.map +1 -1
  88. package/dist/types/package.json +1 -1
  89. package/dist/types/utilities/enum.d.ts +2 -1
  90. package/dist/types/utilities/enum.js +1 -0
  91. package/dist/types/utilities/enum.js.map +1 -1
  92. package/dist/utilities/enum.d.ts +2 -1
  93. package/dist/utilities/enum.js +1 -0
  94. package/dist/utilities/enum.js.map +1 -1
  95. package/dist/utilities/new-user-eligibility.d.ts +5 -0
  96. package/dist/utilities/new-user-eligibility.js +41 -0
  97. package/dist/utilities/new-user-eligibility.js.map +1 -0
  98. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
- import { ItemType, Status } from '../../../utilities/enum';
1
+ import { Status } from '../../../utilities/enum';
2
2
  import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
3
3
  export declare class Tag extends TimeStamps {
4
4
  name: string;
5
- itemType: ItemType;
5
+ itemType: string;
6
6
  image?: string;
7
7
  status?: Status;
8
8
  isVisible?: boolean;
@@ -29,7 +29,7 @@ __decorate([
29
29
  __metadata("design:type", String)
30
30
  ], Tag.prototype, "name", void 0);
31
31
  __decorate([
32
- (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ItemType }),
32
+ (0, typegoose_1.prop)({ required: true, type: String }),
33
33
  __metadata("design:type", String)
34
34
  ], Tag.prototype, "itemType", void 0);
35
35
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"tag.model.js","sourceRoot":"/","sources":["libraries/mongo/models/tag.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,kDAA2D;AAC3D,wBAA6B;AAE7B,0EAG0C;AAC1C,4EAAqE;AAe9D,IAAM,GAAG,GAAT,MAAM,GAAI,SAAQ,2BAAU;IAE3B,IAAI,CAAU;IAGd,QAAQ,CAAY;IAGpB,KAAK,CAAU;IAGf,MAAM,CAAU;IAGhB,SAAS,CAAW;IAGpB,YAAY,CAAU;CAC7B,CAAA;AAlBY,kBAAG;AAER;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI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,IAAI;QACxE,MAAM,yDAAmC,CAAC,IAAI,CAAC,IAAI,EAAE,WAAQ,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;QAE7E,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,GAAG,CAkBf","sourcesContent":["import { Index, modelOptions, pre, prop } from '@typegoose/typegoose';\nimport { ItemType, Status } from '../../../utilities/enum';\nimport { TagModel } from '.';\nimport { Query } from 'mongoose';\nimport {\n\thandlePreSaveForSortingWithStatus,\n\thandlePreUpdateForSortingWithStatus,\n} from '../utilities/sorting-order.hooks';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\n\n@modelOptions({ schemaOptions: { collection: 'tags' } })\n@Index({ name: 1, itemType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@Index({ itemType: 1, deletedAt: 1 })\n@pre<Tag>('save', async function (next) {\n\tawait handlePreSaveForSortingWithStatus.call(this, TagModel, { itemType: this.itemType });\n\n\tnext();\n})\n@pre<Tag>('findOneAndUpdate', async function (this: Query<any, Tag>, next) {\n\tawait handlePreUpdateForSortingWithStatus.call(this, TagModel, ['itemType']);\n\n\tnext();\n})\nexport class Tag extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 30 })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isVisible?: boolean;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n}\n"]}
1
+ {"version":3,"file":"tag.model.js","sourceRoot":"/","sources":["libraries/mongo/models/tag.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,kDAAiD;AACjD,wBAA6B;AAE7B,0EAG0C;AAC1C,4EAAqE;AAe9D,IAAM,GAAG,GAAT,MAAM,GAAI,SA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CAAC,IAAI,EAAE,WAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAE1F,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,eAAG,EAAM,kBAAkB,EAAE,KAAK,WAAkC,IAAI;QACxE,MAAM,yDAAmC,CAAC,IAAI,CAAC,IAAI,EAAE,WAAQ,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;QAE7E,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,GAAG,CAkBf","sourcesContent":["import { Index, modelOptions, pre, prop } from '@typegoose/typegoose';\nimport { Status } from '../../../utilities/enum';\nimport { TagModel } from '.';\nimport { Query } from 'mongoose';\nimport {\n\thandlePreSaveForSortingWithStatus,\n\thandlePreUpdateForSortingWithStatus,\n} from '../utilities/sorting-order.hooks';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\n\n@modelOptions({ schemaOptions: { collection: 'tags' } })\n@Index({ name: 1, itemType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@Index({ itemType: 1, deletedAt: 1 })\n@pre<Tag>('save', async function (next) {\n\tawait handlePreSaveForSortingWithStatus.call(this, TagModel, { itemType: this.itemType });\n\n\tnext();\n})\n@pre<Tag>('findOneAndUpdate', async function (this: Query<any, Tag>, next) {\n\tawait handlePreUpdateForSortingWithStatus.call(this, TagModel, ['itemType']);\n\n\tnext();\n})\nexport class Tag extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 30 })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic itemType!: string;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isVisible?: boolean;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n}\n"]}
@@ -29,6 +29,7 @@ export declare class User extends TimeStamps {
29
29
  isPhoneVerified?: boolean;
30
30
  onlineStatus?: OnlineStatus;
31
31
  receiveTicketAgentNotification?: boolean;
32
+ receiveOrderAgentNotification?: boolean;
32
33
  fcmTokens?: string[];
33
34
  wallet?: Wallet;
34
35
  static updateWallet(this: ReturnModelType<typeof User>, userId: string, main?: number, reserve?: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject, {}> & Omit<User & {
@@ -42,6 +42,7 @@ let User = User_1 = class User extends defaultClasses_1.TimeStamps {
42
42
  isPhoneVerified;
43
43
  onlineStatus;
44
44
  receiveTicketAgentNotification;
45
+ receiveOrderAgentNotification;
45
46
  fcmTokens;
46
47
  wallet;
47
48
  static async updateWallet(userId, main = 0, reserve = 0) {
@@ -133,6 +134,10 @@ __decorate([
133
134
  (0, typegoose_1.prop)({ type: Boolean, default: false }),
134
135
  __metadata("design:type", Boolean)
135
136
  ], User.prototype, "receiveTicketAgentNotification", void 0);
137
+ __decorate([
138
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
139
+ __metadata("design:type", Boolean)
140
+ ], User.prototype, "receiveOrderAgentNotification", void 0);
136
141
  __decorate([
137
142
  (0, typegoose_1.prop)({ type: () => [String], default: [] }),
138
143
  __metadata("design:type", Array)
@@ -1 +1 @@
1
- {"version":3,"file":"user.model.js","sourceRoot":"/","sources":["libraries/mongo/models/user.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,oDAAuF;AACvF,4EAAqE;AACrE,uDAA6C;AAC7C,0DAAqD;AACrD,iDAAwC;AACxC,6DAAoD;AACpD,kDAAuD;AACvD,kEAAwD;AACxD,oEAA0D;AAC1D,0DAAiD;AAS1C,IAAM,IAAI,YAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,QAAQ,CAAiB;IAGzB,QAAQ,CAAU;IAGlB,SAAS,CAAiB;IAG1B,QAAQ,CAAe;IAGvB,cAAc,CAAU;IAGxB,eAAe,CAAQ;IA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O,EAAE,mBAAY,CAAC,OAAO;KAC7B,CAAC;;0CACiC;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;4DACQ;AAGzC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;uCAChB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,qBAAM,EAAE,CAAC;8BACP,qBAAM;oCAAC;eArEX,IAAI;IAPhB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC;IACxD,IAAA,iBAAK,EAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IAC/B,IAAA,iBAAK,EAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IACrC,IAAA,iBAAK,EACL,EAAE,WAAW,EAAE,CAAC,EAAE,EAClB,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,CACzG;GACY,IAAI,CAmFhB","sourcesContent":["import { index, modelOptions, prop, Ref, ReturnModelType } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CoreUser } from './core-user.model';\nimport { UserAddress } from './shared/address.model';\nimport { Coupon } from './coupon.model';\nimport { Subscription } from './subscription.model';\nimport { OnlineStatus } from '../../../utilities/enum';\nimport { OTPFields } from './embedded/otp-fields.model';\nimport { GeoLocation } from './shared/geo-location.model';\nimport { Wallet } from './embedded/wallet.model';\n\n@modelOptions({ schemaOptions: { collection: 'users' } })\n@index({ location: '2dsphere' })\n@index({ createdAt: 1, addresses: 1 })\n@index(\n\t{ phoneNumber: 1 },\n\t{ unique: true, partialFilterExpression: { deletedAt: null, phoneNumber: { $exists: true, $ne: null } } }\n)\nexport class User extends TimeStamps {\n\t@prop({ required: true, ref: () => CoreUser })\n\tpublic coreUser!: Ref<CoreUser>;\n\n\t@prop({ type: () => String })\n\tpublic deviceId?: string;\n\n\t@prop({ type: () => [UserAddress], default: [] })\n\tpublic addresses?: UserAddress[];\n\n\t@prop({ type: GeoLocation }) // Last order location for finding user zone\n\tpublic location?: GeoLocation;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic orderCompleted?: number;\n\n\t@prop({ type: Date })\n\tpublic repeatedOrderAt?: Date;\n\n\t@prop({ ref: () => Coupon })\n\tpublic coupons?: Ref<Coupon>[];\n\n\t@prop({ type: String })\n\tpublic newUserCouponDiscountType?: string;\n\n\t@prop({ type: Number })\n\tpublic newUserCouponValue?: number;\n\n\t@prop({ type: Number })\n\tpublic newUserCouponMaximumDiscountLimit?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isNewUserCouponShowed?: boolean;\n\n\t@prop({ ref: () => Coupon })\n\tpublic referralCode?: Ref<Coupon>;\n\n\t@prop({ type: String, ref: () => Subscription })\n\tpublic subscription?: Ref<Subscription>;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isSubscribed?: boolean;\n\n\t@prop({ type: String })\n\tpublic phoneNumber?: string;\n\n\t@prop({ type: String })\n\tpublic pendingPhoneNumber?: string;\n\n\t@prop({ type: () => OTPFields })\n\tpublic phoneOtpInfo?: OTPFields;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isPhoneVerified?: boolean;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: OnlineStatus,\n\t\tdefault: OnlineStatus.OFFLINE,\n\t})\n\tpublic onlineStatus?: OnlineStatus;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic receiveTicketAgentNotification?: boolean;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic fcmTokens?: string[];\n\n\t@prop({ type: Wallet })\n\tpublic wallet?: Wallet;\n\n\tpublic static async updateWallet(\n\t\tthis: ReturnModelType<typeof User>,\n\t\tuserId: string,\n\t\tmain = 0,\n\t\treserve = 0\n\t) {\n\t\treturn this.findByIdAndUpdate(\n\t\t\tuserId,\n\t\t\t{ $inc: { 'wallet.main': main, 'wallet.reserve': reserve, 'wallet.total': main + reserve } },\n\t\t\t{ new: true }\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"user.model.js","sourceRoot":"/","sources":["libraries/mongo/models/user.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,oDAAuF;AACvF,4EAAqE;AACrE,uDAA6C;AAC7C,0DAAqD;AACrD,iDAAwC;AACxC,6DAAoD;AACpD,kDAAuD;AACvD,kEAAwD;AACxD,oEAA0D;AAC1D,0DAAiD;AAS1C,IAAM,IAAI,YAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,QAAQ,CAAiB;IAGzB,QAAQ,CAAU;IAGlB,SAAS,CAAiB;IAG1B,QAAQ,CAAe;IAGvB,cAAc,CAAU;IAGxB,eAAe,CAAQ;IAGvB,OAAO,CAAiB;IAGxB,yBAAyB,CAAU;IAGnC,kBAAkB,CAAU;IAG5B,iCAAiC,CAAU;IAG3C,qBAAqB,CAAW;IAGhC,YAAY,CAAe;IAG3B,YAAY,CAAqB;IAGjC,YAAY,CAAW;IAGvB,WAAW,CAAU;IAGrB,kBAAkB,CAAU;IAG5B,YAAY,CAAa;IAGzB,eAAe,CAAW;IAO1B,YAAY,CAAgB;IAG5B,8BAA8B,CAAW;IAGzC,6BAA6B,CAAW;IAGxC,SAAS,CAAY;IAGrB,MAAM,CAAU;IAEhB,MAAM,CAAC,KAAK,CAAC,YAAY,CAE/B,MAAc,EACd,IAAI,GAAG,CAAC,EACR,OAAO,GAAG,CAAC;QAEX,OAAO,IAAI,CAAC,iBAAiB,CAC5B,MAAM,EACN,EAAE,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EA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Aa,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC;IACxD,IAAA,iBAAK,EAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;IAC/B,IAAA,iBAAK,EAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IACrC,IAAA,iBAAK,EACL,EAAE,WAAW,EAAE,CAAC,EAAE,EAClB,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,CACzG;GACY,IAAI,CAsFhB","sourcesContent":["import { index, modelOptions, prop, Ref, ReturnModelType } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CoreUser } from './core-user.model';\nimport { UserAddress } from './shared/address.model';\nimport { Coupon } from './coupon.model';\nimport { Subscription } from './subscription.model';\nimport { OnlineStatus } from '../../../utilities/enum';\nimport { OTPFields } from './embedded/otp-fields.model';\nimport { GeoLocation } from './shared/geo-location.model';\nimport { Wallet } from './embedded/wallet.model';\n\n@modelOptions({ schemaOptions: { collection: 'users' } })\n@index({ location: '2dsphere' })\n@index({ createdAt: 1, addresses: 1 })\n@index(\n\t{ phoneNumber: 1 },\n\t{ unique: true, partialFilterExpression: { deletedAt: null, phoneNumber: { $exists: true, $ne: null } } }\n)\nexport class User extends TimeStamps {\n\t@prop({ required: true, ref: () => CoreUser })\n\tpublic coreUser!: Ref<CoreUser>;\n\n\t@prop({ type: () => String })\n\tpublic deviceId?: string;\n\n\t@prop({ type: () => [UserAddress], default: [] })\n\tpublic addresses?: UserAddress[];\n\n\t@prop({ type: GeoLocation }) // Last order location for finding user zone\n\tpublic location?: GeoLocation;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic orderCompleted?: number;\n\n\t@prop({ type: Date })\n\tpublic repeatedOrderAt?: Date;\n\n\t@prop({ ref: () => Coupon })\n\tpublic coupons?: Ref<Coupon>[];\n\n\t@prop({ type: String })\n\tpublic newUserCouponDiscountType?: string;\n\n\t@prop({ type: Number })\n\tpublic newUserCouponValue?: number;\n\n\t@prop({ type: Number })\n\tpublic newUserCouponMaximumDiscountLimit?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isNewUserCouponShowed?: boolean;\n\n\t@prop({ ref: () => Coupon })\n\tpublic referralCode?: Ref<Coupon>;\n\n\t@prop({ type: String, ref: () => Subscription })\n\tpublic subscription?: Ref<Subscription>;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isSubscribed?: boolean;\n\n\t@prop({ type: String })\n\tpublic phoneNumber?: string;\n\n\t@prop({ type: String })\n\tpublic pendingPhoneNumber?: string;\n\n\t@prop({ type: () => OTPFields })\n\tpublic phoneOtpInfo?: OTPFields;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isPhoneVerified?: boolean;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: OnlineStatus,\n\t\tdefault: OnlineStatus.OFFLINE,\n\t})\n\tpublic onlineStatus?: OnlineStatus;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic receiveTicketAgentNotification?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic receiveOrderAgentNotification?: boolean;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic fcmTokens?: string[];\n\n\t@prop({ type: Wallet })\n\tpublic wallet?: Wallet;\n\n\tpublic static async updateWallet(\n\t\tthis: ReturnModelType<typeof User>,\n\t\tuserId: string,\n\t\tmain = 0,\n\t\treserve = 0\n\t) {\n\t\treturn this.findByIdAndUpdate(\n\t\t\tuserId,\n\t\t\t{ $inc: { 'wallet.main': main, 'wallet.reserve': reserve, 'wallet.total': main + reserve } },\n\t\t\t{ new: true }\n\t\t);\n\t}\n}\n"]}
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.4.306-alpha-4
25
+ Version: 1.4.306-alpha-5
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -23,7 +23,7 @@ class OsrmMapService {
23
23
  const resp = await fetch(url);
24
24
  if (!resp.ok)
25
25
  throw new Error(`OSRM request failed with status ${resp.status}`);
26
- const data = (await resp.json());
26
+ const data = await resp.json();
27
27
  if (data.code !== 'Ok' || !data.routes || !data.routes.length) {
28
28
  throw new Error('OSRM route request failed');
29
29
  }
@@ -42,7 +42,7 @@ class OsrmMapService {
42
42
  const resp = await fetch(url);
43
43
  if (!resp.ok)
44
44
  throw new Error(`OSRM table request failed with status ${resp.status}`);
45
- const data = (await resp.json());
45
+ const data = await resp.json();
46
46
  if (data.code !== 'Ok' || !data.durations)
47
47
  throw new Error('OSRM table request failed');
48
48
  const durations = data.durations;
@@ -73,7 +73,7 @@ class OsrmMapService {
73
73
  const resp = await fetch(url);
74
74
  if (!resp.ok)
75
75
  throw new Error(`OSRM request failed with status ${resp.status}`);
76
- const data = (await resp.json());
76
+ const data = await resp.json();
77
77
  if (data.code !== 'Ok' || !data.routes || !data.routes.length) {
78
78
  throw new Error('OSRM route request failed');
79
79
  }
@@ -1 +1 @@
1
- {"version":3,"file":"osrm.js","sourceRoot":"/","sources":["libraries/map/providers/osrm.ts"],"names":[],"mappings":";;;;;;AAOA,+CAAyE;AAEzE,kDAA0B;AAI1B,MAAa,cAAc;IAClB,SAAS,CAA2C;IACpD,kBAAkB,CAA4B;IACrC,kBAAkB,GAAG,CAAC,CAAC;IACvB,IAAI,GAAG,6CAA6C,CAAC;IAEtE;QACC,IAAI,CAAC,SAAS,GAAG,kBAAqD,CAAC;QACvE,IAAI,CAAC,kBAAkB,GAAG,2BAA+C,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,MAAmB,EAAE,WAAwB;QAClE,MAAM,OAAO,GAAG,SAAS,CAAC;QAC1B,MAAM,SAAS,GAAG,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,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, ZoneExtraTimeModel, ZoneModel } from '../../mongo/models';\nimport { SoftDeleteModel } from '../../mongo/plugins/soft-delete-plugin';\nimport dayjs from 'dayjs';\nimport { WeekDay } from '../../../utilities/enum';\nimport { DocumentType } from '@typegoose/typegoose';\n\nexport class OsrmMapService implements IMapService {\n\tprivate zoneModel: typeof ZoneModel & SoftDeleteModel<Zone>;\n\tprivate zoneExtraTimeModel: typeof ZoneExtraTimeModel;\n\tprivate readonly DEFAULT_EXTRA_TIME = 0;\n\tprivate readonly _url = 'https://api-v2-development.lyxa.ai/distance';\n\n\tconstructor() {\n\t\tthis.zoneModel = ZoneModel as typeof ZoneModel & SoftDeleteModel<Zone>;\n\t\tthis.zoneExtraTimeModel = ZoneExtraTimeModel as typeof ZoneExtraTimeModel;\n\t}\n\n\tasync getDistanceInfo(origin: ICoordinate, destination: ICoordinate): Promise<IDistanceInfo> {\n\t\tconst profile = 'driving';\n\t\tconst originStr = `${origin.longitude},${origin.latitude}`;\n\t\tconst destinationStr = `${destination.longitude},${destination.latitude}`;\n\t\tconst url = `${this._url}/route/v1/${profile}/${originStr};${destinationStr}?overview=false`;\n\n\t\tconst resp = await fetch(url);\n\t\tif (!resp.ok) throw new Error(`OSRM request failed with status ${resp.status}`);\n\n\t\tconst data = (await resp.json()) as any;\n\t\tif (data.code !== 'Ok' || !data.routes || !data.routes.length) {\n\t\t\tthrow new Error('OSRM route request failed');\n\t\t}\n\n\t\tconst route = data.routes[0];\n\t\treturn {\n\t\t\tdistance: { value: route.distance, text: `${(route.distance / 1000).toFixed(2)} km` },\n\t\t\tduration: { value: route.duration, text: `${Math.ceil(route.duration / 60)} mins` },\n\t\t};\n\t}\n\n\tasync getDistanceMatrix(origins: ICoordinate[], destinations: ICoordinate[]): Promise<IRouteMatrixDTO[]> {\n\t\tconst allCoords = [...origins, ...destinations];\n\t\tconst coordString = allCoords.map(({ longitude, latitude }) => `${longitude},${latitude}`).join(';');\n\t\tconst originIndices = origins.map((_, idx) => idx).join(';');\n\t\tconst destIndices = destinations.map((_, idx) => origins.length + idx).join(';');\n\n\t\tconst url = `${this._url}/table/v1/bike/${coordString}?sources=${originIndices}&destinations=${destIndices}&annotations=distance,duration`;\n\n\t\tconst resp = await fetch(url);\n\t\tif (!resp.ok) throw new Error(`OSRM table request failed with status ${resp.status}`);\n\n\t\tconst data = (await resp.json()) as any;\n\t\tif (data.code !== 'Ok' || !data.durations) throw new Error('OSRM table request failed');\n\n\t\tconst durations: number[][] = data.durations;\n\t\tconst distances: number[][] = data.distances;\n\n\t\tconst zones = await this.findZonesByPoints(origins);\n\t\tconst extraTimes = await this.getExtraTimeForZones(zones);\n\n\t\tconst result: IRouteMatrixDTO[] = [];\n\n\t\torigins.forEach((_, i) => {\n\t\t\tdestinations.forEach((_, j) => {\n\t\t\t\tconst dur = durations[i][j] + (extraTimes[j] || this.DEFAULT_EXTRA_TIME);\n\t\t\t\tconst dist = distances.length ? distances[i][j] : 0;\n\n\t\t\t\tresult.push({\n\t\t\t\t\tdistance: { value: dist, text: distances.length ? `${(dist / 1000).toFixed(2)} km` : 'N/A' },\n\t\t\t\t\tduration: { value: dur, text: `${Math.ceil(dur / 60)} mins` },\n\t\t\t\t\tcondition: 'OK',\n\t\t\t\t\toriginIndex: i,\n\t\t\t\t\tdestinationIndex: j,\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\treturn result;\n\t}\n\n\tasync getWaypointsDistanceInfo(\n\t\torigin: ICoordinate,\n\t\tdestination: ICoordinate,\n\t\twaypoints: ICoordinate[]\n\t): Promise<IWaypointDistanceInfo> {\n\t\tconst profile = 'driving';\n\t\tconst coordsArr = [origin, ...waypoints, destination];\n\t\tconst coordsStr = coordsArr.map(({ longitude, latitude }) => `${longitude},${latitude}`).join(';');\n\t\tconst url = `${this._url}/route/v1/${profile}/${coordsStr}?overview=full&steps=true&geometries=geojson`;\n\n\t\tconst resp = await fetch(url);\n\t\tif (!resp.ok) throw new Error(`OSRM request failed with status ${resp.status}`);\n\n\t\tconst data = (await resp.json()) as any;\n\t\tif (data.code !== 'Ok' || !data.routes || !data.routes.length) {\n\t\t\tthrow new Error('OSRM route request failed');\n\t\t}\n\n\t\tconst route = data.routes[0];\n\t\tconst overviewPolyline = route.geometry?.coordinates || [];\n\t\tconst legs = (route.legs ?? []).map((leg: any) => ({\n\t\t\tdistance: { value: leg.distance, text: `${(leg.distance / 1000).toFixed(2)} km` },\n\t\t\tduration: { value: leg.duration, text: `${Math.ceil(leg.duration / 60)} mins` },\n\t\t\toverviewPolyline: leg.steps?.flatMap((step: any) => step.geometry?.coordinates || []) || [],\n\t\t}));\n\n\t\treturn {\n\t\t\tdistance: { value: route.distance, text: `${(route.distance / 1000).toFixed(2)} km` },\n\t\t\tduration: { value: route.duration, text: `${Math.ceil(route.duration / 60)} mins` },\n\t\t\toverviewPolyline,\n\t\t\tlegs,\n\t\t};\n\t}\n\n\tprivate async getExtraTimeForZones(zones: Array<DocumentType<Zone> | null>): Promise<number[]> {\n\t\tconst now = new Date();\n\t\tconst today = dayjs(now).day() as WeekDay;\n\t\tconst currentTime = dayjs(now).format('HH:mm');\n\n\t\tconst validZones = zones.filter((z): z is DocumentType<Zone> => z !== null);\n\t\tconst zoneIds = validZones.map(zone => zone._id);\n\n\t\tif (zoneIds.length === 0) return zones.map(_ => this.DEFAULT_EXTRA_TIME);\n\n\t\tconst applicableSlots = await this.zoneExtraTimeModel\n\t\t\t.find({\n\t\t\t\tzone: { $in: zoneIds },\n\t\t\t\tday: today,\n\t\t\t\tisActive: true,\n\t\t\t\tstart: { $lte: currentTime },\n\t\t\t\tend: { $gte: currentTime },\n\t\t\t})\n\t\t\t.lean()\n\t\t\t.exec();\n\n\t\tconst extraTimeMap = new Map<string, number>();\n\t\tfor (const slot of applicableSlots) {\n\t\t\textraTimeMap.set(slot.zone.toString(), slot.extraTimeInSeconds);\n\t\t}\n\n\t\treturn zones.map(zone => {\n\t\t\tif (!zone) return this.DEFAULT_EXTRA_TIME;\n\t\t\treturn extraTimeMap.get(zone._id.toString()) ?? this.DEFAULT_EXTRA_TIME;\n\t\t});\n\t}\n\tprivate async findZonesByPoints(points: ICoordinate[]): Promise<(DocumentType<Zone> | null)[]> {\n\t\tif (!points.length) return [];\n\t\treturn Promise.all(\n\t\t\tpoints.map(point =>\n\t\t\t\tthis.zoneModel\n\t\t\t\t\t.findOne({\n\t\t\t\t\t\tgeometry: {\n\t\t\t\t\t\t\t$geoIntersects: {\n\t\t\t\t\t\t\t\t$geometry: { type: 'Point', coordinates: [point.longitude, point.latitude] },\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t})\n\t\t\t\t\t.exec()\n\t\t\t)\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"osrm.js","sourceRoot":"/","sources":["libraries/map/providers/osrm.ts"],"names":[],"mappings":";;;;;;AAOA,+CAAyE;AAEzE,kDAA0B;AAI1B,MAAa,cAAc;IAClB,SAAS,CAA2C;IACpD,kBAAkB,CAA4B;IACrC,kBAAkB,GAAG,CAAC,CAAC;IACvB,IAAI,GAAG,6CAA6C,CAAC;IAEtE;QACC,IAAI,CAAC,SAAS,GAAG,kBAAqD,CAAC;QACvE,IAAI,CAAC,kBAAkB,GAAG,2BAA+C,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,MAAmB,EAAE,WAAwB;QAClE,MAAM,OAAO,GAAG,SAAS,CAAC;QAC1B,MAAM,SAAS,GAAG,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC3D,MAAM,cAAc,GAAG,GAAG,WAAW,CAAC,SAAS,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;QAC1E,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,IAAI,aAAa,OAAO,IAAI,SAAS,IAAI,cAAc,iBAAiB,CAAC;QAE7F,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,CAA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AAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACjE,CAAC;QAED,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACvB,IAAI,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAC,kBAAkB,CAAC;YAC1C,OAAO,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC;QACzE,CAAC,CAAC,CAAC;IACJ,CAAC;IACO,KAAK,CAAC,iBAAiB,CAAC,MAAqB;QACpD,IAAI,CAAC,MAAM,CAAC,MAAM;YAAE,OAAO,EAAE,CAAC;QAC9B,OAAO,OAAO,CAAC,GAAG,CACjB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAClB,IAAI,CAAC,SAAS;aACZ,OAAO,CAAC;YACR,QAAQ,EAAE;gBACT,cAAc,EAAE;oBACf,SAAS,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE;iBAC5E;aACD;SACD,CAAC;aACD,IAAI,EAAE,CACR,CACD,CAAC;IACH,CAAC;CACD;AAzJD,wCAyJC","sourcesContent":["import {\n\tICoordinate,\n\tIDistanceInfo,\n\tIMapService,\n\tIRouteMatrixDTO,\n\tIWaypointDistanceInfo,\n} from '../interfaces/IMapService';\nimport { Zone, ZoneExtraTimeModel, ZoneModel } from '../../mongo/models';\nimport { SoftDeleteModel } from '../../mongo/plugins/soft-delete-plugin';\nimport dayjs from 'dayjs';\nimport { WeekDay } from '../../../utilities/enum';\nimport { DocumentType } from '@typegoose/typegoose';\n\nexport class OsrmMapService implements IMapService {\n\tprivate zoneModel: typeof ZoneModel & SoftDeleteModel<Zone>;\n\tprivate zoneExtraTimeModel: typeof ZoneExtraTimeModel;\n\tprivate readonly DEFAULT_EXTRA_TIME = 0;\n\tprivate readonly _url = 'https://api-v2-development.lyxa.ai/distance';\n\n\tconstructor() {\n\t\tthis.zoneModel = ZoneModel as typeof ZoneModel & SoftDeleteModel<Zone>;\n\t\tthis.zoneExtraTimeModel = ZoneExtraTimeModel as typeof ZoneExtraTimeModel;\n\t}\n\n\tasync getDistanceInfo(origin: ICoordinate, destination: ICoordinate): Promise<IDistanceInfo> {\n\t\tconst profile = 'driving';\n\t\tconst originStr = `${origin.longitude},${origin.latitude}`;\n\t\tconst destinationStr = `${destination.longitude},${destination.latitude}`;\n\t\tconst url = `${this._url}/route/v1/${profile}/${originStr};${destinationStr}?overview=false`;\n\n\t\tconst resp = await fetch(url);\n\t\tif (!resp.ok) throw new Error(`OSRM request failed with status ${resp.status}`);\n\n\t\tconst data: any = await resp.json();\n\t\tif (data.code !== 'Ok' || !data.routes || !data.routes.length) {\n\t\t\tthrow new Error('OSRM route request failed');\n\t\t}\n\n\t\tconst route = data.routes[0];\n\t\treturn {\n\t\t\tdistance: { value: route.distance, text: `${(route.distance / 1000).toFixed(2)} km` },\n\t\t\tduration: { value: route.duration, text: `${Math.ceil(route.duration / 60)} mins` },\n\t\t};\n\t}\n\n\tasync getDistanceMatrix(origins: ICoordinate[], destinations: ICoordinate[]): Promise<IRouteMatrixDTO[]> {\n\t\tconst allCoords = [...origins, ...destinations];\n\t\tconst coordString = allCoords.map(({ longitude, latitude }) => `${longitude},${latitude}`).join(';');\n\t\tconst originIndices = origins.map((_, idx) => idx).join(';');\n\t\tconst destIndices = destinations.map((_, idx) => origins.length + idx).join(';');\n\n\t\tconst url = `${this._url}/table/v1/bike/${coordString}?sources=${originIndices}&destinations=${destIndices}&annotations=distance,duration`;\n\n\t\tconst resp = await fetch(url);\n\t\tif (!resp.ok) throw new Error(`OSRM table request failed with status ${resp.status}`);\n\n\t\tconst data: any = await resp.json();\n\t\tif (data.code !== 'Ok' || !data.durations) throw new Error('OSRM table request failed');\n\n\t\tconst durations: number[][] = data.durations;\n\t\tconst distances: number[][] = data.distances;\n\n\t\tconst zones = await this.findZonesByPoints(origins);\n\t\tconst extraTimes = await this.getExtraTimeForZones(zones);\n\n\t\tconst result: IRouteMatrixDTO[] = [];\n\n\t\torigins.forEach((_, i) => {\n\t\t\tdestinations.forEach((_, j) => {\n\t\t\t\tconst dur = durations[i][j] + (extraTimes[j] || this.DEFAULT_EXTRA_TIME);\n\t\t\t\tconst dist = distances.length ? distances[i][j] : 0;\n\n\t\t\t\tresult.push({\n\t\t\t\t\tdistance: { value: dist, text: distances.length ? `${(dist / 1000).toFixed(2)} km` : 'N/A' },\n\t\t\t\t\tduration: { value: dur, text: `${Math.ceil(dur / 60)} mins` },\n\t\t\t\t\tcondition: 'OK',\n\t\t\t\t\toriginIndex: i,\n\t\t\t\t\tdestinationIndex: j,\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\treturn result;\n\t}\n\n\tasync getWaypointsDistanceInfo(\n\t\torigin: ICoordinate,\n\t\tdestination: ICoordinate,\n\t\twaypoints: ICoordinate[]\n\t): Promise<IWaypointDistanceInfo> {\n\t\tconst profile = 'driving';\n\t\tconst coordsArr = [origin, ...waypoints, destination];\n\t\tconst coordsStr = coordsArr.map(({ longitude, latitude }) => `${longitude},${latitude}`).join(';');\n\t\tconst url = `${this._url}/route/v1/${profile}/${coordsStr}?overview=full&steps=true&geometries=geojson`;\n\n\t\tconst resp = await fetch(url);\n\t\tif (!resp.ok) throw new Error(`OSRM request failed with status ${resp.status}`);\n\n\t\tconst data: any = await resp.json();\n\t\tif (data.code !== 'Ok' || !data.routes || !data.routes.length) {\n\t\t\tthrow new Error('OSRM route request failed');\n\t\t}\n\n\t\tconst route = data.routes[0];\n\t\tconst overviewPolyline = route.geometry?.coordinates || [];\n\t\tconst legs = (route.legs ?? []).map((leg: any) => ({\n\t\t\tdistance: { value: leg.distance, text: `${(leg.distance / 1000).toFixed(2)} km` },\n\t\t\tduration: { value: leg.duration, text: `${Math.ceil(leg.duration / 60)} mins` },\n\t\t\toverviewPolyline: leg.steps?.flatMap((step: any) => step.geometry?.coordinates || []) || [],\n\t\t}));\n\n\t\treturn {\n\t\t\tdistance: { value: route.distance, text: `${(route.distance / 1000).toFixed(2)} km` },\n\t\t\tduration: { value: route.duration, text: `${Math.ceil(route.duration / 60)} mins` },\n\t\t\toverviewPolyline,\n\t\t\tlegs,\n\t\t};\n\t}\n\n\tprivate async getExtraTimeForZones(zones: Array<DocumentType<Zone> | null>): Promise<number[]> {\n\t\tconst now = new Date();\n\t\tconst today = dayjs(now).day() as WeekDay;\n\t\tconst currentTime = dayjs(now).format('HH:mm');\n\n\t\tconst validZones = zones.filter((z): z is DocumentType<Zone> => z !== null);\n\t\tconst zoneIds = validZones.map(zone => zone._id);\n\n\t\tif (zoneIds.length === 0) return zones.map(_ => this.DEFAULT_EXTRA_TIME);\n\n\t\tconst applicableSlots = await this.zoneExtraTimeModel\n\t\t\t.find({\n\t\t\t\tzone: { $in: zoneIds },\n\t\t\t\tday: today,\n\t\t\t\tisActive: true,\n\t\t\t\tstart: { $lte: currentTime },\n\t\t\t\tend: { $gte: currentTime },\n\t\t\t})\n\t\t\t.lean()\n\t\t\t.exec();\n\n\t\tconst extraTimeMap = new Map<string, number>();\n\t\tfor (const slot of applicableSlots) {\n\t\t\textraTimeMap.set(slot.zone.toString(), slot.extraTimeInSeconds);\n\t\t}\n\n\t\treturn zones.map(zone => {\n\t\t\tif (!zone) return this.DEFAULT_EXTRA_TIME;\n\t\t\treturn extraTimeMap.get(zone._id.toString()) ?? this.DEFAULT_EXTRA_TIME;\n\t\t});\n\t}\n\tprivate async findZonesByPoints(points: ICoordinate[]): Promise<(DocumentType<Zone> | null)[]> {\n\t\tif (!points.length) return [];\n\t\treturn Promise.all(\n\t\t\tpoints.map(point =>\n\t\t\t\tthis.zoneModel\n\t\t\t\t\t.findOne({\n\t\t\t\t\t\tgeometry: {\n\t\t\t\t\t\t\t$geoIntersects: {\n\t\t\t\t\t\t\t\t$geometry: { type: 'Point', coordinates: [point.longitude, point.latitude] },\n\t\t\t\t\t\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jB,MAAM;IAZlB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,CAAC;IAC1D,IAAA,eAAG,EAAS,MAAM,EAAE,KAAK,WAAW,IAAI;QACxC,MAAM,uDAAiC,CAAC,IAAI,CAAC,IAAI,EAAE,cAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAE7F,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,eAAG,EAAS,kBAAkB,EAAE,KAAK,WAAqC,IAAI;QAC9E,MAAM,yDAAmC,CAAC,IAAI,CAAC,IAAI,EAAE,cAAW,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;QAEhF,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;GACvE,MAAM,CAgDlB","sourcesContent":["import { index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport {\n\tBannerClickType,\n\tBannerLinkType,\n\tBannerUserType,\n\tStatus,\n\tUserAppSectionItemType,\n} from '../../../utilities/enum';\nimport { Shop } from './shop.model';\nimport { Product } from './product.model';\nimport { ServicePackage } from './service-package.model';\n\nimport { Zone } from './zone.model';\nimport { ListContainer } from './list-container.model';\nimport { BannerModel, UserAppSectionSetting } from '.';\nimport { Query } from 'mongoose';\nimport {\n\thandlePreSaveForSortingWithStatus,\n\thandlePreUpdateForSortingWithStatus,\n} from '../utilities/sorting-order.hooks';\n\n@modelOptions({ schemaOptions: { collection: 'banners' } })\n@pre<Banner>('save', async function (next) {\n\tawait handlePreSaveForSortingWithStatus.call(this, BannerModel, { itemType: this.itemType });\n\n\tnext();\n})\n@pre<Banner>('findOneAndUpdate', async function (this: Query<any, Banner>, next) {\n\tawait handlePreUpdateForSortingWithStatus.call(this, BannerModel, ['itemType']);\n\n\tnext();\n})\n@index({ title: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\nexport class Banner extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 50 })\n\tpublic title!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic image!: string;\n\n\t@prop({ required: true, type: String, enum: UserAppSectionItemType })\n\tpublic itemType!: UserAppSectionItemType;\n \n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: String, enum: BannerUserType, default: BannerUserType.ALL })\n\tpublic visibility?: BannerUserType;\n\n\t@prop({ ref: () => Zone, default: [] })\n\tpublic zones?: Ref<Zone>[];\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isClickable?: boolean;\n \n\t@prop({ type: String, enum: BannerClickType })\n\tpublic clickType?: BannerClickType;\n\n\t@prop({ type: String, enum: BannerLinkType })\n\tpublic linkType?: BannerLinkType;\n \n\t@prop({ type: String, trim: true })\n\tpublic link?: string;\n\n\t@prop({ ref: () => Shop })\n\tpublic shop?: Ref<Shop>;\n\n\t@prop({ ref: () => Product })\n\tpublic product?: Ref<Product>;\n\n\t@prop({ ref: () => ServicePackage })\n\tpublic servicePackage?: Ref<ServicePackage>;\n\n\t@prop({ ref: () => ListContainer })\n\tpublic listContainer?: Ref<ListContainer>;\n\n\t@prop({ ref: () => UserAppSectionSetting })\n\tpublic section?: Ref<UserAppSectionSetting>;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n}\n"]}
1
+ {"version":3,"file":"banner.model.js","sourceRoot":"/","sources":["libraries/mongo/models/banner.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AACrE,kDAMiC;AACjC,6CAAoC;AACpC,mDAA0C;AAC1C,mEAAyD;AAEzD,6CAAoC;AACpC,iEAAuD;AACvD,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eAAG,EAAS,kBAAkB,EAAE,KAAK,WAAqC,IAAI;QAC9E,MAAM,yDAAmC,CAAC,IAAI,CAAC,IAAI,EAAE,cAAW,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;QAEhF,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;GACvE,MAAM,CAgDlB","sourcesContent":["import { index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport {\n\tBannerClickType,\n\tBannerLinkType,\n\tBannerUserType,\n\tStatus,\n\tUserAppSectionItemType,\n} from '../../../utilities/enum';\nimport { Shop } from './shop.model';\nimport { Product } from './product.model';\nimport { ServicePackage } from './service-package.model';\n\nimport { Zone } from './zone.model';\nimport { ListContainer } from './list-container.model';\nimport { BannerModel, UserAppSectionSetting } from '.';\nimport { Query } from 'mongoose';\nimport {\n\thandlePreSaveForSortingWithStatus,\n\thandlePreUpdateForSortingWithStatus,\n} from '../utilities/sorting-order.hooks';\n\n@modelOptions({ schemaOptions: { collection: 'banners' } })\n@pre<Banner>('save', async function (next) {\n\tawait handlePreSaveForSortingWithStatus.call(this, BannerModel, { itemType: this.itemType });\n\n\tnext();\n})\n@pre<Banner>('findOneAndUpdate', async function (this: Query<any, Banner>, next) {\n\tawait handlePreUpdateForSortingWithStatus.call(this, BannerModel, ['itemType']);\n\n\tnext();\n})\n@index({ title: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\nexport class Banner extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 50 })\n\tpublic title!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic image!: string;\n\n\t@prop({ required: true, type: String, enum: UserAppSectionItemType })\n\tpublic itemType!: UserAppSectionItemType; // Todo: T-5188 Make Dynamic\n \n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: String, enum: BannerUserType, default: BannerUserType.ALL })\n\tpublic visibility?: BannerUserType;\n\n\t@prop({ ref: () => Zone, default: [] })\n\tpublic zones?: Ref<Zone>[];\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isClickable?: boolean;\n \n\t@prop({ type: String, enum: BannerClickType })\n\tpublic clickType?: BannerClickType;\n\n\t@prop({ type: String, enum: BannerLinkType })\n\tpublic linkType?: BannerLinkType;\n \n\t@prop({ type: String, trim: true })\n\tpublic link?: string;\n\n\t@prop({ ref: () => Shop })\n\tpublic shop?: Ref<Shop>;\n\n\t@prop({ ref: () => Product })\n\tpublic product?: Ref<Product>;\n\n\t@prop({ ref: () => ServicePackage })\n\tpublic servicePackage?: Ref<ServicePackage>;\n\n\t@prop({ ref: () => ListContainer })\n\tpublic listContainer?: Ref<ListContainer>;\n\n\t@prop({ ref: () => UserAppSectionSetting })\n\tpublic section?: Ref<UserAppSectionSetting>;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n}\n"]}
@@ -1,11 +1,11 @@
1
1
  import { Ref } from '@typegoose/typegoose';
2
2
  import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
3
- import { ItemType, Status } from '../../../utilities/enum';
3
+ import { Status } from '../../../utilities/enum';
4
4
  export declare class Category extends TimeStamps {
5
5
  name: string;
6
6
  nameNormalized?: string;
7
7
  image?: string;
8
- itemType: ItemType;
8
+ itemType: string;
9
9
  parentCategory?: Ref<Category>;
10
10
  status?: Status;
11
11
  note?: string;
@@ -37,7 +37,7 @@ __decorate([
37
37
  __metadata("design:type", String)
38
38
  ], Category.prototype, "image", void 0);
39
39
  __decorate([
40
- (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ItemType }),
40
+ (0, typegoose_1.prop)({ required: true, type: String }),
41
41
  __metadata("design:type", String)
42
42
  ], Category.prototype, "itemType", void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AAQ;IAdpB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,CAAC;IAC7D,IAAA,iBAAK,EACL,EAAE,cAAc,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAClC;QACC,MAAM,EAAE,IAAI;QACZ,uBAAuB,EAAE;YACxB,QAAQ,EAAE,EAAE,GAAG,EAAE,CAAC,eAAQ,CAAC,OAAO,EAAE,eAAQ,CAAC,GAAG,CAAC,EAAE;YACnD,cAAc,EAAE,IAAI;YACpB,SAAS,EAAE,IAAI;SACf;KACD,CACD;IACA,IAAA,iBAAK,EAAC,EAAE,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IAC9E,IAAA,kBAAM,EAAC,6CAAoB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;GACnC,QAAQ,CAqBpB","sourcesContent":["import { index, modelOptions, plugin, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ItemType, Status } from '../../../utilities/enum';\nimport { normalizeFieldPlugin } from '../plugins/normalize-field.plugin';\n\n@modelOptions({ schemaOptions: { collection: 'categories' } })\n@index(\n\t{ nameNormalized: 1, itemType: 1 },\n\t{\n\t\tunique: true,\n\t\tpartialFilterExpression: {\n\t\t\titemType: { $in: [ItemType.GROCERY, ItemType.PET] },\n\t\t\tparentCategory: null,\n\t\t\tdeletedAt: null,\n\t\t},\n\t}\n)\n@index({ nameNormalized: 1 }, { partialFilterExpression: { deletedAt: null } })\n@plugin(normalizeFieldPlugin, { field: 'name' })\nexport class Category extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 50 })\n\tpublic name!: string;\n\n\t@prop({ type: String, trim: true, lowercase: true, select: false })\n\tpublic nameNormalized?: string;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ ref: () => Category })\n\tpublic parentCategory?: Ref<Category>;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: String, maxlength: 250 })\n\tpublic note?: string;\n}\n"]}
1
+ {"version":3,"file":"category.model.js","sourceRoot":"/","sources":["libraries/mongo/models/category.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA8E;AAC9E,4EAAqE;AACrE,kDAA2D;AAC3D,8EAAyE;AAgBlE,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,2BAAU;IAEhC,IAAI,CAAU;IAGd,cAAc,CAAU;IAGxB,KAAK,CAAU;IAGf,QAAQ,CAAU;IAGlB,cAAc,CAAiB;IAG/B,MAAM,CAAU;IAGhB,IAAI,CAAU;CACrB,CAAA;AArBY,4BAAQ;AAEb;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;;sCAC7C;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;;gDACpC;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uCACD;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CACd;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;;gDACQ;AAG/B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;wCACtC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;;sCAClB;mBApBT,QAAQ;IAdpB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,CAAC;IAC7D,IAAA,iBAAK,EACL,EAAE,cAAc,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAClC;QACC,MAAM,EAAE,IAAI;QACZ,uBAAuB,EAAE;YACxB,QAAQ,EAAE,EAAE,GAAG,EAAE,CAAC,eAAQ,CAAC,OAAO,EAAE,eAAQ,CAAC,GAAG,CAAC,EAAE;YACnD,cAAc,EAAE,IAAI;YACpB,SAAS,EAAE,IAAI;SACf;KACD,CACD;IACA,IAAA,iBAAK,EAAC,EAAE,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IAC9E,IAAA,kBAAM,EAAC,6CAAoB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;GACnC,QAAQ,CAqBpB","sourcesContent":["import { index, modelOptions, plugin, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ItemType, Status } from '../../../utilities/enum';\nimport { normalizeFieldPlugin } from '../plugins/normalize-field.plugin';\n\n@modelOptions({ schemaOptions: { collection: 'categories' } })\n@index(\n\t{ nameNormalized: 1, itemType: 1 },\n\t{\n\t\tunique: true,\n\t\tpartialFilterExpression: {\n\t\t\titemType: { $in: [ItemType.GROCERY, ItemType.PET] }, // Todo: T-5188 Make Dynamic\n\t\t\tparentCategory: null,\n\t\t\tdeletedAt: null,\n\t\t},\n\t}\n)\n@index({ nameNormalized: 1 }, { partialFilterExpression: { deletedAt: null } })\n@plugin(normalizeFieldPlugin, { field: 'name' })\nexport class Category extends TimeStamps {\n\t@prop({ required: true, type: String, trim: true, maxlength: 50 })\n\tpublic name!: string;\n\n\t@prop({ type: String, trim: true, lowercase: true, select: false })\n\tpublic nameNormalized?: string;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ required: true, type: String })\n\tpublic itemType!: string;\n\n\t@prop({ ref: () => Category })\n\tpublic parentCategory?: Ref<Category>;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: String, maxlength: 250 })\n\tpublic note?: string;\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
2
- import { ItemType } from '../../../utilities/enum';
3
2
  export declare class DealSetting extends TimeStamps {
4
- itemType?: ItemType;
3
+ itemType?: string;
5
4
  percentageBundles?: number[];
6
5
  isDiscount?: boolean;
7
6
  isBuy1Get1?: boolean;
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DealSetting = void 0;
13
13
  const typegoose_1 = require("@typegoose/typegoose");
14
14
  const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
15
- const enum_1 = require("../../../utilities/enum");
16
15
  let DealSetting = class DealSetting extends defaultClasses_1.TimeStamps {
17
16
  itemType;
18
17
  percentageBundles;
@@ -23,7 +22,7 @@ let DealSetting = class DealSetting extends defaultClasses_1.TimeStamps {
23
22
  };
24
23
  exports.DealSetting = DealSetting;
25
24
  __decorate([
26
- (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ItemType }),
25
+ (0, typegoose_1.prop)({ required: true, type: String }),
27
26
  __metadata("design:type", String)
28
27
  ], DealSetting.prototype, "itemType", void 0);
29
28
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"deal-setting.model.js","sourceRoot":"/","sources":["libraries/mongo/models/deal-setting.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,kDAAmD;AAG5C,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,2BAAU;IAEnC,QAAQ,CAAY;IAGpB,iBAAiB,CAAY;IAG7B,UAAU,CAAW;IAGrB,UAAU,CAAW;IAGrB,cAAc,CAAW;IAGzB,gBAAgB,CAAW;CAClC,CAAA;AAlBY,kCAAW;AAEhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAQ,EAAE,CAAC;;6CAC5B;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;sDACF;AAG7B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;+CACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;+CACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;mDACP;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;qDACL;sBAjBtB,WAAW;IADvB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,CAAC;GACnD,WAAW,CAkBvB","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ItemType } from '../../../utilities/enum';\n\n@modelOptions({ schemaOptions: { collection: 'dealSettings' } })\nexport class DealSetting extends TimeStamps {\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType?: ItemType;\n\n\t@prop({ type: [Number], default: [] })\n\tpublic percentageBundles?: number[];\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isDiscount?: boolean;\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isBuy1Get1?: boolean;\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isFreeDelivery?: boolean;\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isPunchMarketing?: boolean;\n}\n"]}
1
+ {"version":3,"file":"deal-setting.model.js","sourceRoot":"/","sources":["libraries/mongo/models/deal-setting.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AAG9D,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,2BAAU;IAEnC,QAAQ,CAAU;IAGlB,iBAAiB,CAAY;IAG7B,UAAU,CAAW;IAGrB,UAAU,CAAW;IAGrB,cAAc,CAAW;IAGzB,gBAAgB,CAAW;CAClC,CAAA;AAlBY,kCAAW;AAEhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CACd;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;sDACF;AAG7B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;+CACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;+CACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;mDACP;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;qDACL;sBAjBtB,WAAW;IADvB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,CAAC;GACnD,WAAW,CAkBvB","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\n\n@modelOptions({ schemaOptions: { collection: 'dealSettings' } })\nexport class DealSetting extends TimeStamps {\n\t@prop({ required: true, type: String })\n\tpublic itemType?: string;\n\n\t@prop({ type: [Number], default: [] })\n\tpublic percentageBundles?: number[];\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isDiscount?: boolean;\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isBuy1Get1?: boolean;\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isFreeDelivery?: boolean;\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isPunchMarketing?: boolean;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"featured-setting.model.js","sourceRoot":"/","sources":["libraries/mongo/models/featured-setting.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,kDAAmD;AACnD,sEAA6D;AAGtD,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,2BAAU;IAEvC,QAAQ,CAAY;IAGpB,aAAa,CAAkB;CACtC,CAAA;AANY,0CAAe;AAEpB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAQ,EAAE,CAAC;;iDAC5B;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,iCAAY,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;sDACZ;0BAL1B,eAAe;IAD3B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,kBAAkB,EAAE,EAAE,CAAC;GACvD,eAAe,CAM3B","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ItemType } from '../../../utilities/enum';\nimport { FeaturedItem } from './embedded/featured-item.mode';\n\n@modelOptions({ schemaOptions: { collection: 'featuredSettings' } })\nexport class FeaturedSetting extends TimeStamps {\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ type: () => [FeaturedItem], default: [] })\n\tpublic featuredItems?: FeaturedItem[];\n}\n"]}
1
+ {"version":3,"file":"featured-setting.model.js","sourceRoot":"/","sources":["libraries/mongo/models/featured-setting.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,kDAAmD;AACnD,sEAA6D;AAGtD,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,2BAAU;IAEvC,QAAQ,CAAY;IAGpB,aAAa,CAAkB;CACtC,CAAA;AANY,0CAAe;AAEpB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAQ,EAAE,CAAC;;iDAC5B;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,iCAAY,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;sDACZ;0BAL1B,eAAe;IAD3B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,kBAAkB,EAAE,EAAE,CAAC;GACvD,eAAe,CAM3B","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ItemType } from '../../../utilities/enum';\nimport { FeaturedItem } from './embedded/featured-item.mode';\n\n@modelOptions({ schemaOptions: { collection: 'featuredSettings' } })\nexport class FeaturedSetting extends TimeStamps {\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType; // Todo: T-5188 Make Dynamic\n\n\t@prop({ type: () => [FeaturedItem], default: [] })\n\tpublic featuredItems?: FeaturedItem[];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"filter-container.model.js","sourceRoot":"/","sources":["libraries/mongo/models/filter-container.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AACrE,kDAAyE;AACzE,wBAAyC;AAEzC,0EAG0C;AAcnC,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,2BAAU;IAEvC,IAAI,CAAU;IAGd,KAAK,CAAY;IAGjB,QAAQ,CAA0B;IAGlC,MAAM,CAAU;IAGhB,SAAS,CAAW;IAGpB,YAAY,CAAU;CAC7B,CAAA;AAlBY,0CAAe;AAEpB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CAClB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;;8CACjB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,6BAAsB,EAAE,CAAC;;iDACZ;AAGlC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;+CACtC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;kDACZ;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDACM;0BAjBjB,eAAe;IAZ3B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,kBAAkB,EAAE,EAAE,CAAC;IACnE,IAAA,iBAAK,EAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IACpC,IAAA,eAAG,EAAkB,MAAM,EAAE,KAAK,WAAW,IAAI;QACjD,MAAM,uDAAiC,CAAC,IAAI,CAAC,IAAI,EAAE,uBAAoB,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEtG,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,eAAG,EAAkB,kBAAkB,EAAE,KAAK,WAA8C,IAAI;QAChG,MAAM,yDAAmC,CAAC,IAAI,CAAC,IAAI,EAAE,uBAAoB,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;QAEzF,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,eAAe,CAkB3B","sourcesContent":["import { Index, modelOptions, pre, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Status, UserAppSectionItemType } from '../../../utilities/enum';\nimport { FilterContainerModel } from '.';\nimport { Query } from 'mongoose';\nimport {\n\thandlePreSaveForSortingWithStatus,\n\thandlePreUpdateForSortingWithStatus,\n} from '../utilities/sorting-order.hooks';\n\n@modelOptions({ schemaOptions: { collection: 'filterContainers' } })\n@Index({ itemType: 1, deletedAt: 1 })\n@pre<FilterContainer>('save', async function (next) {\n\tawait handlePreSaveForSortingWithStatus.call(this, FilterContainerModel, { itemType: this.itemType });\n\n\tnext();\n})\n@pre<FilterContainer>('findOneAndUpdate', async function (this: Query<any, FilterContainer>, next) {\n\tawait handlePreUpdateForSortingWithStatus.call(this, FilterContainerModel, ['itemType']);\n\n\tnext();\n})\nexport class FilterContainer extends TimeStamps {\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: [String] })\n\tpublic deals!: string[]; // e.g., \"5\", \"10\", \"20\", \"30\", \"buy1get1\", \"free_delivery\"\n\n\t@prop({ type: String, enum: UserAppSectionItemType })\n\tpublic itemType?: UserAppSectionItemType;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isVisible!: boolean;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n}\n"]}
1
+ {"version":3,"file":"filter-container.model.js","sourceRoot":"/","sources":["libraries/mongo/models/filter-container.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsE;AACtE,4EAAqE;AACrE,kDAAyE;AACzE,wBAAyC;AAEzC,0EAG0C;AAcnC,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,2BAAU;IAEvC,IAAI,CAAU;IAGd,KAAK,CAAY;IAGjB,QAAQ,CAA0B;IAGlC,MAAM,CAAU;IAGhB,SAAS,CAAW;IAGpB,YAAY,CAAU;CAC7B,CAAA;AAlBY,0CAAe;AAEpB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CAClB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;;8CACjB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,6BAAsB,EAAE,CAAC;;iDACZ;AAGlC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;+CACtC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;kDACZ;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDACM;0BAjBjB,eAAe;IAZ3B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,kBAAkB,EAAE,EAAE,CAAC;IACnE,IAAA,iBAAK,EAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IACpC,IAAA,eAAG,EAAkB,MAAM,EAAE,KAAK,WAAW,IAAI;QACjD,MAAM,uDAAiC,CAAC,IAAI,CAAC,IAAI,EAAE,uBAAoB,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEtG,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,eAAG,EAAkB,kBAAkB,EAAE,KAAK,WAA8C,IAAI;QAChG,MAAM,yDAAmC,CAAC,IAAI,CAAC,IAAI,EAAE,uBAAoB,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;QAEzF,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,eAAe,CAkB3B","sourcesContent":["import { Index, modelOptions, pre, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Status, UserAppSectionItemType } from '../../../utilities/enum';\nimport { FilterContainerModel } from '.';\nimport { Query } from 'mongoose';\nimport {\n\thandlePreSaveForSortingWithStatus,\n\thandlePreUpdateForSortingWithStatus,\n} from '../utilities/sorting-order.hooks';\n\n@modelOptions({ schemaOptions: { collection: 'filterContainers' } })\n@Index({ itemType: 1, deletedAt: 1 })\n@pre<FilterContainer>('save', async function (next) {\n\tawait handlePreSaveForSortingWithStatus.call(this, FilterContainerModel, { itemType: this.itemType });\n\n\tnext();\n})\n@pre<FilterContainer>('findOneAndUpdate', async function (this: Query<any, FilterContainer>, next) {\n\tawait handlePreUpdateForSortingWithStatus.call(this, FilterContainerModel, ['itemType']);\n\n\tnext();\n})\nexport class FilterContainer extends TimeStamps {\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: [String] })\n\tpublic deals!: string[]; // e.g., \"5\", \"10\", \"20\", \"30\", \"buy1get1\", \"free_delivery\"\n\n\t@prop({ type: String, enum: UserAppSectionItemType })\n\tpublic itemType?: UserAppSectionItemType; // Todo: T-5188 Make Dynamic\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: Boolean, default: true })\n\tpublic isVisible!: boolean;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n}\n"]}
@@ -51,6 +51,7 @@ import { FreeDeliveryMarketing } from './providers/free-delivery-marketing.model
51
51
  import { GlobalCoupon } from './providers/global-coupon.model';
52
52
  import { IndividualStoreCoupon } from './providers/individual-store-coupon.model';
53
53
  import { IndividualUserCoupon } from './providers/individual-user-coupon.model';
54
+ import { NewUserDiscountMarketing } from './providers/new-user-discount-marketing.model';
54
55
  import { PunchMarketing } from './providers/punch-marketing.model';
55
56
  import { SpendToGetMarketing } from './providers/spend-to-get-marketing.model';
56
57
  import { ReferralCodeCoupon } from './providers/referral-code-coupon.model';
@@ -227,6 +228,7 @@ export declare const Buy1Get1MarketingModel: ReturnModelType<typeof Buy1Get1Mark
227
228
  export declare const DiscountMarketingModel: ReturnModelType<typeof DiscountMarketing>;
228
229
  export declare const FeaturedMarketingModel: ReturnModelType<typeof FeaturedMarketing>;
229
230
  export declare const FreeDeliveryMarketingModel: ReturnModelType<typeof FreeDeliveryMarketing>;
231
+ export declare const NewUserDiscountMarketingModel: ReturnModelType<typeof NewUserDiscountMarketing>;
230
232
  export declare const PunchMarketingModel: ReturnModelType<typeof PunchMarketing>;
231
233
  export declare const SpendToGetMarketingModel: ReturnModelType<typeof SpendToGetMarketing>;
232
234
  export * from './marketing.model';
@@ -234,6 +236,7 @@ export * from './providers/buy1-get1-marketing.model';
234
236
  export * from './providers/discount-marketing.model';
235
237
  export * from './providers/featured-marketing.model';
236
238
  export * from './providers/free-delivery-marketing.model';
239
+ export * from './providers/new-user-discount-marketing.model';
237
240
  export * from './providers/punch-marketing.model';
238
241
  export * from './providers/spend-to-get-marketing.model';
239
242
  export declare const MealPlanModel: ReturnModelType<typeof MealPlan>;
@@ -14,9 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.OrderModel = exports.NutritionModel = exports.NotificationModel = exports.MealPlanModel = exports.SpendToGetMarketingModel = exports.PunchMarketingModel = exports.FreeDeliveryMarketingModel = exports.FeaturedMarketingModel = exports.DiscountMarketingModel = exports.Buy1Get1MarketingModel = exports.MarketingModel = exports.ListContainerModel = exports.LineItemModel = exports.GalleryUploadModel = exports.GalleryModel = exports.FlagModel = exports.FinanceSettlementModel = exports.FilterContainerModel = exports.FeaturedSettingModel = exports.FavouriteModel = exports.DishModel = exports.LimitedTimeOfferParticipantModel = exports.LimitedTimeOfferConfigModel = exports.LimitedTimeOfferCampaignSessionModel = exports.LimitedTimeOfferCampaignModel = exports.DealSettingModel = exports.ReferralRewardCouponModel = exports.ReferralCodeCouponModel = exports.IndividualUserCouponModel = exports.IndividualStoreCouponModel = exports.ShopsCategoriesCouponModel = exports.GlobalCouponModel = exports.CustomCouponModel = exports.BaseCouponModel = exports.CouponModel = exports.CounterModel = exports.CategoryModel = exports.CartParticipantModel = exports.CartModel = exports.UserActionModel = exports.ServiceControlModel = exports.AppAppearanceModel = exports.BrandModel = exports.BOBFinanceModel = exports.BannerModel = exports.AttributeModel = exports.UserAppSectionSettingModel = exports.AdminModel = exports.AdminAccessControlModel = exports.ActivityLogModel = void 0;
18
- exports.ServiceCategoryModel = exports.VendorAccessControlModel = exports.VendorModel = exports.VendorParentModel = exports.ServiceModel = exports.ChatroomModel = exports.AgentPerformanceModel = exports.MessageModel = exports.TicketModel = exports.RewardModel = exports.CancellationReasonModel = exports.SupportReasonModel = exports.TermsAndConditionsModel = exports.DefaultChatModel = exports.DeliveryChargesModel = exports.ZoneModel = exports.UserModel = exports.TagModel = exports.SubscriptionModel = exports.ShopModel = exports.ShopSectionModel = exports.ShopMealPlanModel = exports.ShopCategoryModel = exports.ShopAccessControlModel = exports.SettingModel = exports.RiderModel = exports.RiderTrackingModel = exports.RiderTimeoutModel = exports.ServicePackageReviewModel = exports.VendorReviewModel = exports.RiderReviewModel = exports.ShopReviewModel = exports.ReviewModel = exports.RequestAreaModel = exports.ReferralSettingModel = exports.RatingSettingModel = exports.SpendToGetHistoryModel = exports.PunchMarketingHistoryModel = exports.ProductUploadModel = exports.ProductModel = exports.ProductStockTrackerModel = exports.ProductMarketingModel = exports.VendorPayoutModel = exports.RiderPayoutModel = exports.ShopPayoutModel = exports.PayoutModel = exports.ParentModel = exports.ShopCourierOrderModel = exports.CourierOrderModel = exports.RegularOrderModel = void 0;
19
- exports.CopyAttributeMapModel = exports.CopyShopCategoryMapModel = exports.CopyProductMapModel = exports.CopyProductJobModel = exports.ProductBrandModel = exports.TournamentParticipantModel = exports.TournamentModel = exports.BookingCancellationReschedulingRuleModel = exports.IntegrationConfigurationModel = exports.ServiceFlagModel = exports.PaymentConfigurationModel = exports.AppInstanceModel = exports.ZoneExtraTimeModel = exports.LoggerModel = exports.ServicePromotionModel = exports.TicketActionModel = exports.ProfessionalBlockedTimeModel = exports.ServiceBookingModel = exports.ServiceCartModel = exports.ProfessionalModel = exports.ServicePackageModel = exports.ServiceAddonModel = void 0;
17
+ exports.NutritionModel = exports.NotificationModel = exports.MealPlanModel = exports.SpendToGetMarketingModel = exports.PunchMarketingModel = exports.NewUserDiscountMarketingModel = exports.FreeDeliveryMarketingModel = exports.FeaturedMarketingModel = exports.DiscountMarketingModel = exports.Buy1Get1MarketingModel = exports.MarketingModel = exports.ListContainerModel = exports.LineItemModel = exports.GalleryUploadModel = exports.GalleryModel = exports.FlagModel = exports.FinanceSettlementModel = exports.FilterContainerModel = exports.FeaturedSettingModel = exports.FavouriteModel = exports.DishModel = exports.LimitedTimeOfferParticipantModel = exports.LimitedTimeOfferConfigModel = exports.LimitedTimeOfferCampaignSessionModel = exports.LimitedTimeOfferCampaignModel = exports.DealSettingModel = exports.ReferralRewardCouponModel = exports.ReferralCodeCouponModel = exports.IndividualUserCouponModel = exports.IndividualStoreCouponModel = exports.ShopsCategoriesCouponModel = exports.GlobalCouponModel = exports.CustomCouponModel = exports.BaseCouponModel = exports.CouponModel = exports.CounterModel = exports.CategoryModel = exports.CartParticipantModel = exports.CartModel = exports.UserActionModel = exports.ServiceControlModel = exports.AppAppearanceModel = exports.BrandModel = exports.BOBFinanceModel = exports.BannerModel = exports.AttributeModel = exports.UserAppSectionSettingModel = exports.AdminModel = exports.AdminAccessControlModel = exports.ActivityLogModel = void 0;
18
+ exports.VendorAccessControlModel = exports.VendorModel = exports.VendorParentModel = exports.ServiceModel = exports.ChatroomModel = exports.AgentPerformanceModel = exports.MessageModel = exports.TicketModel = exports.RewardModel = exports.CancellationReasonModel = exports.SupportReasonModel = exports.TermsAndConditionsModel = exports.DefaultChatModel = exports.DeliveryChargesModel = exports.ZoneModel = exports.UserModel = exports.TagModel = exports.SubscriptionModel = exports.ShopModel = exports.ShopSectionModel = exports.ShopMealPlanModel = exports.ShopCategoryModel = exports.ShopAccessControlModel = exports.SettingModel = exports.RiderModel = exports.RiderTrackingModel = exports.RiderTimeoutModel = exports.ServicePackageReviewModel = exports.VendorReviewModel = exports.RiderReviewModel = exports.ShopReviewModel = exports.ReviewModel = exports.RequestAreaModel = exports.ReferralSettingModel = exports.RatingSettingModel = exports.SpendToGetHistoryModel = exports.PunchMarketingHistoryModel = exports.ProductUploadModel = exports.ProductModel = exports.ProductStockTrackerModel = exports.ProductMarketingModel = exports.VendorPayoutModel = exports.RiderPayoutModel = exports.ShopPayoutModel = exports.PayoutModel = exports.ParentModel = exports.ShopCourierOrderModel = exports.CourierOrderModel = exports.RegularOrderModel = exports.OrderModel = void 0;
19
+ exports.CopyAttributeMapModel = exports.CopyShopCategoryMapModel = exports.CopyProductMapModel = exports.CopyProductJobModel = exports.ProductBrandModel = exports.TournamentParticipantModel = exports.TournamentModel = exports.BookingCancellationReschedulingRuleModel = exports.IntegrationConfigurationModel = exports.ServiceFlagModel = exports.PaymentConfigurationModel = exports.AppInstanceModel = exports.ZoneExtraTimeModel = exports.LoggerModel = exports.ServicePromotionModel = exports.TicketActionModel = exports.ProfessionalBlockedTimeModel = exports.ServiceBookingModel = exports.ServiceCartModel = exports.ProfessionalModel = exports.ServicePackageModel = exports.ServiceAddonModel = exports.ServiceCategoryModel = void 0;
20
20
  exports.getCoreAuthIdentityModel = getCoreAuthIdentityModel;
21
21
  exports.getCoreEmailAuthIdentityModel = getCoreEmailAuthIdentityModel;
22
22
  exports.getCorePhoneAuthIdentityModel = getCorePhoneAuthIdentityModel;
@@ -81,6 +81,7 @@ const free_delivery_marketing_model_1 = require("./providers/free-delivery-marke
81
81
  const global_coupon_model_1 = require("./providers/global-coupon.model");
82
82
  const individual_store_coupon_model_1 = require("./providers/individual-store-coupon.model");
83
83
  const individual_user_coupon_model_1 = require("./providers/individual-user-coupon.model");
84
+ const new_user_discount_marketing_model_1 = require("./providers/new-user-discount-marketing.model");
84
85
  const punch_marketing_model_1 = require("./providers/punch-marketing.model");
85
86
  const spend_to_get_marketing_model_1 = require("./providers/spend-to-get-marketing.model");
86
87
  const referral_code_coupon_model_1 = require("./providers/referral-code-coupon.model");
@@ -310,6 +311,7 @@ exports.Buy1Get1MarketingModel = (0, typegoose_1.getDiscriminatorModelForClass)(
310
311
  exports.DiscountMarketingModel = (0, typegoose_1.getDiscriminatorModelForClass)(exports.MarketingModel, discount_marketing_model_1.DiscountMarketing, enum_1.MarketingType.DISCOUNT);
311
312
  exports.FeaturedMarketingModel = (0, typegoose_1.getDiscriminatorModelForClass)(exports.MarketingModel, featured_marketing_model_1.FeaturedMarketing, enum_1.MarketingType.FEATURED);
312
313
  exports.FreeDeliveryMarketingModel = (0, typegoose_1.getDiscriminatorModelForClass)(exports.MarketingModel, free_delivery_marketing_model_1.FreeDeliveryMarketing, enum_1.MarketingType.FREE_DELIVERY);
314
+ exports.NewUserDiscountMarketingModel = (0, typegoose_1.getDiscriminatorModelForClass)(exports.MarketingModel, new_user_discount_marketing_model_1.NewUserDiscountMarketing, enum_1.MarketingType.NEW_USER_DISCOUNT);
313
315
  exports.PunchMarketingModel = (0, typegoose_1.getDiscriminatorModelForClass)(exports.MarketingModel, punch_marketing_model_1.PunchMarketing, enum_1.MarketingType.PUNCH_MARKETING);
314
316
  exports.SpendToGetMarketingModel = (0, typegoose_1.getDiscriminatorModelForClass)(exports.MarketingModel, spend_to_get_marketing_model_1.SpendToGetMarketing, enum_1.MarketingType.SPEND_TO_GET);
315
317
  __exportStar(require("./marketing.model"), exports);
@@ -317,6 +319,7 @@ __exportStar(require("./providers/buy1-get1-marketing.model"), exports);
317
319
  __exportStar(require("./providers/discount-marketing.model"), exports);
318
320
  __exportStar(require("./providers/featured-marketing.model"), exports);
319
321
  __exportStar(require("./providers/free-delivery-marketing.model"), exports);
322
+ __exportStar(require("./providers/new-user-discount-marketing.model"), exports);
320
323
  __exportStar(require("./providers/punch-marketing.model"), exports);
321
324
  __exportStar(require("./providers/spend-to-get-marketing.model"), exports);
322
325
  exports.MealPlanModel = (0, typegoose_1.getModelForClass)(meal_plan_model_1.MealPlan);