@lyxa.ai/core 1.0.86 → 1.0.87

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 +1 -2
  2. package/dist/libraries/cache/settings/index.js +2 -4
  3. package/dist/libraries/cache/settings/index.js.map +1 -1
  4. package/dist/libraries/index.d.ts +2 -0
  5. package/dist/libraries/index.js +4 -0
  6. package/dist/libraries/index.js.map +1 -1
  7. package/dist/libraries/mongo/models/app-screen-setting.model.d.ts +9 -0
  8. package/dist/libraries/mongo/models/app-screen-setting.model.js +72 -0
  9. package/dist/libraries/mongo/models/app-screen-setting.model.js.map +1 -0
  10. package/dist/libraries/mongo/models/cancellation-reason.model.js +46 -13
  11. package/dist/libraries/mongo/models/cancellation-reason.model.js.map +1 -1
  12. package/dist/libraries/mongo/models/coupon.model.d.ts +3 -0
  13. package/dist/libraries/mongo/models/coupon.model.js +10 -0
  14. package/dist/libraries/mongo/models/coupon.model.js.map +1 -1
  15. package/dist/libraries/mongo/models/embedded/courier-order-finance.model.d.ts +3 -1
  16. package/dist/libraries/mongo/models/embedded/courier-order-finance.model.js +7 -1
  17. package/dist/libraries/mongo/models/embedded/courier-order-finance.model.js.map +1 -1
  18. package/dist/libraries/mongo/models/embedded/order-finance.model.d.ts +2 -0
  19. package/dist/libraries/mongo/models/embedded/order-finance.model.js +6 -0
  20. package/dist/libraries/mongo/models/embedded/order-finance.model.js.map +1 -1
  21. package/dist/libraries/mongo/models/embedded/order-pricing.model.d.ts +3 -3
  22. package/dist/libraries/mongo/models/embedded/order-pricing.model.js.map +1 -1
  23. package/dist/libraries/mongo/models/embedded/order-refund.model.d.ts +14 -0
  24. package/dist/libraries/mongo/models/embedded/order-refund.model.js +66 -0
  25. package/dist/libraries/mongo/models/embedded/order-refund.model.js.map +1 -1
  26. package/dist/libraries/mongo/models/embedded/regular-order-finance.model.d.ts +1 -1
  27. package/dist/libraries/mongo/models/embedded/regular-order-finance.model.js +1 -1
  28. package/dist/libraries/mongo/models/embedded/regular-order-finance.model.js.map +1 -1
  29. package/dist/libraries/mongo/models/embedded/trip-leg.mode.d.ts +2 -2
  30. package/dist/libraries/mongo/models/embedded/trip-leg.mode.js +1 -1
  31. package/dist/libraries/mongo/models/embedded/trip-leg.mode.js.map +1 -1
  32. package/dist/libraries/mongo/models/finance-settlement.model.d.ts +4 -0
  33. package/dist/libraries/mongo/models/finance-settlement.model.js +20 -0
  34. package/dist/libraries/mongo/models/finance-settlement.model.js.map +1 -1
  35. package/dist/libraries/mongo/models/index.d.ts +1 -1
  36. package/dist/libraries/mongo/models/index.js +1 -1
  37. package/dist/libraries/mongo/models/index.js.map +1 -1
  38. package/dist/libraries/mongo/models/order-payment.model.d.ts +17 -0
  39. package/dist/libraries/mongo/models/order-payment.model.js +84 -0
  40. package/dist/libraries/mongo/models/order-payment.model.js.map +1 -0
  41. package/dist/libraries/mongo/models/payout.model.js +24 -2
  42. package/dist/libraries/mongo/models/payout.model.js.map +1 -1
  43. package/dist/libraries/mongo/models/providers/courier-order-finance.model.d.ts +7 -0
  44. package/dist/libraries/mongo/models/providers/courier-order-finance.model.js +26 -0
  45. package/dist/libraries/mongo/models/providers/courier-order-finance.model.js.map +1 -0
  46. package/dist/libraries/mongo/models/providers/courier-order.model.d.ts +1 -0
  47. package/dist/libraries/mongo/models/providers/courier-order.model.js +5 -0
  48. package/dist/libraries/mongo/models/providers/courier-order.model.js.map +1 -1
  49. package/dist/libraries/mongo/models/providers/individual-store-coupon.model.d.ts +1 -1
  50. package/dist/libraries/mongo/models/providers/individual-store-coupon.model.js +1 -1
  51. package/dist/libraries/mongo/models/providers/individual-store-coupon.model.js.map +1 -1
  52. package/dist/libraries/mongo/models/providers/individual-user-coupon.model.d.ts +2 -2
  53. package/dist/libraries/mongo/models/providers/individual-user-coupon.model.js +2 -2
  54. package/dist/libraries/mongo/models/providers/individual-user-coupon.model.js.map +1 -1
  55. package/dist/libraries/mongo/models/providers/regular-order-finance.model.d.ts +25 -0
  56. package/dist/libraries/mongo/models/providers/regular-order-finance.model.js +95 -0
  57. package/dist/libraries/mongo/models/providers/regular-order-finance.model.js.map +1 -0
  58. package/dist/libraries/mongo/models/shared/address.model.d.ts +1 -1
  59. package/dist/libraries/mongo/models/shared/address.model.js +1 -1
  60. package/dist/libraries/mongo/models/shared/address.model.js.map +1 -1
  61. package/dist/libraries/mongo/models/support-reason.model.js +35 -2
  62. package/dist/libraries/mongo/models/support-reason.model.js.map +1 -1
  63. package/dist/libraries/mongo/models/user.model.js +1 -1
  64. package/dist/libraries/mongo/models/user.model.js.map +1 -1
  65. package/dist/libraries/mongo/plugins/soft-delete-plugin.d.ts +2 -0
  66. package/dist/libraries/mongo/plugins/soft-delete-plugin.js +11 -0
  67. package/dist/libraries/mongo/plugins/soft-delete-plugin.js.map +1 -1
  68. package/dist/utilities/currency.js +5 -4
  69. package/dist/utilities/currency.js.map +1 -1
  70. package/dist/utilities/enum.d.ts +13 -4
  71. package/dist/utilities/enum.js +15 -4
  72. package/dist/utilities/enum.js.map +1 -1
  73. package/dist/utilities/validation/common-validation.d.ts +120 -0
  74. package/dist/utilities/validation/common-validation.js +6 -1
  75. package/dist/utilities/validation/common-validation.js.map +1 -1
  76. package/package.json +2 -1
