@lyxa.ai/core 1.0.86-debug.1 → 1.0.86

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 (76) hide show
  1. package/dist/libraries/cache/settings/index.d.ts +2 -1
  2. package/dist/libraries/cache/settings/index.js +4 -2
  3. package/dist/libraries/cache/settings/index.js.map +1 -1
  4. package/dist/libraries/index.d.ts +0 -2
  5. package/dist/libraries/index.js +0 -4
  6. package/dist/libraries/index.js.map +1 -1
  7. package/dist/libraries/mongo/models/cancellation-reason.model.js +13 -46
  8. package/dist/libraries/mongo/models/cancellation-reason.model.js.map +1 -1
  9. package/dist/libraries/mongo/models/coupon.model.d.ts +0 -3
  10. package/dist/libraries/mongo/models/coupon.model.js +0 -10
  11. package/dist/libraries/mongo/models/coupon.model.js.map +1 -1
  12. package/dist/libraries/mongo/models/embedded/courier-order-finance.model.d.ts +1 -3
  13. package/dist/libraries/mongo/models/embedded/courier-order-finance.model.js +1 -7
  14. package/dist/libraries/mongo/models/embedded/courier-order-finance.model.js.map +1 -1
  15. package/dist/libraries/mongo/models/embedded/order-finance.model.d.ts +0 -2
  16. package/dist/libraries/mongo/models/embedded/order-finance.model.js +0 -6
  17. package/dist/libraries/mongo/models/embedded/order-finance.model.js.map +1 -1
  18. package/dist/libraries/mongo/models/embedded/order-pricing.model.d.ts +3 -3
  19. package/dist/libraries/mongo/models/embedded/order-pricing.model.js.map +1 -1
  20. package/dist/libraries/mongo/models/embedded/order-refund.model.d.ts +0 -14
  21. package/dist/libraries/mongo/models/embedded/order-refund.model.js +0 -66
  22. package/dist/libraries/mongo/models/embedded/order-refund.model.js.map +1 -1
  23. package/dist/libraries/mongo/models/embedded/regular-order-finance.model.d.ts +1 -1
  24. package/dist/libraries/mongo/models/embedded/regular-order-finance.model.js +1 -1
  25. package/dist/libraries/mongo/models/embedded/regular-order-finance.model.js.map +1 -1
  26. package/dist/libraries/mongo/models/embedded/trip-leg.mode.d.ts +2 -2
  27. package/dist/libraries/mongo/models/embedded/trip-leg.mode.js +1 -1
  28. package/dist/libraries/mongo/models/embedded/trip-leg.mode.js.map +1 -1
  29. package/dist/libraries/mongo/models/finance-settlement.model.d.ts +0 -4
  30. package/dist/libraries/mongo/models/finance-settlement.model.js +0 -20
  31. package/dist/libraries/mongo/models/finance-settlement.model.js.map +1 -1
  32. package/dist/libraries/mongo/models/index.d.ts +1 -1
  33. package/dist/libraries/mongo/models/index.js +1 -1
  34. package/dist/libraries/mongo/models/index.js.map +1 -1
  35. package/dist/libraries/mongo/models/payout.model.js +2 -24
  36. package/dist/libraries/mongo/models/payout.model.js.map +1 -1
  37. package/dist/libraries/mongo/models/providers/courier-order.model.d.ts +0 -1
  38. package/dist/libraries/mongo/models/providers/courier-order.model.js +0 -5
  39. package/dist/libraries/mongo/models/providers/courier-order.model.js.map +1 -1
  40. package/dist/libraries/mongo/models/providers/individual-store-coupon.model.d.ts +1 -1
  41. package/dist/libraries/mongo/models/providers/individual-store-coupon.model.js +1 -1
  42. package/dist/libraries/mongo/models/providers/individual-store-coupon.model.js.map +1 -1
  43. package/dist/libraries/mongo/models/providers/individual-user-coupon.model.d.ts +2 -2
  44. package/dist/libraries/mongo/models/providers/individual-user-coupon.model.js +2 -2
  45. package/dist/libraries/mongo/models/providers/individual-user-coupon.model.js.map +1 -1
  46. package/dist/libraries/mongo/models/shared/address.model.d.ts +1 -1
  47. package/dist/libraries/mongo/models/shared/address.model.js +1 -1
  48. package/dist/libraries/mongo/models/shared/address.model.js.map +1 -1
  49. package/dist/libraries/mongo/models/support-reason.model.js +2 -35
  50. package/dist/libraries/mongo/models/support-reason.model.js.map +1 -1
  51. package/dist/libraries/mongo/models/user.model.js +1 -1
  52. package/dist/libraries/mongo/models/user.model.js.map +1 -1
  53. package/dist/libraries/mongo/plugins/soft-delete-plugin.d.ts +0 -2
  54. package/dist/libraries/mongo/plugins/soft-delete-plugin.js +0 -11
  55. package/dist/libraries/mongo/plugins/soft-delete-plugin.js.map +1 -1
  56. package/dist/utilities/currency.js +4 -5
  57. package/dist/utilities/currency.js.map +1 -1
  58. package/dist/utilities/enum.d.ts +4 -13
  59. package/dist/utilities/enum.js +4 -15
  60. package/dist/utilities/enum.js.map +1 -1
  61. package/dist/utilities/validation/common-validation.d.ts +0 -120
  62. package/dist/utilities/validation/common-validation.js +1 -6
  63. package/dist/utilities/validation/common-validation.js.map +1 -1
  64. package/package.json +1 -2
  65. package/dist/libraries/mongo/models/app-screen-setting.model.d.ts +0 -9
  66. package/dist/libraries/mongo/models/app-screen-setting.model.js +0 -72
  67. package/dist/libraries/mongo/models/app-screen-setting.model.js.map +0 -1
  68. package/dist/libraries/mongo/models/order-payment.model.d.ts +0 -17
  69. package/dist/libraries/mongo/models/order-payment.model.js +0 -84
  70. package/dist/libraries/mongo/models/order-payment.model.js.map +0 -1
  71. package/dist/libraries/mongo/models/providers/courier-order-finance.model.d.ts +0 -7
  72. package/dist/libraries/mongo/models/providers/courier-order-finance.model.js +0 -26
  73. package/dist/libraries/mongo/models/providers/courier-order-finance.model.js.map +0 -1
  74. package/dist/libraries/mongo/models/providers/regular-order-finance.model.d.ts +0 -25
  75. package/dist/libraries/mongo/models/providers/regular-order-finance.model.js +0 -95
  76. package/dist/libraries/mongo/models/providers/regular-order-finance.model.js.map +0 -1
@@ -1,7 +1,8 @@
1
1
  import { RedisService } from '../../redis';
2
2
  export declare class CachedSettingsService {
3
- private readonly redisService;
3
+ private redisService;
4
4
  constructor(redisService: RedisService);
5
5
  getSettings(): Promise<any>;
6
6
  updateSettings(): Promise<string>;
7
7
  }
8
+ export declare const cachedSettingsService: CachedSettingsService;
@@ -12,7 +12,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  return function (target, key) { decorator(target, key, paramIndex); }
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.CachedSettingsService = void 0;
15
+ exports.cachedSettingsService = exports.CachedSettingsService = void 0;
16
16
  const typedi_1 = require("typedi");
17
17
  const redis_1 = require("../../redis");
18
18
  const models_1 = require("../../mongo/models");
@@ -32,8 +32,9 @@ let CachedSettingsService = class CachedSettingsService {
32
32
  if (cached)
33
33
  return cached;
34
34
  const settings = await models_1.SettingModel.findOne({}).lean().exec();
35
- if (!settings)
35
+ if (!settings) {
36
36
  throw new Error('Settings not found');
37
+ }
37
38
  await this.redisService.cacheObject(key, settings);
38
39
  return settings;
39
40
  }
@@ -49,4 +50,5 @@ exports.CachedSettingsService = CachedSettingsService = __decorate([
49
50
  __param(0, (0, typedi_1.Inject)(() => redis_1.RedisService)),
50
51
  __metadata("design:paramtypes", [redis_1.RedisService])
51
52
  ], CachedSettingsService);
