@lyxa.ai/core 1.0.86 → 1.0.88
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.
- package/dist/libraries/cache/settings/index.d.ts +1 -2
- package/dist/libraries/cache/settings/index.js +2 -4
- package/dist/libraries/cache/settings/index.js.map +1 -1
- package/dist/libraries/index.d.ts +2 -0
- package/dist/libraries/index.js +4 -0
- package/dist/libraries/index.js.map +1 -1
- package/dist/libraries/mongo/models/cancellation-reason.model.js +46 -13
- package/dist/libraries/mongo/models/cancellation-reason.model.js.map +1 -1
- package/dist/libraries/mongo/models/coupon.model.d.ts +3 -0
- package/dist/libraries/mongo/models/coupon.model.js +10 -0
- package/dist/libraries/mongo/models/coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/courier-order-finance.model.d.ts +3 -1
- package/dist/libraries/mongo/models/embedded/courier-order-finance.model.js +7 -1
- package/dist/libraries/mongo/models/embedded/courier-order-finance.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/order-finance.model.d.ts +2 -0
- package/dist/libraries/mongo/models/embedded/order-finance.model.js +6 -0
- package/dist/libraries/mongo/models/embedded/order-finance.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/order-pricing.model.d.ts +3 -3
- package/dist/libraries/mongo/models/embedded/order-pricing.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/order-refund.model.d.ts +14 -0
- package/dist/libraries/mongo/models/embedded/order-refund.model.js +66 -0
- package/dist/libraries/mongo/models/embedded/order-refund.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/regular-order-finance.model.d.ts +1 -1
- package/dist/libraries/mongo/models/embedded/regular-order-finance.model.js +1 -1
- package/dist/libraries/mongo/models/embedded/regular-order-finance.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/trip-leg.mode.d.ts +2 -2
- package/dist/libraries/mongo/models/embedded/trip-leg.mode.js +1 -1
- package/dist/libraries/mongo/models/embedded/trip-leg.mode.js.map +1 -1
- package/dist/libraries/mongo/models/finance-settlement.model.d.ts +4 -0
- package/dist/libraries/mongo/models/finance-settlement.model.js +20 -0
- package/dist/libraries/mongo/models/finance-settlement.model.js.map +1 -1
- package/dist/libraries/mongo/models/index.d.ts +1 -1
- package/dist/libraries/mongo/models/index.js +1 -1
- package/dist/libraries/mongo/models/index.js.map +1 -1
- package/dist/libraries/mongo/models/payout.model.js +24 -2
- package/dist/libraries/mongo/models/payout.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/courier-order.model.d.ts +1 -0
- package/dist/libraries/mongo/models/providers/courier-order.model.js +5 -0
- package/dist/libraries/mongo/models/providers/courier-order.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/individual-store-coupon.model.d.ts +1 -1
- package/dist/libraries/mongo/models/providers/individual-store-coupon.model.js +1 -1
- package/dist/libraries/mongo/models/providers/individual-store-coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/individual-user-coupon.model.d.ts +2 -2
- package/dist/libraries/mongo/models/providers/individual-user-coupon.model.js +2 -2
- package/dist/libraries/mongo/models/providers/individual-user-coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/shared/address.model.d.ts +1 -1
- package/dist/libraries/mongo/models/shared/address.model.js +1 -1
- package/dist/libraries/mongo/models/shared/address.model.js.map +1 -1
- package/dist/libraries/mongo/models/support-reason.model.js +35 -2
- package/dist/libraries/mongo/models/support-reason.model.js.map +1 -1
- package/dist/libraries/mongo/models/user.model.js +1 -1
- package/dist/libraries/mongo/models/user.model.js.map +1 -1
- package/dist/libraries/mongo/plugins/soft-delete-plugin.d.ts +2 -0
- package/dist/libraries/mongo/plugins/soft-delete-plugin.js +11 -0
- package/dist/libraries/mongo/plugins/soft-delete-plugin.js.map +1 -1
- package/dist/utilities/currency.js +5 -4
- package/dist/utilities/currency.js.map +1 -1
- package/dist/utilities/enum.d.ts +13 -4
- package/dist/utilities/enum.js +15 -4
- package/dist/utilities/enum.js.map +1 -1
- package/dist/utilities/validation/common-validation.d.ts +163 -43
- package/dist/utilities/validation/common-validation.js +6 -1
- package/dist/utilities/validation/common-validation.js.map +1 -1
- package/dist/utilities/validation/global-validation.d.ts +2 -1
- package/dist/utilities/validation/global-validation.js +7 -0
- package/dist/utilities/validation/global-validation.js.map +1 -1
- 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.
|
|
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,
|
|
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
|
}
|
package/dist/libraries/index.js
CHANGED
|
@@ -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;
|
|
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,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
|
|
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,
|
|
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,
|
|
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)(
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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 = (
|
|
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":"
|
|
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,EA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,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,
|
|
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
|
-
|
|
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:
|
|
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;
|
|
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;
|
|
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
|
|
2
|
+
subtotal: number;
|
|
3
3
|
secondarySubtotal?: number;
|
|
4
|
-
deliveryFee
|
|
4
|
+
deliveryFee: number;
|
|
5
5
|
secondaryDeliveryFee?: number;
|
|
6
6
|
riderTips?: number;
|
|
7
7
|
secondaryRiderTips?: number;
|
|
8
|
-
total
|
|
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,
|
|
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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EAAE,CAAC;;yDACN;AAG9B,MAAa,mBAAoB,SAAQ,YAAY;IAEpD,QAAQ,CAAU;IAGlB,iBAAiB,CAAU;IAG3B,oBAAoB,CAAU;IAG9B,6BAA6B,CAAU;IAGvC,cAAc,CAAU;IAGxB,uBAAuB,CAAU;IAGjC,sBAAsB,CAAU;IAGhC,+BAA+B,CAAU;CACzC;AAxBD,kDAwBC;AAtBA;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;qDACjB;AAGlB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;8DACR;AAG3B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;iEACL;AAG9B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;0EACI;AAGvC;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,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;
|
|
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;I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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"]}
|
|
@@ -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
|
|
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)({ type: () => order_pricing_model_1.RegularOrderPricing }),
|
|
34
|
+
(0, typegoose_1.prop)({ required: true, 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":"/","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,
|
|
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,CAAsB;IAG7B,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,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,yCAAmB,EAAE,CAAC;8BAC1C,yCAAmB;oDAAC;AAG7B;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({ 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,6 +1,6 @@
|
|
|
1
1
|
import { Ref, mongoose } from '@typegoose/typegoose';
|
|
2
2
|
import { Rider } from '../rider.model';
|
|
3
|
-
import { FaqAccountType,
|
|
3
|
+
import { FaqAccountType, DeliveryStatus, UserAppSectionItemType } 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?:
|
|
17
|
+
shopType?: UserAppSectionItemType;
|
|
18
18
|
status?: DeliveryStatus;
|
|
19
19
|
totalDistance?: IDistance;
|
|
20
20
|
totalDuration?: IDuration;
|
|
@@ -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,
|
|
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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QACZ,IAAI,EAAE,6BAAsB;KAC5B,CAAC;;yCACgC;AAQlC;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, 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"]}
|