@@ -1,8 +1,7 @@
1
1
  import { RedisService } from '../../redis';
2
2
  export declare class CachedSettingsService {
3
- private redisService;
3
+ private readonly 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 = exports.CachedSettingsService = void 0;
15
+ 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,9 +32,8 @@ 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
- }
38
37
  await this.redisService.cacheObject(key, settings);
39
38
  return settings;
40
39
  }
@@ -50,5 +49,4 @@ exports.CachedSettingsService = CachedSettingsService = __decorate([
50
49
  __param(0, (0, typedi_1.Inject)(() => redis_1.RedisService)),
51
50
  __metadata("design:paramtypes", [redis_1.RedisService])
52
51
  ], CachedSettingsService);
53
- exports.cachedSettingsService = typedi_1.Container.get(CachedSettingsService);
54
52
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/cache/settings/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mCAAoD;AACpD,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;IACe;IAAhD,YAAgD,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;IAK9E,KAAK,CAAC,WAAW;QAChB,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;QAG7B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,eAAe,CAAM,GAAG,CAAC,CAAC;QACjE,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;QAG1B,MAAM,QAAQ,GAAG,MAAM,qBAAY,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC;QAE9D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACvC,CAAC;QAGD,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAEnD,OAAO,QAAQ,CAAC;IACjB,CAAC;IAKD,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;AAlCY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,gBAAO,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"]}
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"]}
@@ -8,6 +8,7 @@ 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';
11
12
  export declare class LibraryManager {
12
13
  getLogger(): LyxaLogger;
13
14
  getMicroServiceDispatcher(): MicroServiceDispatcher;
@@ -20,4 +21,5 @@ export declare class LibraryManager {
20
21
  getGlobalUploadService(): UploadService;
21
22
  getTenetUploadService(): UploadService;
22
23
  getMapService(): MapService;
24
+ getCachedSettingsService(): CachedSettingsService;
23
25
  }
@@ -18,6 +18,7 @@ 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");
21
22
  let LibraryManager = class LibraryManager {
22
23
  getLogger() {
23
24
  return typedi_1.Container.get(logger_1.LyxaLogger);
@@ -52,6 +53,9 @@ let LibraryManager = class LibraryManager {
52
53
  getMapService() {
53
54
  return typedi_1.Container.get(map_1.MapService);
54
55
  }
56
+ getCachedSettingsService() {
57
+ return typedi_1.Container.get(settings_1.CachedSettingsService);
58
+ }
55
59
  };
56
60
  exports.LibraryManager = LibraryManager;
57
61
  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;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
+ {"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"]}
@@ -0,0 +1,9 @@
1
+ import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
2
+ import { ItemType, SectionType, Status } from '../../../utilities/enum';
3
+ export declare class AppScreenSetting extends TimeStamps {
4
+ itemType: ItemType;
5
+ section: SectionType;
6
+ alias: string;
7
+ status?: Status;
8
+ sortingOrder?: number;
9
+ }
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AppScreenSetting = void 0;
13
+ const typegoose_1 = require("@typegoose/typegoose");
14
+ const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
15
+ const enum_1 = require("../../../utilities/enum");
16
+ const _1 = require(".");
17
+ let AppScreenSetting = class AppScreenSetting extends defaultClasses_1.TimeStamps {
18
+ itemType;
19
+ section;
20
+ alias;
21
+ status;
22
+ sortingOrder;
23
+ };
24
+ exports.AppScreenSetting = AppScreenSetting;
25
+ __decorate([
26
+ (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ItemType }),
27
+ __metadata("design:type", String)
28
+ ], AppScreenSetting.prototype, "itemType", void 0);
29
+ __decorate([
30
+ (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.SectionType }),
31
+ __metadata("design:type", String)
32
+ ], AppScreenSetting.prototype, "section", void 0);
33
+ __decorate([
34
+ (0, typegoose_1.prop)({ required: true, type: String }),
35
+ __metadata("design:type", String)
36
+ ], AppScreenSetting.prototype, "alias", void 0);
37
+ __decorate([
38
+ (0, typegoose_1.prop)({ type: String, enum: enum_1.Status, default: enum_1.Status.ACTIVE }),
39
+ __metadata("design:type", String)
40
+ ], AppScreenSetting.prototype, "status", void 0);
41
+ __decorate([
42
+ (0, typegoose_1.prop)({ type: Number }),
43
+ __metadata("design:type", Number)
44
+ ], AppScreenSetting.prototype, "sortingOrder", void 0);
45
+ exports.AppScreenSetting = AppScreenSetting = __decorate([
46
+ (0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'appScreenSettings' } }),
47
+ (0, typegoose_1.pre)('save', async function (next) {
48
+ if (this.isNew || typeof this.sortingOrder === 'undefined') {
49
+ try {
50
+ const maxSortingOrder = await _1.AppScreenSettingModel.aggregate([
51
+ {
52
+ $match: {
53
+ deletedAt: null,
54
+ },
55
+ },
56
+ {
57
+ $group: {
58
+ _id: null,
59
+ maxSortingOrder: { $max: '$sortingOrder' },
60
+ },
61
+ },
62
+ ]).exec();
63
+ this.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;
64
+ }
65
+ catch (error) {
66
+ return next(error);
67
+ }
68
+ }
69
+ next();
70
+ })
71
+ ], AppScreenSetting);
72
+ //# sourceMappingURL=app-screen-setting.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-screen-setting.model.js","sourceRoot":"/","sources":["libraries/mongo/models/app-screen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oBACD;wBACC,MAAM,EAAE;4BACP,GAAG,EAAE,IAAI;4BACT,eAAe,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;yBAC1C;qBACD;iBACD,CAAC,CAAC,IAAI,EAAE,CAAC;gBAGV,IAAI,CAAC,YAAY,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACrE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,IAAI,CAAC,KAAc,CAAC,CAAC;YAC7B,CAAC;QACF,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,gBAAgB,CAe5B","sourcesContent":["import { modelOptions, pre, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ItemType, SectionType, Status } from '../../../utilities/enum';\nimport { AppScreenSettingModel } from '.';\n\n@modelOptions({ schemaOptions: { collection: 'appScreenSettings' } })\n@pre<AppScreenSetting>('save', async function (next) {\n\t// Only set sortingOrder if it's a new document or sortingOrder is not set\n\tif (this.isNew || typeof this.sortingOrder === 'undefined') {\n\t\ttry {\n\t\t\t// Find the maximum sortingOrder that aren't deleted\n\t\t\tconst maxSortingOrder = await AppScreenSettingModel.aggregate<{ maxSortingOrder: number }>([\n\t\t\t\t{\n\t\t\t\t\t$match: {\n\t\t\t\t\t\tdeletedAt: null,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t$group: {\n\t\t\t\t\t\t_id: null,\n\t\t\t\t\t\tmaxSortingOrder: { $max: '$sortingOrder' },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]).exec();\n\n\t\t\t// Set the new sortingOrder to max + 1 (or 0 if no items found)\n\t\t\tthis.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;\n\t\t} catch (error) {\n\t\t\treturn next(error as Error);\n\t\t}\n\t}\n\tnext();\n})\nexport class AppScreenSetting extends TimeStamps {\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ required: true, type: String, enum: SectionType })\n\tpublic section!: SectionType;\n\n\t@prop({ required: true, type: String })\n\tpublic alias!: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n}\n"]}
@@ -1,10 +1,43 @@
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
+ });
2
18
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
19
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
20
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
21
  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;