53
+ exports.cachedSettingsService = typedi_1.Container.get(CachedSettingsService);
52
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/cache/settings/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mCAAyC;AACzC,uCAA2C;AAC3C,+CAAkD;AAElD,MAAM,cAAc,GAAG,GAAW,EAAE;IACnC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC;IAC1C,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,KAAK,CAAC;IACrD,OAAO,YAAY,MAAM,IAAI,WAAW,EAAE,CAAC;AAC5C,CAAC,CAAC;AAGK,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IACwB;IAAzD,YAAyD,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;IAEvF,KAAK,CAAC,WAAW;QAChB,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;QAE7B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,eAAe,CAAM,GAAG,CAAC,CAAC;QACjE,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;QAE1B,MAAM,QAAQ,GAAG,MAAM,qBAAY,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;QAC9D,IAAI,CAAC,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAErD,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACnD,OAAO,QAAQ,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,cAAc;QACnB,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;QAC7B,MAAM,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAChD,OAAO,qCAAqC,CAAC;IAC9C,CAAC;CACD,CAAA;AArBY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,gBAAO,GAAE;IAEI,WAAA,IAAA,eAAM,EAAC,GAAG,EAAE,CAAC,oBAAY,CAAC,CAAA;qCAAgC,oBAAY;GADvE,qBAAqB,CAqBjC","sourcesContent":["import { Service, Inject } from 'typedi';\nimport { RedisService } from '../../redis';\nimport { SettingModel } from '../../mongo/models';\n\nconst getSettingsKey = (): string => {\n\tconst tenant = process.env.tenant || 'lb';\n\tconst environment = process.env.environment || 'dev';\n\treturn `settings:${tenant}:${environment}`;\n};\n\n@Service()\nexport class CachedSettingsService {\n\tconstructor(@Inject(() => RedisService) private readonly redisService: RedisService) {}\n\n\tasync getSettings(): Promise<any> {\n\t\tconst key = getSettingsKey();\n\n\t\tconst cached = await this.redisService.getCachedObject<any>(key);\n\t\tif (cached) return cached;\n\n\t\tconst settings = await SettingModel.findOne({}).lean().exec();\n\t\tif (!settings) throw new Error('Settings not found');\n\n\t\tawait this.redisService.cacheObject(key, settings);\n\t\treturn settings;\n\t}\n\n\tasync updateSettings(): Promise<string> {\n\t\tconst key = getSettingsKey();\n\t\tawait this.redisService.deleteCachedObject(key);\n\t\treturn 'Settings cache cleared successfully';\n\t}\n}\n"]}
1
+ {"version":3,"file":"index.js","source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GAAE;IAEI,WAAA,IAAA,eAAM,EAAC,GAAG,EAAE,CAAC,oBAAY,CAAC,CAAA;qCAAuB,oBAAY;GAD9D,qBAAqB,CAkCjC;AAGY,QAAA,qBAAqB,GAAG,kBAAS,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC","sourcesContent":["import { Service, Inject, Container } from 'typedi';\nimport { RedisService } from '../../redis'; // Adjust the path to your RedisService\nimport { SettingModel } from '../../mongo/models'; // Adjust this import to your Setting model\n\nconst getSettingsKey = (): string => {\n\tconst tenant = process.env.tenant || 'lb';\n\tconst environment = process.env.environment || 'dev';\n\treturn `settings:${tenant}:${environment}`;\n};\n\n@Service()\nexport class CachedSettingsService {\n\tconstructor(@Inject(() => RedisService) private redisService: RedisService) {}\n\n\t/**\n\t * Get settings from Redis cache or fallback to DB if not found.\n\t */\n\tasync getSettings(): Promise<any> {\n\t\tconst key = getSettingsKey();\n\n\t\t// Try cache first\n\t\tconst cached = await this.redisService.getCachedObject<any>(key);\n\t\tif (cached) return cached;\n\n\t\t// Cache miss — fetch from DB\n\t\tconst settings = await SettingModel.findOne({}).lean().exec();\n\n\t\tif (!settings) {\n\t\t\tthrow new Error('Settings not found');\n\t\t}\n\n\t\t// Cache it\n\t\tawait this.redisService.cacheObject(key, settings);\n\n\t\treturn settings;\n\t}\n\n\t/**\n\t * Clear cached settings from Redis.\n\t */\n\tasync updateSettings(): Promise<string> {\n\t\tconst key = getSettingsKey();\n\t\tawait this.redisService.deleteCachedObject(key);\n\t\treturn 'Settings cache cleared successfully';\n\t}\n}\n\n// Export singleton instance for convenience\nexport const cachedSettingsService = Container.get(CachedSettingsService);\n"]}
@@ -8,7 +8,6 @@ import { UploadService } from './upload';
8
8
  import { FirebaseService } from './firebase';
9
9
  import { TokenRepository } from './auth/repository';
10
10
  import { MapService } from './map';