6
22
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
23
  };
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
+ })();
8
41
  var __metadata = (this && this.__metadata) || function (k, v) {
9
42
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
43
  };
@@ -13,7 +46,6 @@ exports.CancellationReason = void 0;
13
46
  const typegoose_1 = require("@typegoose/typegoose");
14
47
  const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
15
48
  const enum_1 = require("../../../utilities/enum");
16
- const _1 = require(".");
17
49
  let CancellationReason = class CancellationReason extends defaultClasses_1.TimeStamps {
18
50
  reason;
19
51
  reasonType;
@@ -22,27 +54,28 @@ let CancellationReason = class CancellationReason extends defaultClasses_1.TimeS
22
54
  };
23
55
  exports.CancellationReason = CancellationReason;
24
56
  __decorate([
25
- (0, typegoose_1.prop)({ required: true, type: String }),
57
+ (0, typegoose_1.prop)({ required: true }),
26
58
  __metadata("design:type", String)
27
59
  ], CancellationReason.prototype, "reason", void 0);
28
60
  __decorate([
29
- (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.CancellationReasonTypeEnum }),
61
+ (0, typegoose_1.prop)({ required: true, enum: enum_1.CancellationReasonTypeEnum }),
30
62
  __metadata("design:type", String)
31
63
  ], CancellationReason.prototype, "reasonType", void 0);