11
- import { CachedSettingsService } from './cache/settings';
12
11
  export declare class LibraryManager {
13
12
  getLogger(): LyxaLogger;
14
13
  getMicroServiceDispatcher(): MicroServiceDispatcher;
@@ -21,5 +20,4 @@ export declare class LibraryManager {
21
20
  getGlobalUploadService(): UploadService;
22
21
  getTenetUploadService(): UploadService;
23
22
  getMapService(): MapService;
24
- getCachedSettingsService(): CachedSettingsService;
25
23
  }
@@ -18,7 +18,6 @@ const upload_1 = require("./upload");
18
18
  const firebase_1 = require("./firebase");
19
19
  const repository_1 = require("./auth/repository");
20
20
  const map_1 = require("./map");
21
- const settings_1 = require("./cache/settings");
22
21
  let LibraryManager = class LibraryManager {
23
22
  getLogger() {
24
23
  return typedi_1.Container.get(logger_1.LyxaLogger);
@@ -53,9 +52,6 @@ let LibraryManager = class LibraryManager {
53
52
  getMapService() {
54
53
  return typedi_1.Container.get(map_1.MapService);
55
54
  }
56
- getCachedSettingsService() {
57
- return typedi_1.Container.get(settings_1.CachedSettingsService);
58
- }
59
55
  };
60
56
  exports.LibraryManager = LibraryManager;
61
57
  exports.LibraryManager = LibraryManager = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mCAA4C;AAC5C,qCAAyC;AACzC,qCAAsC;AACtC,6CAAsD;AACtD,uCAAiD;AACjD,mCAAuC;AACvC,mDAAuD;AACvD,qCAAyC;AACzC,yCAA6C;AAC7C,kDAAoD;AACpD,+BAAmC;AACnC,+CAAyD;AAGlD,IAAM,cAAc,GAApB,MAAM,cAAc;IACnB,SAAS;QACf,OAAO,kBAAS,CAAC,GAAG,CAAC,mBAAU,CAAC,CAAC;IAClC,CAAC;IACM,yBAAyB;QAC/B,OAAO,kBAAS,CAAC,GAAG,CAAC,mCAAsB,CAAC,CAAC;IAC9C,CAAC;IACM,gBAAgB;QACtB,OAAO,kBAAS,CAAC,GAAG,CAAC,sBAAa,CAAC,CAAC;IACrC,CAAC;IACM,iBAAiB;QACvB,OAAO,kBAAS,CAAC,GAAG,CAAC,8BAAoB,CAAC,CAAC;IAC5C,CAAC;IACM,eAAe;QACrB,OAAO,kBAAS,CAAC,GAAG,CAAC,oBAAY,CAAC,CAAC;IACpC,CAAC;IACM,uBAAuB;QAC7B,OAAO,kBAAS,CAAC,GAAG,CAAC,oCAAoB,CAAC,CAAC;IAC5C,CAAC;IACM,kBAAkB;QACxB,OAAO,kBAAS,CAAC,GAAG,CAAC,0BAAe,CAAC,CAAC;IACvC,CAAC;IACM,sBAAsB;QAC5B,OAAO,kBAAS,CAAC,GAAG,CAAC,4BAAe,CAAC,CAAC;IACvC,CAAC;IACM,sBAAsB;QAC5B,OAAO,IAAI,sBAAa,EAAE,CAAC;IAC5B,CAAC;IACM,qBAAqB;QAC3B,OAAO,IAAI,sBAAa,CAAC,OAAO,GAAG,IAAI,CAAC,uBAAuB,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClF,CAAC;IACM,aAAa;QACnB,OAAO,kBAAS,CAAC,GAAG,CAAC,gBAAU,CAAC,CAAC;IAClC,CAAC;IACM,wBAAwB;QAC9B,OAAO,kBAAS,CAAC,GAAG,CAAC,gCAAqB,CAAC,CAAC;IAC7C,CAAC;CACD,CAAA;AArCY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,gBAAO,GAAE;GACG,cAAc,CAqC1B","sourcesContent":["import { Container, Service } from 'typedi';\nimport { TwilioService } from './twilio';\nimport { LyxaLogger } from './logger';\nimport { MicroServiceDispatcher } from './dispatcher';\nimport { SecretManagerService } from './secrets';\nimport { RedisService } from './redis';\nimport { ConfigurationService } from './configuration';\nimport { UploadService } from './upload';\nimport { FirebaseService } from './firebase';\nimport { TokenRepository } from './auth/repository';\nimport { MapService } from './map';\nimport { CachedSettingsService } from './cache/settings';\n\n@Service()\nexport class LibraryManager {\n\tpublic getLogger(): LyxaLogger {\n\t\treturn Container.get(LyxaLogger);\n\t}\n\tpublic getMicroServiceDispatcher(): MicroServiceDispatcher {\n\t\treturn Container.get(MicroServiceDispatcher);\n\t}\n\tpublic getTwilioService(): TwilioService {\n\t\treturn Container.get(TwilioService);\n\t}\n\tpublic getSecretsService(): SecretManagerService {\n\t\treturn Container.get(SecretManagerService);\n\t}\n\tpublic getRedisService(): RedisService {\n\t\treturn Container.get(RedisService);\n\t}\n\tpublic getConfigurationService(): ConfigurationService {\n\t\treturn Container.get(ConfigurationService);\n\t}\n\tpublic getFirebaseService(): FirebaseService {\n\t\treturn Container.get(FirebaseService);\n\t}\n\tpublic getAuthTokenRepository(): TokenRepository {\n\t\treturn Container.get(TokenRepository);\n\t}\n\tpublic getGlobalUploadService(): UploadService {\n\t\treturn new UploadService();\n\t}\n\tpublic getTenetUploadService(): UploadService {\n\t\treturn new UploadService('lyxa-' + this.getConfigurationService().options.tenet);\n\t}\n\tpublic getMapService(): MapService {\n\t\treturn Container.get(MapService);\n\t}\n\tpublic getCachedSettingsService(): CachedSettingsService {\n\t\treturn Container.get(CachedSettingsService);\n\t}\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mCAA4C;AAC5C,qCAAyC;AACzC,qCAAsC;AACtC,6CAAsD;AACtD,uCAAiD;AACjD,mCAAuC;AACvC,mDAAuD;AACvD,qCAAyC;AACzC,yCAA6C;AAC7C,kDAAoD;AACpD,+BAAmC;AAG5B,IAAM,cAAc,GAApB,MAAM,cAAc;IACnB,SAAS;QACf,OAAO,kBAAS,CAAC,GAAG,CAAC,mBAAU,CAAC,CAAC;IAClC,CAAC;IACM,yBAAyB;QAC/B,OAAO,kBAAS,CAAC,GAAG,CAAC,mCAAsB,CAAC,CAAC;IAC9C,CAAC;IACM,gBAAgB;QACtB,OAAO,kBAAS,CAAC,GAAG,CAAC,sBAAa,CAAC,CAAC;IACrC,CAAC;IACM,iBAAiB;QACvB,OAAO,kBAAS,CAAC,GAAG,CAAC,8BAAoB,CAAC,CAAC;IAC5C,CAAC;IACM,eAAe;QACrB,OAAO,kBAAS,CAAC,GAAG,CAAC,oBAAY,CAAC,CAAC;IACpC,CAAC;IACM,uBAAuB;QAC7B,OAAO,kBAAS,CAAC,GAAG,CAAC,oCAAoB,CAAC,CAAC;IAC5C,CAAC;IACM,kBAAkB;QACxB,OAAO,kBAAS,CAAC,GAAG,CAAC,0BAAe,CAAC,CAAC;IACvC,CAAC;IACM,sBAAsB;QAC5B,OAAO,kBAAS,CAAC,GAAG,CAAC,4BAAe,CAAC,CAAC;IACvC,CAAC;IACM,sBAAsB;QAC5B,OAAO,IAAI,sBAAa,EAAE,CAAC;IAC5B,CAAC;IACM,qBAAqB;QAC3B,OAAO,IAAI,sBAAa,CAAC,OAAO,GAAG,IAAI,CAAC,uBAAuB,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClF,CAAC;IACM,aAAa;QACnB,OAAO,kBAAS,CAAC,GAAG,CAAC,gBAAU,CAAC,CAAC;IAClC,CAAC;CACD,CAAA;AAlCY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,gBAAO,GAAE;GACG,cAAc,CAkC1B","sourcesContent":["import { Container, Service } from 'typedi';\nimport { TwilioService } from './twilio';\nimport { LyxaLogger } from './logger';\nimport { MicroServiceDispatcher } from './dispatcher';\nimport { SecretManagerService } from './secrets';\nimport { RedisService } from './redis';\nimport { ConfigurationService } from './configuration';\nimport { UploadService } from './upload';\nimport { FirebaseService } from './firebase';\nimport { TokenRepository } from './auth/repository';\nimport { MapService } from './map';\n\n@Service()\nexport class LibraryManager {\n\tpublic getLogger(): LyxaLogger {\n\t\treturn Container.get(LyxaLogger);\n\t}\n\tpublic getMicroServiceDispatcher(): MicroServiceDispatcher {\n\t\treturn Container.get(MicroServiceDispatcher);\n\t}\n\tpublic getTwilioService(): TwilioService {\n\t\treturn Container.get(TwilioService);\n\t}\n\tpublic getSecretsService(): SecretManagerService {\n\t\treturn Container.get(SecretManagerService);\n\t}\n\tpublic getRedisService(): RedisService {\n\t\treturn Container.get(RedisService);\n\t}\n\tpublic getConfigurationService(): ConfigurationService {\n\t\treturn Container.get(ConfigurationService);\n\t}\n\tpublic getFirebaseService(): FirebaseService {\n\t\treturn Container.get(FirebaseService);\n\t}\n\tpublic getAuthTokenRepository(): TokenRepository {\n\t\treturn Container.get(TokenRepository);\n\t}\n\tpublic getGlobalUploadService(): UploadService {\n\t\treturn new UploadService();\n\t}\n\tpublic getTenetUploadService(): UploadService {\n\t\treturn new UploadService('lyxa-' + this.getConfigurationService().options.tenet);\n\t}\n\tpublic getMapService(): MapService {\n\t\treturn Container.get(MapService);\n\t}\n}\n"]}
@@ -1,43 +1,10 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
2
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
5
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
23
7
  };
24
- var __importStar = (this && this.__importStar) || (function () {
25
- var ownKeys = function(o) {
26
- ownKeys = Object.getOwnPropertyNames || function (o) {
27
- var ar = [];
28
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
- return ar;
30
- };
31
- return ownKeys(o);
32
- };
33
- return function (mod) {
34
- if (mod && mod.__esModule) return mod;
35
- var result = {};
36
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
- __setModuleDefault(result, mod);
38
- return result;
39
- };
40
- })();
41
8
  var __metadata = (this && this.__metadata) || function (k, v) {
42
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
43
10
  };
@@ -46,6 +13,7 @@ exports.CancellationReason = void 0;
46
13
  const typegoose_1 = require("@typegoose/typegoose");
47
14
  const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
48
15
  const enum_1 = require("../../../utilities/enum");
16
+ const _1 = require(".");
49
17
  let CancellationReason = class CancellationReason extends defaultClasses_1.TimeStamps {
50
18
  reason;
51
19
  reasonType;
@@ -54,28 +22,27 @@ let CancellationReason = class CancellationReason extends defaultClasses_1.TimeS
54
22
  };
55
23
  exports.CancellationReason = CancellationReason;
56
24
  __decorate([
57
- (0, typegoose_1.prop)({ required: true }),
25
+ (0, typegoose_1.prop)({ required: true, type: String }),
58
26
  __metadata("design:type", String)
59
27
  ], CancellationReason.prototype, "reason", void 0);
60
28
  __decorate([
61
- (0, typegoose_1.prop)({ required: true, enum: enum_1.CancellationReasonTypeEnum }),
29
+ (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.CancellationReasonTypeEnum }),
62
30
  __metadata("design:type", String)
63
31
  ], CancellationReason.prototype, "reasonType", void 0);
64
32
  __decorate([
65
- (0, typegoose_1.prop)({ required: true, enum: enum_1.SettingsReasonStatus }),
33
+ (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.SettingsReasonStatus }),
66
34
  __metadata("design:type", String)
67
35
  ], CancellationReason.prototype, "status", void 0);
68
36
  __decorate([
69
- (0, typegoose_1.prop)(),
37
+ (0, typegoose_1.prop)({ type: Number }),
70
38
  __metadata("design:type", Number)
71
39
  ], CancellationReason.prototype, "sortingOrder", void 0);
72
40
  exports.CancellationReason = CancellationReason = __decorate([
73
41
  (0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'cancellationReasons' } }),
74
42
  (0, typegoose_1.pre)('save', async function (next) {
75
- try {
76
- const { CancellationReasonModel } = await Promise.resolve().then(() => __importStar(require('.')));
77
- if (this.isNew || typeof this.sortingOrder === 'undefined') {
78
- const [result] = await CancellationReasonModel.aggregate([
43
+ if (this.isNew || typeof this.sortingOrder === 'undefined') {
44
+ try {
45
+ const maxSortingOrder = await _1.CancellationReasonModel.aggregate([
79
46
  {
80
47
  $match: {
81
48
  reasonType: this.reasonType,
@@ -90,13 +57,13 @@ exports.CancellationReason = CancellationReason = __decorate([
90
57
  },
91
58
  },
92
59
  ]).exec();
93
- this.sortingOrder = (result?.maxSortingOrder ?? -1) + 1;
60
+ this.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;
61
+ }
62
+ catch (error) {
63
+ return next(error);
94
64
  }
95
- next();
96
- }
97
- catch (error) {
98
- next(error);
99
65
  }
66
+ next();
100
67
  })
101
68
  ], CancellationReason);
102
69
  //# sourceMappingURL=cancellation-reason.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cancellation-reason.model.js","sourceRoot":"/","sources":["libraries/mongo/models/cancellation-reason.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,kDAGiC;AAiC1B,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,2BAAU;IAEvC,MAAM,CAAU;IAGhB,UAAU,CAA8B;IAGxC,MAAM,CAAwB;IAG9B,YAAY,CAAU;CAChC,CAAA;AAZY,gDAAkB;AAEpB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACF;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,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ultClasses';\nimport {\n SettingsReasonStatus,\n CancellationReasonTypeEnum\n} from '../../../utilities/enum';\n\n@modelOptions({ schemaOptions: { collection: 'cancellationReasons' } })\n@pre<CancellationReason>('save', async function (next) {\n try {\n\n const { CancellationReasonModel } = await import('.');\n\n if (this.isNew || typeof this.sortingOrder === 'undefined') {\n const [result] = await CancellationReasonModel.aggregate<{ maxSortingOrder: number }>([\n {\n $match: {\n reasonType: this.reasonType,\n status: SettingsReasonStatus.ACTIVE,\n deletedAt: null,\n },\n },\n {\n $group: {\n _id: null,\n maxSortingOrder: { $max: '$sortingOrder' },\n },\n },\n ]).exec();\n\n this.sortingOrder = (result?.maxSortingOrder ?? -1) + 1;\n }\n\n next();\n } catch (error) {\n next(error as Error);\n }\n})\nexport class CancellationReason extends TimeStamps {\n @prop({ required: true })\n public reason!: string;\n\n @prop({ required: true, enum: CancellationReasonTypeEnum })\n public reasonType!: CancellationReasonTypeEnum;\n\n @prop({ required: true, enum: SettingsReasonStatus })\n public status!: SettingsReasonStatus;\n\n @prop()\n public sortingOrder?: number;\n}\n"]}
1
+ {"version":3,"file":"cancellation-reason.model.js","sourceRoot":"/","sources":["libraries/mongo/models/cancellation-reason.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,kDAAkH;AAClH,wBAA4C;AAgCrC,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,2BAAU;IAEvC,MAAM,CAAS;IAGf,UAAU,CAA6B;IAGvC,MAAM,CAAuB;IAGhC,YAAY,CAAU;CAC7B,CAAA;AAZY,gDAAkB;AAEpB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iCAA0B,EAAE,CAAC;;sDAC3B;AAGvC;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,2BAAoB,EAAE,CAAC;;kDAC/B;AAGhC;IADH,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wDACG;6BAXjB,kBAAkB;IA9B9B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,qBAAqB,EAAE,EAAE,CAAC;IACtE,IAAA,eAAG,EAAqB,MAAM,EAAE,KAAK,WAAW,IAAI;QAEjD,IAAI,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;YACzD,IAAI,CAAC;gBAED,MAAM,eAAe,GAAG,MAAM,0BAAuB,CAAC,SAAS,CAA8B;oBACzF;wBACI,MAAM,EAAE;4BACJ,UAAU,EAAE,IAAI,CAAC,UAAU;4BAC3B,MAAM,EAAE,2BAAoB,CAAC,MAAM;4BACnC,SAAS,EAAE,IAAI;yBAClB;qBACJ;oBACD;wBACI,MAAM,EAAE;4BACJ,GAAG,EAAE,IAAI;4BACT,eAAe,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;yBAC7C;qBACJ;iBACJ,CAAC,CAAC,IAAI,EAAE,CAAC;gBAGV,IAAI,CAAC,YAAY,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACxE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,OAAO,IAAI,CAAC,KAAc,CAAC,CAAC;YAChC,CAAC;QACL,CAAC;QACD,IAAI,EAAE,CAAC;IACX,CAAC,CAAC;GACW,kBAAkB,CAY9B","sourcesContent":["import { modelOptions, prop, pre } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { SettingsReasonStatus, CancellationReasonTypeEnum, SupportReasonTypeEnum } from '../../../utilities/enum';\nimport { CancellationReasonModel } from '.';\n\n@modelOptions({ schemaOptions: { collection: 'cancellationReasons' } })\n@pre<CancellationReason>('save', async function (next) {\n // Only set sortingOrder if it's a new document or sortingOrder is not set\n if (this.isNew || typeof this.sortingOrder === 'undefined') {\n try {\n // Find the maximum sortingOrder for tags with the same itemType that aren't deleted\n const maxSortingOrder = await CancellationReasonModel.aggregate<{ maxSortingOrder: number }>([\n {\n $match: {\n reasonType: this.reasonType,\n status: SettingsReasonStatus.ACTIVE,\n deletedAt: null,\n },\n },\n {\n $group: {\n _id: null,\n maxSortingOrder: { $max: '$sortingOrder' },\n },\n },\n ]).exec();\n\n // Set the new sortingOrder to max + 1 (or 0 if no items found)\n this.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;\n } catch (error) {\n return next(error as Error);\n }\n }\n next();\n})\nexport class CancellationReason extends TimeStamps {\n @prop({ required: true, type: String })\n public reason: string;\n\n @prop({ required: true, type: String, enum: CancellationReasonTypeEnum })\n public reasonType: CancellationReasonTypeEnum;\n\n @prop({ required: true, type: String, enum: SettingsReasonStatus })\n public status: SettingsReasonStatus;\n\n @prop({ type: Number })\n\tpublic sortingOrder?: number;\n}\n"]}
@@ -1,10 +1,7 @@
1
- import { Ref } from '@typegoose/typegoose';
2
1
  import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
3
2
  import { CouponType } from '../../../utilities/enum';
4
3
  export declare class Coupon extends TimeStamps {
5
4
  code: string;
6
5
  couponType: CouponType;
7
6
  orderLimitPerUser?: number | null;
8
- previousVersions?: Ref<Coupon>[];
9
- updatedVersion?: Ref<Coupon>;
10
7
  }
@@ -17,8 +17,6 @@ let Coupon = class Coupon extends defaultClasses_1.TimeStamps {
17
17
  code;
18
18
  couponType;
19
19
  orderLimitPerUser;
20
- previousVersions;
21
- updatedVersion;
22
20
  };
23
21
  exports.Coupon = Coupon;
24
22
  __decorate([
@@ -33,14 +31,6 @@ __decorate([
33
31
  (0, typegoose_1.prop)({ type: Number, default: null }),
34
32
  __metadata("design:type", Object)
35
33
  ], Coupon.prototype, "orderLimitPerUser", void 0);
36
- __decorate([
37
- (0, typegoose_1.prop)({ ref: () => Coupon }),
38
- __metadata("design:type", Array)
39
- ], Coupon.prototype, "previousVersions", void 0);
40
- __decorate([
41
- (0, typegoose_1.prop)({ ref: () => Coupon }),
42
- __metadata("design:type", Object)
43
- ], Coupon.prototype, "updatedVersion", void 0);
44
34
  exports.Coupon = Coupon = __decorate([
45
35
  (0, typegoose_1.modelOptions)({
46
36
  schemaOptions: { collection: 'coupons', discriminatorKey: 'couponType' },
@@ -1 +1 @@
1
- {"version":3,"file":"coupon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/coupon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,kDAAqD;AAK9C,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,2BAAU;IAE9B,IAAI,CAAU;IAGd,UAAU,CAAc;IAGxB,iBAAiB,CAAiB;IAGlC,gBAAgB,CAAiB;IAGjC,cAAc,CAAe;CACpC,CAAA;AAfY,wBAAM;AAEX;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oCAC/C;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAU,EAAE,CAAC;;0CAC1B;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACG;AAGlC;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;;gDACY;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;;8CACQ;iBAdxB,MAAM;IAHlB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE;KACxE,CAAC;GACW,MAAM,CAelB","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CouponType } from '../../../utilities/enum';\n\n@modelOptions({\n\tschemaOptions: { collection: 'coupons', discriminatorKey: 'couponType' },\n})\nexport class Coupon extends TimeStamps {\n\t@prop({ required: true, uppercase: true, trim: true, type: String })\n\tpublic code!: string;\n\n\t@prop({ required: true, type: String, enum: CouponType })\n\tpublic couponType!: CouponType;\n\n\t@prop({ type: Number, default: null })\n\tpublic orderLimitPerUser?: number | null;\n\n\t@prop({ ref: () => Coupon })\n\tpublic previousVersions?: Ref<Coupon>[];\n\n\t@prop({ ref: () => Coupon })\n\tpublic updatedVersion?: Ref<Coupon>;\n}\n"]}
1
+ {"version":3,"file":"coupon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/coupon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA0D;AAC1D,4EAAqE;AACrE,kDAAqD;AAK9C,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,2BAAU;IAE9B,IAAI,CAAU;IAGd,UAAU,CAAc;IAGxB,iBAAiB,CAAiB;CACzC,CAAA;AATY,wBAAM;AAEX;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oCAC/C;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAU,EAAE,CAAC;;0CAC1B;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACG;iBAR7B,MAAM;IAHlB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE;KACxE,CAAC;GACW,MAAM,CASlB","sourcesContent":["import { modelOptions, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CouponType } from '../../../utilities/enum';\n\n@modelOptions({\n\tschemaOptions: { collection: 'coupons', discriminatorKey: 'couponType' },\n})\nexport class Coupon extends TimeStamps {\n\t@prop({ required: true, uppercase: true, trim: true, type: String })\n\tpublic code!: string;\n\n\t@prop({ required: true, type: String, enum: CouponType })\n\tpublic couponType!: CouponType;\n\n\t@prop({ type: Number, default: null })\n\tpublic orderLimitPerUser?: number | null;\n}\n"]}
@@ -1,9 +1,7 @@
1
1
  import { OrderFinance } from './order-finance.model';
2
2
  import { CourierOrderProfit } from '../embedded/profit.model';
3
3
  import { OrderPricing } from './order-pricing.model';
4
- import { CourierOrderPaymentFrom } from '../../../../utilities/enum';
5
4
  export declare class CourierOrderFinance extends OrderFinance {
6
- paymentFrom?: CourierOrderPaymentFrom;
7
- pricing: OrderPricing;
5
+ pricing?: OrderPricing;
8
6
  companyProfit?: CourierOrderProfit;
9
7
  }
@@ -14,19 +14,13 @@ const typegoose_1 = require("@typegoose/typegoose");
14
14
  const order_finance_model_1 = require("./order-finance.model");
15
15
  const profit_model_1 = require("../embedded/profit.model");
16
16
  const order_pricing_model_1 = require("./order-pricing.model");
17
- const enum_1 = require("../../../../utilities/enum");
18
17
  class CourierOrderFinance extends order_finance_model_1.OrderFinance {
19
- paymentFrom;
20
18
  pricing;
21
19
  companyProfit;
22
20
  }
23
21
  exports.CourierOrderFinance = CourierOrderFinance;
24
22
  __decorate([
25
- (0, typegoose_1.prop)({ type: String, enum: enum_1.CourierOrderPaymentFrom, default: enum_1.CourierOrderPaymentFrom.SENDER }),
26
- __metadata("design:type", String)
27
- ], CourierOrderFinance.prototype, "paymentFrom", void 0);
28
- __decorate([
29
- (0, typegoose_1.prop)({ required: true, type: () => order_pricing_model_1.OrderPricing }),
23
+ (0, typegoose_1.prop)({ type: () => order_pricing_model_1.OrderPricing }),
30
24
  __metadata("design:type", order_pricing_model_1.OrderPricing)
31
25
  ], CourierOrderFinance.prototype, "pricing", void 0);
32
26
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"courier-order-finance.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/courier-order-finance.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,+DAAqD;AACrD,2DAA8D;AAC9D,+DAAqD;AACrD,qDAAqE;AAErE,MAAa,mBAAoB,SAAQ,kCAAY;IAE7C,WAAW,CAA2B;IAGtC,OAAO,CAAe;IAGtB,aAAa,CAAsB;CAC1C;AATD,kDASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,8BAAuB,EAAE,OAAO,EAAE,8BAAuB,CAAC,MAAM,EAAE,CAAC;;wDAClD;AAGtC;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;8BACnC,kCAAY;oDAAC;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,iCAAkB,EAAE,CAAC;8BAClB,iCAAkB;0DAAC","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { OrderFinance } from './order-finance.model';\nimport { CourierOrderProfit } from '../embedded/profit.model';\nimport { OrderPricing } from './order-pricing.model';\nimport { CourierOrderPaymentFrom } from '../../../../utilities/enum';\n\nexport class CourierOrderFinance extends OrderFinance {\n\t@prop({ type: String, enum: CourierOrderPaymentFrom, default: CourierOrderPaymentFrom.SENDER })\n\tpublic paymentFrom?: CourierOrderPaymentFrom;\n\n\t@prop({ required: true, type: () => OrderPricing })\n\tpublic pricing: OrderPricing;\n\n\t@prop({ type: () => CourierOrderProfit })\n\tpublic companyProfit?: CourierOrderProfit;\n}\n"]}
1
+ {"version":3,"file":"courier-order-finance.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/courier-order-finance.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,+DAAqD;AACrD,2DAA8D;AAC9D,+DAAqD;AAErD,MAAa,mBAAoB,SAAQ,kCAAY;IAE7C,OAAO,CAAgB;IAGvB,aAAa,CAAsB;CAC1C;AAND,kDAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;8BAClB,kCAAY;oDAAC;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,iCAAkB,EAAE,CAAC;8BAClB,iCAAkB;0DAAC","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { OrderFinance } from './order-finance.model';\nimport { CourierOrderProfit } from '../embedded/profit.model';\nimport { OrderPricing } from './order-pricing.model';\n\nexport class CourierOrderFinance extends OrderFinance {\n\t@prop({ type: () => OrderPricing })\n\tpublic pricing?: OrderPricing;\n\n\t@prop({ type: () => CourierOrderProfit })\n\tpublic companyProfit?: CourierOrderProfit;\n}\n"]}
@@ -2,12 +2,10 @@ import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
2
2
  import { PaymentInformation } from './payment-infromation.model';
3
3
  import { PaymentMethod } from '../../../../utilities/enum';
4
4
  import { RiderProfit } from './profit.model';
5
- import { CashSettlement } from './cash-settlement.model';
6
5
  export declare class OrderFinance extends TimeStamps {
7
6
  exchangeRate?: number;
8
7
  paymentMethod?: PaymentMethod;
9
8
  paymentInformation?: PaymentInformation;
10
9
  riderProfit?: RiderProfit;
11
- cashSettlement?: CashSettlement;
12
10
  processedAt?: Date;
13
11
  }
@@ -15,13 +15,11 @@ const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
15
15
  const payment_infromation_model_1 = require("./payment-infromation.model");
16
16
  const enum_1 = require("../../../../utilities/enum");
17
17
  const profit_model_1 = require("./profit.model");
18
- const cash_settlement_model_1 = require("./cash-settlement.model");
19
18
  class OrderFinance extends defaultClasses_1.TimeStamps {
20
19
  exchangeRate;
21
20
  paymentMethod;
22
21
  paymentInformation;
23
22
  riderProfit;
24
- cashSettlement;
25
23
  processedAt;
26
24
  }
27
25
  exports.OrderFinance = OrderFinance;
@@ -41,10 +39,6 @@ __decorate([
41
39
  (0, typegoose_1.prop)({ type: () => profit_model_1.RiderProfit }),
42
40
  __metadata("design:type", profit_model_1.RiderProfit)
43
41
  ], OrderFinance.prototype, "riderProfit", void 0);
44
- __decorate([
45
- (0, typegoose_1.prop)({ type: () => cash_settlement_model_1.CashSettlement }),
46
- __metadata("design:type", cash_settlement_model_1.CashSettlement)
47
- ], OrderFinance.prototype, "cashSettlement", void 0);
48
42
  __decorate([
49
43
  (0, typegoose_1.prop)({ type: Date }),
50
44
  __metadata("design:type", Date)
@@ -1 +1 @@
1
- {"version":3,"file":"order-finance.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/order-finance.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,4EAAqE;AACrE,2EAAiE;AACjE,qDAA2D;AAC3D,iDAA6C;AAC7C,mEAAyD;AAEzD,MAAa,YAAa,SAAQ,2BAAU;IAEpC,YAAY,CAAU;IAGtB,aAAa,CAAiB;IAGrC,kBAAkB,CAAsB;IAGjC,WAAW,CAAe;IAG1B,cAAc,CAAkB;IAGhC,WAAW,CAAQ;CAC1B;AAlBD,oCAkBC;AAhBO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;kDACN;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAa,EAAE,OAAO,EAAE,oBAAa,CAAC,IAAI,EAAE,CAAC;;mDACpC;AAGrC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,8CAAkB,EAAE,CAAC;8BACpB,8CAAkB;wDAAC;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,0BAAW,EAAE,CAAC;8BACb,0BAAW;iDAAC;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,sCAAc,EAAE,CAAC;8BACb,sCAAc;oDAAC;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACA,IAAI;iDAAC","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { PaymentInformation } from './payment-infromation.model';\nimport { PaymentMethod } from '../../../../utilities/enum';\nimport { RiderProfit } from './profit.model';\nimport { CashSettlement } from './cash-settlement.model';\n\nexport class OrderFinance extends TimeStamps {\n\t@prop({ type: Number, default: 1 })\n\tpublic exchangeRate?: number;\n\n\t@prop({ type: String, enum: PaymentMethod, default: PaymentMethod.CASH })\n\tpublic paymentMethod?: PaymentMethod;\n\n\t@prop({ type: () => PaymentInformation })\n\tpaymentInformation?: PaymentInformation;\n\n\t@prop({ type: () => RiderProfit })\n\tpublic riderProfit?: RiderProfit;\n\n\t@prop({ type: () => CashSettlement })\n\tpublic cashSettlement?: CashSettlement;\n\n\t@prop({ type: Date })\n\tpublic processedAt?: Date;\n}\n"]}
1
+ {"version":3,"file":"order-finance.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/order-finance.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,4EAAqE;AACrE,2EAAiE;AACjE,qDAA2D;AAC3D,iDAA6C;AAE7C,MAAa,YAAa,SAAQ,2BAAU;IAEpC,YAAY,CAAU;IAGtB,aAAa,CAAiB;IAGrC,kBAAkB,CAAsB;IAGjC,WAAW,CAAe;IAG1B,WAAW,CAAQ;CAC1B;AAfD,oCAeC;AAbO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;kDACN;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAa,EAAE,OAAO,EAAE,oBAAa,CAAC,IAAI,EAAE,CAAC;;mDACpC;AAGrC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,8CAAkB,EAAE,CAAC;8BACpB,8CAAkB;wDAAC;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,0BAAW,EAAE,CAAC;8BACb,0BAAW;iDAAC;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACA,IAAI;iDAAC","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { PaymentInformation } from './payment-infromation.model';\nimport { PaymentMethod } from '../../../../utilities/enum';\nimport { RiderProfit } from './profit.model';\n\nexport class OrderFinance extends TimeStamps {\n\t@prop({ type: Number, default: 1 })\n\tpublic exchangeRate?: number;\n\n\t@prop({ type: String, enum: PaymentMethod, default: PaymentMethod.CASH })\n\tpublic paymentMethod?: PaymentMethod;\n\n\t@prop({ type: () => PaymentInformation })\n\tpaymentInformation?: PaymentInformation;\n\n\t@prop({ type: () => RiderProfit })\n\tpublic riderProfit?: RiderProfit;\n\n\t@prop({ type: Date })\n\tpublic processedAt?: Date;\n}\n"]}
@@ -1,11 +1,11 @@
1
1
  export declare class OrderPricing {
2
- subtotal: number;
2
+ subtotal?: number;
3
3
  secondarySubtotal?: number;
4
- deliveryFee: number;
4
+ deliveryFee?: number;
5
5
  secondaryDeliveryFee?: number;
6
6
  riderTips?: number;
7
7
  secondaryRiderTips?: number;
8
- total: number;
8
+ total?: number;
9
9
  secondaryTotal?: number;
10
10
  wallet?: number;
11
11
  secondaryWallet?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"order-pricing.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/order-pricing.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAE5C,MAAa,YAAY;IAExB,QAAQ,CAAS;IAGjB,iBAAiB,CAAU;IAG3B,WAAW,CAAS;IAGpB,oBAAoB,CAAU;IAG9B,SAAS,CAAU;IAGnB,kBAAkB,CAAU;IAG5B,KAAK,CAAS;IAGd,cAAc,CAAU;IAGxB,MAAM,CAAU;IAGhB,eAAe,CAAU;IAGzB,UAAU,CAAU;IAGpB,mBAAmB,CAAU;CAC7B;AApCD,oCAoCC;AAlCA;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;8CAClB;AAGjB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;uDACR;AAG3B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;iDACf;AAGpB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;0DACL;AAG9B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;+CAChB;AAGnB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;wDACP;AAG5B;IADC,IAAA,gBAAI,EAAC,E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MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;2DACX;AAGxB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oEACF;AAGjC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;mEACH;AAGhC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;4EACM","sourcesContent":["import { prop } from '@typegoose/typegoose';\n\nexport class OrderPricing {\n\t@prop({ type: Number, default: 0 })\n\tsubtotal: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondarySubtotal?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tdeliveryFee: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryDeliveryFee?: number;\n\n\t@prop({ type: Number, default: 0 })\n\triderTips?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryRiderTips?: number;\n\n\t@prop({ type: Number, default: 0 })\n\ttotal: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryTotal?: number;\n\n\t@prop({ type: Number, default: 0 })\n\twallet?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryWallet?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpaidAmount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryPaidAmount?: number;\n}\n\nexport class RegularOrderPricing extends OrderPricing {\n\t@prop({ type: Number, default: 0 })\n\tdiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryDiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tloyaltyPointDiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryLoyaltyPointDiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tcouponDiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryCouponDiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpunchMarketingDiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryPunchMarketingDiscount?: number;\n}\n"]}
1
+ {"version":3,"file":"order-pricing.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/order-pricing.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAE5C,MAAa,YAAY;IAExB,QAAQ,CAAU;IAGlB,iBAAiB,CAAU;IAG3B,WAAW,CAAU;IAGrB,oBAAoB,CAAU;IAG9B,SAAS,CAAU;IAGnB,kBAAkB,CAAU;IAG5B,KAAK,CAAU;IAGf,cAAc,CAAU;IAGxB,MAAM,CAAU;IAGhB,eAAe,CAAU;IAGzB,UAAU,CAAU;IAGpB,mBAAmB,CAAU;CAC7B;AApCD,oCAoCC;AAlCA;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;8CACjB;AAGlB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;uDACR;AAG3B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;iDACd;AAGrB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;0DACL;AAG9B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;+CAChB;AAGnB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;wDACP;AAG5B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;2CACpB;AAGf;IADC,IAA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AAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oEACF;AAGjC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;mEACH;AAGhC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;4EACM","sourcesContent":["import { prop } from '@typegoose/typegoose';\n\nexport class OrderPricing {\n\t@prop({ type: Number, default: 0 })\n\tsubtotal?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondarySubtotal?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tdeliveryFee?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryDeliveryFee?: number;\n\n\t@prop({ type: Number, default: 0 })\n\triderTips?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryRiderTips?: number;\n\n\t@prop({ type: Number, default: 0 })\n\ttotal?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryTotal?: number;\n\n\t@prop({ type: Number, default: 0 })\n\twallet?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryWallet?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpaidAmount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryPaidAmount?: number;\n}\n\nexport class RegularOrderPricing extends OrderPricing {\n\t@prop({ type: Number, default: 0 })\n\tdiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryDiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tloyaltyPointDiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryLoyaltyPointDiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tcouponDiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryCouponDiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpunchMarketingDiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tsecondaryPunchMarketingDiscount?: number;\n}\n"]}
@@ -1,21 +1,7 @@
1
1
  import { Ref } from '@typegoose/typegoose';
2
2
  import { Admin } from '../admin.model';
3
- import { LogUser } from '../../../../utilities/enum';
4
- import { LineItem } from '../line-item.model';
5
3
  export declare class OrderRefund {
6
- logUsers: LogUser[];
7
4
  approvedBy: Ref<Admin>;
8
5
  isFullRefund?: boolean;
9
6
  reason: string;
10
- selectedLineItems?: Ref<LineItem>[];
11
- refundedAmountByShopForItems: number;
12
- secondaryRefundedAmountByShopForItems: number;
13
- refundedAmountByShopForDelivery: number;
14
- secondaryRefundedAmountByShopForDelivery: number;
15
- refundedAmountByCompanyForItems: number;
16
- secondaryRefundedAmountByCompanyForItems: number;
17
- refundedAmountByCompanyForDelivery: number;
18
- secondaryRefundedAmountByCompanyForDelivery: number;
19
- totalRefund: number;
20
- secondaryTotalRefund: number;
21
7
  }
@@ -12,34 +12,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.OrderRefund = void 0;
13
13
  const typegoose_1 = require("@typegoose/typegoose");
14
14
  const admin_model_1 = require("../admin.model");
15
- const enum_1 = require("../../../../utilities/enum");
16
- const line_item_model_1 = require("../line-item.model");
17
15
  class OrderRefund {
18
- logUsers;
19
16
  approvedBy;
20
17
  isFullRefund;
21
18
  reason;
22
- selectedLineItems;
23
- refundedAmountByShopForItems;
24
- secondaryRefundedAmountByShopForItems;
25
- refundedAmountByShopForDelivery;
26
- secondaryRefundedAmountByShopForDelivery;
27
- refundedAmountByCompanyForItems;
28
- secondaryRefundedAmountByCompanyForItems;
29
- refundedAmountByCompanyForDelivery;
30
- secondaryRefundedAmountByCompanyForDelivery;
31
- totalRefund;
32
- secondaryTotalRefund;
33
19
  }
34
20
  exports.OrderRefund = OrderRefund;
35
- __decorate([
36
- (0, typegoose_1.prop)({
37
- type: [String],
38
- enum: enum_1.LogUser,
39
- default: []
40
- }),
41
- __metadata("design:type", Array)
42
- ], OrderRefund.prototype, "logUsers", void 0);
43
21
  __decorate([
44
22
  (0, typegoose_1.prop)({ ref: () => admin_model_1.Admin }),
45
23
  __metadata("design:type", Object)
@@ -52,48 +30,4 @@ __decorate([
52
30
  (0, typegoose_1.prop)({ type: String }),
53
31
  __metadata("design:type", String)
54
32
  ], OrderRefund.prototype, "reason", void 0);
55
- __decorate([
56
- (0, typegoose_1.prop)({ ref: () => line_item_model_1.LineItem, default: [] }),
57
- __metadata("design:type", Array)
58
- ], OrderRefund.prototype, "selectedLineItems", void 0);
59
- __decorate([
60
- (0, typegoose_1.prop)({ type: Number, required: true, default: 0 }),
61
- __metadata("design:type", Number)
62
- ], OrderRefund.prototype, "refundedAmountByShopForItems", void 0);
63
- __decorate([
64
- (0, typegoose_1.prop)({ type: Number, required: true, default: 0 }),
65
- __metadata("design:type", Number)
66
- ], OrderRefund.prototype, "secondaryRefundedAmountByShopForItems", void 0);
67
- __decorate([
68
- (0, typegoose_1.prop)({ type: Number, required: true, default: 0 }),
69
- __metadata("design:type", Number)
70
- ], OrderRefund.prototype, "refundedAmountByShopForDelivery", void 0);
71
- __decorate([
72
- (0, typegoose_1.prop)({ type: Number, required: true, default: 0 }),
73
- __metadata("design:type", Number)
74
- ], OrderRefund.prototype, "secondaryRefundedAmountByShopForDelivery", void 0);
75
- __decorate([
76
- (0, typegoose_1.prop)({ type: Number, required: true, default: 0 }),
77
- __metadata("design:type", Number)
78
- ], OrderRefund.prototype, "refundedAmountByCompanyForItems", void 0);
79
- __decorate([
80
- (0, typegoose_1.prop)({ type: Number, required: true, default: 0 }),
81
- __metadata("design:type", Number)
82
- ], OrderRefund.prototype, "secondaryRefundedAmountByCompanyForItems", void 0);
83
- __decorate([
84
- (0, typegoose_1.prop)({ type: Number, required: true, default: 0 }),
85
- __metadata("design:type", Number)
86
- ], OrderRefund.prototype, "refundedAmountByCompanyForDelivery", void 0);
87
- __decorate([
88
- (0, typegoose_1.prop)({ type: Number, required: true, default: 0 }),
89
- __metadata("design:type", Number)
90
- ], OrderRefund.prototype, "secondaryRefundedAmountByCompanyForDelivery", void 0);
91
- __decorate([
92
- (0, typegoose_1.prop)({ type: Number, required: true, default: 0 }),
93
- __metadata("design:type", Number)
94
- ], OrderRefund.prototype, "totalRefund", void 0);
95
- __decorate([
96
- (0, typegoose_1.prop)({ type: Number, required: true, default: 0 }),
97
- __metadata("design:type", Number)
98
- ], OrderRefund.prototype, "secondaryTotalRefund", void 0);
99
33
  //# sourceMappingURL=order-refund.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"order-refund.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/order-refund.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,gDAAuC;AACvC,qDAAqD;AACrD,wDAA8C;AAE9C,MAAa,WAAW;IAMvB,QAAQ,CAAa;IAGrB,UAAU,CAAa;IAGvB,YAAY,CAAW;IAGvB,MAAM,CAAS;IAGf,iBAAiB,CAAmB;IAGpC,4BAA4B,CAAU;IAGtC,qCAAqC,CAAU;IAG/C,+BAA+B,CAAU;IAGzC,wCAAwC,CAAU;IAGlD,+BAA+B,CAAU;IAGzC,wCAAwC,CAAU;IAGlD,kCAAkC,CAAU;IAG5C,2CAA2C,CAAU;IAGrD,WAAW,CAAU;IAGrB,oBAAoB,CAAU;CAC9B;AAjDD,kCAiDC;AA3CA;IALC,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,cAAO;QACb,OAAO,EAAE,EAAE;KACX,CAAC;;6CACmB;AAGrB;IADC,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;+CACJ;AAGvB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDAChB;AAGvB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CACR;AA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B;AAGrB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;yDACrB","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { Admin } from '../admin.model';\nimport { LogUser } from '../../../../utilities/enum';\nimport { LineItem } from '../line-item.model';\n\nexport class OrderRefund {\n\t@prop({\n\t\ttype: [String],\n\t\tenum: LogUser,\n\t\tdefault: []\n\t})\n\tlogUsers!: LogUser[];\n\n\t@prop({ ref: () => Admin })\n\tapprovedBy: Ref<Admin>;\n\n\t@prop({ type: Boolean, default: true })\n\tisFullRefund?: boolean;\n\n\t@prop({ type: String })\n\treason: string;\n\n\t@prop({ ref: () => LineItem, default: [] })\n\tselectedLineItems?: Ref<LineItem>[];\n\n\t@prop({ type: Number, required: true, default: 0 })\n\trefundedAmountByShopForItems!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\tsecondaryRefundedAmountByShopForItems!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\trefundedAmountByShopForDelivery!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\tsecondaryRefundedAmountByShopForDelivery!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\trefundedAmountByCompanyForItems!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\tsecondaryRefundedAmountByCompanyForItems!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\trefundedAmountByCompanyForDelivery!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\tsecondaryRefundedAmountByCompanyForDelivery!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\ttotalRefund!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\tsecondaryTotalRefund!: number;\n}\n"]}
1
+ {"version":3,"file":"order-refund.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/order-refund.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,gDAAuC;AAEvC,MAAa,WAAW;IAEvB,UAAU,CAAa;IAGvB,YAAY,CAAW;IAGvB,MAAM,CAAS;CACf;AATD,kCASC;AAPA;IADC,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;+CACJ;AAGvB;IADI,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACnB;AAGvB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CACR","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { Admin } from '../admin.model';\n\nexport class OrderRefund {\n\t@prop({ ref: () => Admin })\n\tapprovedBy: Ref<Admin>;\n\n @prop({ type: Boolean, default: true })\n\tisFullRefund?: boolean;\n\n\t@prop({ type: String })\n\treason: string;\n}\n"]}
@@ -4,7 +4,7 @@ import { Vat } from '../embedded/vat.model';
4
4
  import { CouponDetails, LoyaltyPoint, MarketingCut } from '../embedded/marketing-cut.model';
5
5
  import { RegularOrderPricing } from './order-pricing.model';
6
6
  export declare class RegularOrderFinance extends OrderFinance {
7
- pricing: RegularOrderPricing;
7
+ pricing?: RegularOrderPricing;
8
8
  companyProfit?: RegularOrderProfit;
9
9
  shopProfit?: RegularOrderProfit;
10
10
  vat?: Vat;
@@ -31,7 +31,7 @@ class RegularOrderFinance extends order_finance_model_1.OrderFinance {
31
31
  }
32
32
  exports.RegularOrderFinance = RegularOrderFinance;
33
33
  __decorate([
34
- (0, typegoose_1.prop)({ required: true, type: () => order_pricing_model_1.RegularOrderPricing }),
34
+ (0, typegoose_1.prop)({ type: () => order_pricing_model_1.RegularOrderPricing }),
35
35
  __metadata("design:type", order_pricing_model_1.RegularOrderPricing)
36
36
  ], RegularOrderFinance.prototype, "pricing", void 0);
37
37
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"regular-order-finance.model.js","sourceRoot":"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G5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,mCAAa,EAAE,CAAC;8BACpB,mCAAa;mDAAC;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;8BACb,kCAAY;yDAAC;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;8BACT,kCAAY;6DAAC;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;8BACd,kCAAY;wDAAC","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { OrderFinance } from './order-finance.model';\nimport { RegularOrderProfit } from '../embedded/profit.model';\nimport { Vat } from '../embedded/vat.model';\nimport { CouponDetails, LoyaltyPoint, MarketingCut } from '../embedded/marketing-cut.model';\nimport { RegularOrderPricing } from './order-pricing.model';\n\nexport class RegularOrderFinance extends OrderFinance {\n\t@prop({ required: true, type: () => RegularOrderPricing })\n\tpublic pricing: RegularOrderPricing;\n\t\n\t@prop({ type: () => RegularOrderProfit })\n\tpublic companyProfit?: RegularOrderProfit;\n\n\t@prop({ type: () => RegularOrderProfit })\n\tpublic shopProfit?: RegularOrderProfit;\n\n\t@prop({ type: () => Vat })\n\tpublic vat?: Vat;\n\n\t@prop({ type: () => MarketingCut })\n\tpublic discount?: MarketingCut;\n\n\t@prop({ type: () => MarketingCut })\n\tpublic buy1get1?: MarketingCut;\n\n\t@prop({ type: () => LoyaltyPoint })\n\tpublic loyaltyPoint?: LoyaltyPoint;\n\n\t@prop({ type: () => CouponDetails })\n\tpublic coupon?: CouponDetails;\n\n\t@prop({ type: () => MarketingCut })\n\tpublic freeDelivery?: MarketingCut;\n\n\t@prop({ type: () => MarketingCut })\n\tpublic replacementOrder?: MarketingCut;\n\n\t@prop({ type: () => MarketingCut })\n\tpublic endorseLoss?: MarketingCut;\n}\n"]}
1
+ {"version":3,"file":"regular-order-finance.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/regular-order-finance.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,+DAAqD;AACrD,2DAA8D;AAC9D,qDAA4C;AAC5C,yEAA4F;AAC5F,+DAA4D;AAE5D,MAAa,mBAAoB,SAAQ,kCAAY;IAE7C,OAAO,CAAuB;IAG9B,aAAa,CAAsB;IAGnC,UAAU,CAAsB;IAGhC,GAAG,CAAO;IAGV,QAAQ,CAAgB;IAGxB,QAAQ,CAAgB;IAGxB,YAAY,CAAgB;IAG5B,MAAM,CAAiB;IAGvB,YAAY,CAAgB;IAG5B,gBAAgB,CAAgB;IAGhC,WAAW,CAAgB;CAClC;AAjCD,kDAiCC;AA/BO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,yCAAmB,EAAE,CAAC;8BACzB,yCAAmB;oDAAC;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,iCAAkB,EAAE,CAAC;8BAClB,iCAAkB;0DAAC;AAGnC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,iCAAkB,EAAE,CAAC;8BACrB,iCAAkB;uDAAC;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,eAAG,EAAE,CAAC;8BACb,eAAG;gDAAC;AAGV;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;8BACjB,kCAAY;qDAAC;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;8BACjB,kCAAY;qDAAC;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;8BACb,kCAAY;yDAAC;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,mCAAa,EAAE,CAAC;8BACpB,mCAAa;mDAAC;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;8BACb,kCAAY;yDAAC;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;8BACT,kCAAY;6DAAC;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;8BACd,kCAAY;wDAAC","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { OrderFinance } from './order-finance.model';\nimport { RegularOrderProfit } from '../embedded/profit.model';\nimport { Vat } from '../embedded/vat.model';\nimport { CouponDetails, LoyaltyPoint, MarketingCut } from '../embedded/marketing-cut.model';\nimport { RegularOrderPricing } from './order-pricing.model';\n\nexport class RegularOrderFinance extends OrderFinance {\n\t@prop({ type: () => RegularOrderPricing })\n\tpublic pricing?: RegularOrderPricing;\n\t\n\t@prop({ type: () => RegularOrderProfit })\n\tpublic companyProfit?: RegularOrderProfit;\n\n\t@prop({ type: () => RegularOrderProfit })\n\tpublic shopProfit?: RegularOrderProfit;\n\n\t@prop({ type: () => Vat })\n\tpublic vat?: Vat;\n\n\t@prop({ type: () => MarketingCut })\n\tpublic discount?: MarketingCut;\n\n\t@prop({ type: () => MarketingCut })\n\tpublic buy1get1?: MarketingCut;\n\n\t@prop({ type: () => LoyaltyPoint })\n\tpublic loyaltyPoint?: LoyaltyPoint;\n\n\t@prop({ type: () => CouponDetails })\n\tpublic coupon?: CouponDetails;\n\n\t@prop({ type: () => MarketingCut })\n\tpublic freeDelivery?: MarketingCut;\n\n\t@prop({ type: () => MarketingCut })\n\tpublic replacementOrder?: MarketingCut;\n\n\t@prop({ type: () => MarketingCut })\n\tpublic endorseLoss?: MarketingCut;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { Ref, mongoose } from '@typegoose/typegoose';
2
2
  import { Rider } from '../rider.model';
3
- import { FaqAccountType, DeliveryStatus, UserAppSectionItemType } from '../../../../utilities/enum';
3
+ import { FaqAccountType, ItemType, DeliveryStatus } from '../../../../utilities/enum';
4
4
  import { User } from '../user.model';
5
5
  import { Shop } from '../shop.model';
6
6
  import { IDistance, IDuration } from '../../../map/interfaces/IMapService';
@@ -14,7 +14,7 @@ export declare class TripLeg {
14
14
  orders?: mongoose.Types.ObjectId[];
15
15
  user?: Ref<User>;
16
16
  shop?: Ref<Shop>;
17
- shopType?: UserAppSectionItemType;
17
+ shopType?: ItemType;
18
18
  status?: DeliveryStatus;
19
19
  totalDistance?: IDistance;
20
20
  totalDuration?: IDuration;
@@ -79,7 +79,7 @@ __decorate([
79
79
  __decorate([
80
80
  (0, typegoose_1.prop)({
81
81
  type: String,
82
- enum: enum_1.UserAppSectionItemType,
82
+ enum: enum_1.ItemType,
83
83
  }),
84
84
  __metadata("design:type", String)
85
85
  ], TripLeg.prototype, "shopType", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"trip-leg.mode.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/trip-leg.mode.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2D;AAC3D,gDAAuC;AACvC,gDAAuC;AACvC,qDAAoG;AACpG,8CAAqC;AACrC,8CAAqC;AAGrC,MAAa,OAAO;IAEnB,IAAI,CAAU;IAGd,OAAO,CAAU;IAGjB,QAAQ,CAAU;IAGlB,SAAS,CAAU;IAOnB,IAAI,CAAkB;IAGtB,KAAK,CAAc;IAGnB,MAAM,CAA6B;IAGnC,IAAI,CAAa;IAGjB,IAAI,CAAa;IAMjB,QAAQ,CAA0B;IAQlC,MAAM,CAAkB;IAGxB,aAAa,CAAa;IAG1B,aAAa,CAAa;IAG1B,qBAAqB,CA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AAA,gBAAI,GAAE;;8CACmB;AAG1B;IADC,IAAA,gBAAI,GAAE;;8CACmB;AAG1B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;;sDACQ;AAGnC;IADC,IAAA,gBAAI,GAAE;;yCACc;AAGrB;IADC,IAAA,gBAAI,GAAE;;yCACc;AAKrB;IAHC,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;KAChB,CAAC;;iDAC4B","sourcesContent":["import { Ref, prop, mongoose } from '@typegoose/typegoose';\nimport { Order } from '../order.model';\nimport { Rider } from '../rider.model';\nimport { FaqAccountType, DeliveryStatus, UserAppSectionItemType } from '../../../../utilities/enum';\nimport { User } from '../user.model';\nimport { Shop } from '../shop.model';\nimport { IDistance, IDuration } from '../../../map/interfaces/IMapService';\n\nexport class TripLeg {\n\t@prop({ type: String })\n\tname?: string;\n\n\t@prop({ type: String })\n\taddress?: string;\n\n\t@prop({ required: true, type: Number })\n\tlatitude?: number;\n\n\t@prop({ required: true, type: Number })\n\tlongitude?: number;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: FaqAccountType,\n\t\tdefault: FaqAccountType.RIDER,\n\t})\n\ttype?: FaqAccountType;\n\n\t@prop({ ref: () => Rider })\n\trider?: Ref<Rider>;\n\n\t@prop({ ref: () => Order })\n\torders?: mongoose.Types.ObjectId[];\n\n\t@prop({ ref: () => User })\n\tuser?: Ref<User>;\n\n\t@prop({ ref: () => Shop })\n\tshop?: Ref<Shop>;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: UserAppSectionItemType,\n\t})\n\tshopType?: UserAppSectionItemType;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: DeliveryStatus,\n\t\tdefault: DeliveryStatus.PENDING,\n\t\trequired: true,\n\t})\n\tstatus?: DeliveryStatus;\n\n\t@prop()\n\ttotalDistance?: IDistance;\n\n\t@prop()\n\ttotalDuration?: IDuration;\n\n\t@prop({ type: [[Number]] })\n\ttotalOverviewPolyline?: number[][];\n\n\t@prop()\n\tdistance?: IDistance;\n\n\t@prop()\n\tduration?: IDuration;\n\n\t@prop({\n\t\ttype: [[Number]],\n\t})\n\toverviewPolyline?: number[][];\n}\n"]}
1
+ {"version":3,"file":"trip-leg.mode.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/trip-leg.mode.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2D;AAC3D,gDAAuC;AACvC,gDAAuC;AACvC,qDAAsF;AACtF,8CAAqC;AACrC,8CAAqC;AAGrC,MAAa,OAAO;IAEnB,IAAI,CAAU;IAGd,OAAO,CAAU;IAGjB,QAAQ,CAAU;IAGlB,SAAS,CAAU;IAOnB,IAAI,CAAkB;IAGtB,KAAK,CAAc;IAGnB,MAAM,CAA6B;IAGnC,IAAI,CAAa;IAGjB,IAAI,CAAa;IAMjB,QAAQ,CAAY;IAQpB,MAAM,CAAkB;IAGxB,aAAa,CAAa;IAG1B,aAAa,CAAa;IAG1B,qBAAqB,CAAc;IAGnC,QAAQ,CAAa;IAGrB,QAAQ,CAAa;IAKrB,gBAAgB,CAAc;CAC9B;AAjED,0BAiEC;AA/DA;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qCACT;AAGd;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCACN;AAGjB;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCACrB;AAGlB;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CACpB;AAOnB;IALC,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,qBAAc;QACpB,OAAO,EAAE,qBAAc,CAAC,KAAK;KAC7B,CAAC;;qCACoB;AAGtB;IADC,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;sCACR;AAGnB;IADC,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;uCACQ;AAGnC;IADC,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;qCACT;AAGjB;IADC,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;qCACT;AAMjB;IAJC,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,eAAQ;KACd,CAAC;;yCACkB;AAQpB;IANC,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,qBAAc;QACpB,OAAO,EAAE,qBAAc,CAAC,OAAO;QAC/B,QAAQ,EAAE,IAAI;KACd,CAAC;;uCACsB;AAGxB;IADC,IAAA,gBAAI,GAAE;;8CACmB;AAG1B;IADC,IAAA,gBAAI,GAAE;;8CACmB;AAG1B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;;sDACQ;AAGnC;IADC,IAAA,gBAAI,GAAE;;yCACc;AAGrB;IADC,IAAA,gBAAI,GAAE;;yCACc;AAKrB;IAHC,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;KAChB,CAAC;;iDAC4B","sourcesContent":["import { Ref, prop, mongoose } from '@typegoose/typegoose';\nimport { Order } from '../order.model';\nimport { Rider } from '../rider.model';\nimport { FaqAccountType, ItemType, DeliveryStatus } from '../../../../utilities/enum';\nimport { User } from '../user.model';\nimport { Shop } from '../shop.model';\nimport { IDistance, IDuration } from '../../../map/interfaces/IMapService';\n\nexport class TripLeg {\n\t@prop({ type: String })\n\tname?: string;\n\n\t@prop({ type: String })\n\taddress?: string;\n\n\t@prop({ required: true, type: Number })\n\tlatitude?: number;\n\n\t@prop({ required: true, type: Number })\n\tlongitude?: number;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: FaqAccountType,\n\t\tdefault: FaqAccountType.RIDER,\n\t})\n\ttype?: FaqAccountType;\n\n\t@prop({ ref: () => Rider })\n\trider?: Ref<Rider>;\n\n\t@prop({ ref: () => Order })\n\torders?: mongoose.Types.ObjectId[];\n\n\t@prop({ ref: () => User })\n\tuser?: Ref<User>;\n\n\t@prop({ ref: () => Shop })\n\tshop?: Ref<Shop>;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: ItemType,\n\t})\n\tshopType?: ItemType;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: DeliveryStatus,\n\t\tdefault: DeliveryStatus.PENDING,\n\t\trequired: true,\n\t})\n\tstatus?: DeliveryStatus;\n\n\t@prop()\n\ttotalDistance?: IDistance;\n\n\t@prop()\n\ttotalDuration?: IDuration;\n\n\t@prop({ type: [[Number]] })\n\ttotalOverviewPolyline?: number[][];\n\n\t@prop()\n\tdistance?: IDistance;\n\n\t@prop()\n\tduration?: IDuration;\n\n\t@prop({\n\t\ttype: [[Number]],\n\t})\n\toverviewPolyline?: number[][];\n}\n"]}