32
64
  __decorate([
33
- (0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.SettingsReasonStatus }),
65
+ (0, typegoose_1.prop)({ required: true, enum: enum_1.SettingsReasonStatus }),
34
66
  __metadata("design:type", String)
35
67
  ], CancellationReason.prototype, "status", void 0);
36
68
  __decorate([
37
- (0, typegoose_1.prop)({ type: Number }),
69
+ (0, typegoose_1.prop)(),
38
70
  __metadata("design:type", Number)
39
71
  ], CancellationReason.prototype, "sortingOrder", void 0);
40
72
  exports.CancellationReason = CancellationReason = __decorate([
41
73
  (0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'cancellationReasons' } }),
42
74
  (0, typegoose_1.pre)('save', async function (next) {
43
- if (this.isNew || typeof this.sortingOrder === 'undefined') {
44
- try {
45
- const maxSortingOrder = await _1.CancellationReasonModel.aggregate([
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([
46
79
  {
47
80
  $match: {
48
81
  reasonType: this.reasonType,
@@ -57,13 +90,13 @@ exports.CancellationReason = CancellationReason = __decorate([
57
90
  },
58
91
  },
59
92
  ]).exec();
60
- this.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;
61
- }
62
- catch (error) {
63
- return next(error);
93
+ this.sortingOrder = (result?.maxSortingOrder ?? -1) + 1;
64
94
  }
95
+ next();
96
+ }
97
+ catch (error) {
98
+ next(error);
65
99
  }
66
- next();
67
100
  })
68
101
  ], CancellationReason);
69
102
  //# 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,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,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egoose';\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
+ {"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,gBA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GACW,kBAAkB,CAY9B","sourcesContent":["import { modelOptions, prop, pre } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\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,7 +1,10 @@
1
+ import { Ref } from '@typegoose/typegoose';
1
2
  import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
2
3
  import { CouponType } from '../../../utilities/enum';
3
4
  export declare class Coupon extends TimeStamps {
4
5
  code: string;
5
6
  couponType: CouponType;
6
7
  orderLimitPerUser?: number | null;
8
+ previousVersions?: Ref<Coupon>[];
9
+ updatedVersion?: Ref<Coupon>;
7
10
  }
@@ -17,6 +17,8 @@ let Coupon = class Coupon extends defaultClasses_1.TimeStamps {
17
17
  code;
18
18
  couponType;
19
19
  orderLimitPerUser;
20
+ previousVersions;
21
+ updatedVersion;
20
22
  };
21
23
  exports.Coupon = Coupon;
22
24
  __decorate([
@@ -31,6 +33,14 @@ __decorate([
31
33
  (0, typegoose_1.prop)({ type: Number, default: null }),
32
34
  __metadata("design:type", Object)
33
35
  ], 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);
34
44
  exports.Coupon = Coupon = __decorate([
35
45
  (0, typegoose_1.modelOptions)({
36
46
  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,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
+ {"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,7 +1,9 @@
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';
4
5
  export declare class CourierOrderFinance extends OrderFinance {
5
- pricing?: OrderPricing;
6
+ paymentFrom?: CourierOrderPaymentFrom;
7
+ pricing: OrderPricing;
6
8
  companyProfit?: CourierOrderProfit;
7
9
  }
@@ -14,13 +14,19 @@ 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");
17
18
  class CourierOrderFinance extends order_finance_model_1.OrderFinance {
19
+ paymentFrom;
18
20
  pricing;
19
21
  companyProfit;
20
22
  }
21
23
  exports.CourierOrderFinance = CourierOrderFinance;
22
24
  __decorate([
23
- (0, typegoose_1.prop)({ type: () => order_pricing_model_1.OrderPricing }),
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 }),
24
30
  __metadata("design:type", order_pricing_model_1.OrderPricing)
25
31
  ], CourierOrderFinance.prototype, "pricing", void 0);
26
32
  __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;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"]}
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"]}
@@ -2,10 +2,12 @@ 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';
5
6
  export declare class OrderFinance extends TimeStamps {
6
7
  exchangeRate?: number;
7
8
  paymentMethod?: PaymentMethod;
8
9
  paymentInformation?: PaymentInformation;
9
10
  riderProfit?: RiderProfit;
11
+ cashSettlement?: CashSettlement;
10
12
  processedAt?: Date;
11
13
  }
@@ -15,11 +15,13 @@ 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");
18
19
  class OrderFinance extends defaultClasses_1.TimeStamps {
19
20
  exchangeRate;
20
21
  paymentMethod;
21
22
  paymentInformation;
22
23
  riderProfit;
24
+ cashSettlement;
23
25
  processedAt;
24
26
  }
25
27
  exports.OrderFinance = OrderFinance;
@@ -39,6 +41,10 @@ __decorate([
39
41
  (0, typegoose_1.prop)({ type: () => profit_model_1.RiderProfit }),
40
42
  __metadata("design:type", profit_model_1.RiderProfit)
41
43
  ], 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);
42
48
  __decorate([
43
49
  (0, typegoose_1.prop)({ type: Date }),
44
50
  __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;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
+ {"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,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,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,CA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;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,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,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,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,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,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,7 +1,21 @@
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';
3
5
  export declare class OrderRefund {
6
+ logUsers: LogUser[];
4
7
  approvedBy: Ref<Admin>;
5
8
  isFullRefund?: boolean;
6
9
  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;
7
21
  }
@@ -12,12 +12,34 @@ 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");
15
17
  class OrderRefund {
18
+ logUsers;
16
19
  approvedBy;
17
20
  isFullRefund;
18
21
  reason;
22
+ selectedLineItems;
23
+ refundedAmountByShopForItems;
24
+ secondaryRefundedAmountByShopForItems;
25
+ refundedAmountByShopForDelivery;
26
+ secondaryRefundedAmountByShopForDelivery;
27
+ refundedAmountByCompanyForItems;
28
+ secondaryRefundedAmountByCompanyForItems;
29
+ refundedAmountByCompanyForDelivery;
30
+ secondaryRefundedAmountByCompanyForDelivery;
31
+ totalRefund;
32
+ secondaryTotalRefund;
19
33
  }
20
34
  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);
21
43
  __decorate([
22
44
  (0, typegoose_1.prop)({ ref: () => admin_model_1.Admin }),
23
45
  __metadata("design:type", Object)
@@ -30,4 +52,48 @@ __decorate([
30
52
  (0, typegoose_1.prop)({ type: String }),
31
53
  __metadata("design:type", String)
32
54
  ], 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);
33
99
  //# 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;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"]}
1
+ {"version":3,"file":"order-refund.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/order-refund.model.ts"],"names":[],"mappings":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,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oEACV;AAGzC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;6EACD;AAGlD;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oEACV;AAGzC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;6EACD;AAGlD;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;uEACP;AAG5C;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;gFACE;AAGrD;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;gDAC9B;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"]}