@lyxa.ai/core 1.3.45 → 1.3.47
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/mongo/models/embedded/address-change-history.model.d.ts +25 -0
- package/dist/libraries/mongo/models/embedded/address-change-history.model.js +112 -0
- package/dist/libraries/mongo/models/embedded/address-change-history.model.js.map +1 -0
- package/dist/libraries/mongo/models/order.model.d.ts +1 -0
- package/dist/libraries/mongo/models/order.model.js +5 -0
- package/dist/libraries/mongo/models/order.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/courier-order.model.d.ts +2 -0
- package/dist/libraries/mongo/models/providers/courier-order.model.js +6 -0
- package/dist/libraries/mongo/models/providers/courier-order.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/regular-order.model.d.ts +2 -0
- package/dist/libraries/mongo/models/providers/regular-order.model.js +6 -0
- package/dist/libraries/mongo/models/providers/regular-order.model.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Ref } from '@typegoose/typegoose';
|
|
2
|
+
import { CourierAddress, RegularOrderAddress } from '../shared/address.model';
|
|
3
|
+
import { Admin } from '../admin.model';
|
|
4
|
+
export declare class RegularOrderAddressChangeHistory {
|
|
5
|
+
timestamp?: Date;
|
|
6
|
+
updatedBy?: Ref<Admin>;
|
|
7
|
+
oldAddress: RegularOrderAddress;
|
|
8
|
+
newAddress: RegularOrderAddress;
|
|
9
|
+
oldFee: number;
|
|
10
|
+
secondaryOldFee: number;
|
|
11
|
+
newFee: number;
|
|
12
|
+
secondaryNewFee: number;
|
|
13
|
+
}
|
|
14
|
+
export declare class CourierOrderAddressChangeHistory {
|
|
15
|
+
timestamp?: Date;
|
|
16
|
+
updatedBy?: Ref<Admin>;
|
|
17
|
+
oldPickupAddress: CourierAddress;
|
|
18
|
+
newPickupAddress: CourierAddress;
|
|
19
|
+
oldDeliveryAddress: CourierAddress;
|
|
20
|
+
newDeliveryAddress: CourierAddress;
|
|
21
|
+
oldFee: number;
|
|
22
|
+
secondaryOldFee: number;
|
|
23
|
+
newFee: number;
|
|
24
|
+
secondaryNewFee: number;
|
|
25
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
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.CourierOrderAddressChangeHistory = exports.RegularOrderAddressChangeHistory = void 0;
|
|
13
|
+
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
|
+
const address_model_1 = require("../shared/address.model");
|
|
15
|
+
const admin_model_1 = require("../admin.model");
|
|
16
|
+
class RegularOrderAddressChangeHistory {
|
|
17
|
+
timestamp;
|
|
18
|
+
updatedBy;
|
|
19
|
+
oldAddress;
|
|
20
|
+
newAddress;
|
|
21
|
+
oldFee;
|
|
22
|
+
secondaryOldFee;
|
|
23
|
+
newFee;
|
|
24
|
+
secondaryNewFee;
|
|
25
|
+
}
|
|
26
|
+
exports.RegularOrderAddressChangeHistory = RegularOrderAddressChangeHistory;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typegoose_1.prop)({ type: Date, default: new Date() }),
|
|
29
|
+
__metadata("design:type", Date)
|
|
30
|
+
], RegularOrderAddressChangeHistory.prototype, "timestamp", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typegoose_1.prop)({ ref: () => admin_model_1.Admin }),
|
|
33
|
+
__metadata("design:type", Object)
|
|
34
|
+
], RegularOrderAddressChangeHistory.prototype, "updatedBy", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typegoose_1.prop)({ required: true, type: address_model_1.RegularOrderAddress }),
|
|
37
|
+
__metadata("design:type", address_model_1.RegularOrderAddress)
|
|
38
|
+
], RegularOrderAddressChangeHistory.prototype, "oldAddress", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typegoose_1.prop)({ required: true, type: address_model_1.RegularOrderAddress }),
|
|
41
|
+
__metadata("design:type", address_model_1.RegularOrderAddress)
|
|
42
|
+
], RegularOrderAddressChangeHistory.prototype, "newAddress", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typegoose_1.prop)({ required: true, type: Number }),
|
|
45
|
+
__metadata("design:type", Number)
|
|
46
|
+
], RegularOrderAddressChangeHistory.prototype, "oldFee", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typegoose_1.prop)({ required: true, type: Number }),
|
|
49
|
+
__metadata("design:type", Number)
|
|
50
|
+
], RegularOrderAddressChangeHistory.prototype, "secondaryOldFee", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typegoose_1.prop)({ required: true, type: Number }),
|
|
53
|
+
__metadata("design:type", Number)
|
|
54
|
+
], RegularOrderAddressChangeHistory.prototype, "newFee", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typegoose_1.prop)({ required: true, type: Number }),
|
|
57
|
+
__metadata("design:type", Number)
|
|
58
|
+
], RegularOrderAddressChangeHistory.prototype, "secondaryNewFee", void 0);
|
|
59
|
+
class CourierOrderAddressChangeHistory {
|
|
60
|
+
timestamp;
|
|
61
|
+
updatedBy;
|
|
62
|
+
oldPickupAddress;
|
|
63
|
+
newPickupAddress;
|
|
64
|
+
oldDeliveryAddress;
|
|
65
|
+
newDeliveryAddress;
|
|
66
|
+
oldFee;
|
|
67
|
+
secondaryOldFee;
|
|
68
|
+
newFee;
|
|
69
|
+
secondaryNewFee;
|
|
70
|
+
}
|
|
71
|
+
exports.CourierOrderAddressChangeHistory = CourierOrderAddressChangeHistory;
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typegoose_1.prop)({ type: Date, default: new Date() }),
|
|
74
|
+
__metadata("design:type", Date)
|
|
75
|
+
], CourierOrderAddressChangeHistory.prototype, "timestamp", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typegoose_1.prop)({ ref: () => admin_model_1.Admin }),
|
|
78
|
+
__metadata("design:type", Object)
|
|
79
|
+
], CourierOrderAddressChangeHistory.prototype, "updatedBy", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typegoose_1.prop)({ type: address_model_1.CourierAddress }),
|
|
82
|
+
__metadata("design:type", address_model_1.CourierAddress)
|
|
83
|
+
], CourierOrderAddressChangeHistory.prototype, "oldPickupAddress", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, typegoose_1.prop)({ type: address_model_1.CourierAddress }),
|
|
86
|
+
__metadata("design:type", address_model_1.CourierAddress)
|
|
87
|
+
], CourierOrderAddressChangeHistory.prototype, "newPickupAddress", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, typegoose_1.prop)({ type: address_model_1.CourierAddress }),
|
|
90
|
+
__metadata("design:type", address_model_1.CourierAddress)
|
|
91
|
+
], CourierOrderAddressChangeHistory.prototype, "oldDeliveryAddress", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typegoose_1.prop)({ type: address_model_1.CourierAddress }),
|
|
94
|
+
__metadata("design:type", address_model_1.CourierAddress)
|
|
95
|
+
], CourierOrderAddressChangeHistory.prototype, "newDeliveryAddress", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, typegoose_1.prop)({ required: true, type: Number }),
|
|
98
|
+
__metadata("design:type", Number)
|
|
99
|
+
], CourierOrderAddressChangeHistory.prototype, "oldFee", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, typegoose_1.prop)({ required: true, type: Number }),
|
|
102
|
+
__metadata("design:type", Number)
|
|
103
|
+
], CourierOrderAddressChangeHistory.prototype, "secondaryOldFee", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typegoose_1.prop)({ required: true, type: Number }),
|
|
106
|
+
__metadata("design:type", Number)
|
|
107
|
+
], CourierOrderAddressChangeHistory.prototype, "newFee", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, typegoose_1.prop)({ required: true, type: Number }),
|
|
110
|
+
__metadata("design:type", Number)
|
|
111
|
+
], CourierOrderAddressChangeHistory.prototype, "secondaryNewFee", void 0);
|
|
112
|
+
//# sourceMappingURL=address-change-history.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address-change-history.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/address-change-history.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,2DAA8E;AAC9E,gDAAuC;AAEvC,MAAa,gCAAgC;IAErC,SAAS,CAAQ;IAGjB,SAAS,CAAc;IAGvB,UAAU,CAAsB;IAGhC,UAAU,CAAsB;IAGhC,MAAM,CAAS;IAGf,eAAe,CAAS;IAGxB,MAAM,CAAS;IAGf,eAAe,CAAS;CAC/B;AAxBD,4EAwBC;AAtBO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC;8BACvB,IAAI;mEAAC;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;mEACG;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,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AC;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,8BAAc,EAAE,CAAC;8BACJ,8BAAc;4EAAC;AAGnC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,8BAAc,EAAE,CAAC;8BACJ,8BAAc;4EAAC;AAGnC;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gEACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yEACR;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gEACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yEACR","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { CourierAddress, RegularOrderAddress } from '../shared/address.model';\nimport { Admin } from '../admin.model';\n\nexport class RegularOrderAddressChangeHistory {\n\t@prop({ type: Date, default: new Date() })\n\tpublic timestamp?: Date;\n\n\t@prop({ ref: () => Admin })\n\tpublic updatedBy?: Ref<Admin>;\n\n\t@prop({ required: true, type: RegularOrderAddress })\n\tpublic oldAddress: RegularOrderAddress;\n\n\t@prop({ required: true, type: RegularOrderAddress })\n\tpublic newAddress: RegularOrderAddress;\n\n\t@prop({ required: true, type: Number })\n\tpublic oldFee: number;\n\n\t@prop({ required: true, type: Number })\n\tpublic secondaryOldFee: number;\n\n\t@prop({ required: true, type: Number })\n\tpublic newFee: number;\n\n\t@prop({ required: true, type: Number })\n\tpublic secondaryNewFee: number;\n}\n\nexport class CourierOrderAddressChangeHistory {\n\t@prop({ type: Date, default: new Date() })\n\tpublic timestamp?: Date;\n\n\t@prop({ ref: () => Admin })\n\tpublic updatedBy?: Ref<Admin>;\n\n\t@prop({ type: CourierAddress })\n\tpublic oldPickupAddress: CourierAddress;\n\n\t@prop({ type: CourierAddress })\n\tpublic newPickupAddress: CourierAddress;\n\n\t@prop({ type: CourierAddress })\n\tpublic oldDeliveryAddress: CourierAddress;\n\n\t@prop({ type: CourierAddress })\n\tpublic newDeliveryAddress: CourierAddress;\n\n\t@prop({ required: true, type: Number })\n\tpublic oldFee: number;\n\n\t@prop({ required: true, type: Number })\n\tpublic secondaryOldFee: number;\n\n\t@prop({ required: true, type: Number })\n\tpublic newFee: number;\n\n\t@prop({ required: true, type: Number })\n\tpublic secondaryNewFee: number;\n}\n"]}
|
|
@@ -75,6 +75,7 @@ let Order = class Order extends defaultClasses_1.TimeStamps {
|
|
|
75
75
|
tripSummary;
|
|
76
76
|
image;
|
|
77
77
|
chatrooms;
|
|
78
|
+
hasChatroom;
|
|
78
79
|
};
|
|
79
80
|
exports.Order = Order;
|
|
80
81
|
__decorate([
|
|
@@ -275,6 +276,10 @@ __decorate([
|
|
|
275
276
|
}),
|
|
276
277
|
__metadata("design:type", Array)
|
|
277
278
|
], Order.prototype, "chatrooms", void 0);
|
|
279
|
+
__decorate([
|
|
280
|
+
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
281
|
+
__metadata("design:type", Boolean)
|
|
282
|
+
], Order.prototype, "hasChatroom", void 0);
|
|
278
283
|
exports.Order = Order = __decorate([
|
|
279
284
|
(0, typegoose_1.modelOptions)({
|
|
280
285
|
schemaOptions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order.model.js","sourceRoot":"/","sources":["libraries/mongo/models/order.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAqF;AACrF,4EAAqE;AACrE,kDAMiC;AACjC,sEAA4D;AAC5D,+CAAsC;AACtC,kGAAqF;AACrF,8EAAoE;AACpE,6CAAoC;AACpC,iDAAwC;AACxC,4DAAmD;AACnD,wBAAiC;AAEjC,kDAAuD;AACvD,kDAA0B;AAC1B,2DAAm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AAE,WAAW,EAAE,kBAAW,CAAC,KAAK,EAAE,EAClC;gBACC;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE;4BACN,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;yBAC/D;wBACD,KAAK,EAAE,KAAK;qBACZ;iBACD;aACD,EACD,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAC3B,CAAC;YAEF,IAAI,CAAC,OAAO,GAAG,GAAG,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;QACvE,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,KAAK,CA4JjB","sourcesContent":["import { index, modelOptions, pre, prop, Ref, Severity } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport {\n\tCounterType,\n\tFlagReasonType,\n\tFlagType,\n\tOrderType,\n\tUrgentOrderReasons,\n} from '../../../utilities/enum';\nimport { OrderCancel } from './embedded/order-cancel.model';\nimport { Rider } from './rider.model';\nimport { DeliveryFeeInformation } from './embedded/order-delivery-information.model';\nimport { RiderAssignment } from './embedded/rider-assignment-model';\nimport { Flag } from './flag.model';\nimport { Review } from './review.model';\nimport { TripLeg } from './embedded/trip-leg.mode';\nimport { CounterModel } from '.';\nimport { Chatroom } from './chat-room.model';\nimport { LyxaTimezone } from '../../../utilities/time';\nimport dayjs from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\nimport timezone from 'dayjs/plugin/timezone';\n\ndayjs.extend(utc);\ndayjs.extend(timezone);\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'orders',\n\t\tdiscriminatorKey: 'orderType',\n\t\ttoJSON: { virtuals: true },\n\t\ttoObject: { virtuals: true },\n\t},\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@index({ 'deliveryAddress.location': '2dsphere' })\n@index({ user: 1, status: 1, processedAt: -1 })\n@index({ shop: 1, status: 1, processedAt: -1 })\n@index({ parent: 1, status: 1, processedAt: -1 })\n@index({ orderType: 1, status: 1, processedAt: -1 })\n@index({ orderType: 1, status: 1, isEndorseLossApplied: 1, processedAt: -1 })\n@index({ itemType: 1, status: 1, isEndorseLossApplied: 1, processedAt: -1 })\n@index({ shop: 1, status: 1, isEndorseLossApplied: 1, processedAt: -1 })\n@index({ parent: 1, status: 1, isEndorseLossApplied: 1, processedAt: -1 })\n@index({ rider: 1, status: 1, isEndorseLossApplied: 1, processedAt: -1 })\n@pre<Order>('validate', async function (next) {\n\tif (this.isNew) {\n\t\tconst today = dayjs().tz(LyxaTimezone).format('DDMMYY');\n\n\t\tconst counter = await CounterModel.findOneAndUpdate(\n\t\t\t{ counterType: CounterType.ORDER },\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\t$set: {\n\t\t\t\t\t\tvalue: {\n\t\t\t\t\t\t\t$cond: [{ $eq: ['$today', today] }, { $add: ['$value', 1] }, 1],\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttoday: today,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\t{ new: true, upsert: true }\n\t\t);\n\n\t\tthis.orderId = `${today}${counter.value.toString().padStart(6, '0')}`;\n\t}\n\tnext();\n})\nexport class Order extends TimeStamps {\n\t@prop({ required: true, type: String, unique: true })\n\tpublic orderId: string;\n\n\t@prop({ type: String, enum: OrderType, default: OrderType.REGULAR })\n\tpublic orderType?: OrderType;\n\n\t@prop({ ref: () => Rider, index: true })\n\tpublic rider?: Ref<Rider>;\n\n\t@prop({ type: () => DeliveryFeeInformation })\n\tpublic deliveryFeeInformation?: DeliveryFeeInformation;\n\n\t@prop({ type: Date })\n\tpublic initialEstimatedDeliveredTime?: Date;\n\n\t@prop({ type: Number })\n\tpublic initialEstimatedDeliveredTimeInMinutes: number;\n\n\t@prop({ type: Date })\n\tpublic estimatedDeliveredTime: Date;\n\n\t@prop({ type: Number })\n\tpublic estimatedDeliveredTimeInMinutes: number;\n\n\t@prop({ type: Date })\n\tpublic deliveredAt: Date;\n\n\t@prop({ type: Number })\n\tpublic deliveredTimeInMinutes: number;\n\n\t@prop({ type: String })\n\tpublic instruction?: string;\n\n\t@prop({ type: String })\n\tpublic note?: string;\n\n\t@prop({ type: Date })\n\tpublic scheduledFor?: Date;\n\n\t@prop({ type: Date })\n\tpublic triggerAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic placedAt?: Date;\n\n\t@prop({ type: () => OrderCancel })\n\tpublic orderCancel?: OrderCancel;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isLateOrder?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isUrgentOrder?: boolean;\n\n\t@prop({ type: () => [String], enum: UrgentOrderReasons, default: [] })\n\tpublic urgentOrderReason?: UrgentOrderReasons[];\n\n\t@prop({ type: Date, default: new Date() })\n\tpublic processedAt?: Date;\n\n\t@prop({\n\t\ttype: Number,\n\t\trequired: true,\n\t\tmin: 1000,\n\t\tmax: 9999,\n\t\tvalidate: {\n\t\t\tvalidator: (v: number) => Number.isInteger(v),\n\t\t\tmessage: 'Pin code must be an integer',\n\t\t},\n\t})\n\tpublic pinCode!: number;\n\n\t// Review feature\n\t@prop({ type: Boolean, default: false })\n\tpublic isOrderReviewed?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReviewNotificationSent?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isLowRated?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isResolved?: boolean;\n\n\t@prop({\n\t\tref: () => Review,\n\t\tforeignField: 'order',\n\t\tlocalField: '_id',\n\t})\n\tpublic reviews: Ref<Review>[];\n\n\t// Flag feature\n\t@prop({ type: Boolean, default: false })\n\tpublic isFlagged?: boolean;\n\n\t@prop({ type: [String], enum: FlagType, default: [] })\n\tpublic flagTypes?: FlagType[];\n\n\t@prop({ type: () => [String], enum: FlagReasonType, default: [] })\n\tpublic flagOrderReason?: FlagReasonType[];\n\n\t@prop({ type: Date })\n\tpublic flaggedAt?: Date;\n\n\t@prop({\n\t\tref: () => Flag,\n\t\tforeignField: 'order',\n\t\tlocalField: '_id',\n\t})\n\tpublic flags: Ref<Flag>[];\n\n\t@prop({ type: () => [RiderAssignment], default: [] })\n\triderAssignments: RiderAssignment[];\n\n\t@prop()\n\testimatedPickupTime?: Date;\n\n\t@prop()\n\tactualPickupTime?: Date;\n\n\t@prop()\n\testimatedPickupArrivalTime?: Date;\n\n\t@prop()\n\testimatedPickupArrivalTimeInMinutes?: Number;\n\n\t@prop()\n\tactualPickupArrivalTime?: Date;\n\n\t@prop()\n\tactualPickupArrivalTimeInMinutes?: Number;\n\n\t@prop({ type: Date })\n\triderSearchingStartTime?: Date;\n\n\t@prop({ type: Number, default: 0 })\n\ttotalSearchAttempts?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tlastSearchRadiusInKm?: number;\n\n\t@prop({ type: () => [TripLeg], default: [] })\n\ttripSummary: TripLeg[];\n\n\t@prop({ type: String })\n\timage?: string;\n\n\t@prop({\n\t\tref: 'Chatroom', // ✅ Use string instead of () => Chatroom\n\t\tforeignField: 'order',\n\t\tlocalField: '_id',\n\t\tjustOne: false,\n\t})\n\tpublic chatrooms?: Ref<Chatroom>[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"order.model.js","sourceRoot":"/","sources":["libraries/mongo/models/order.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAqF;AACrF,4EAAqE;AACrE,kDAMiC;AACjC,sEAA4D;AAC5D,+CAAsC;AACtC,kGAAqF;AACrF,8EAAoE;AACpE,6CAAoC;AACpC,iDAAwC;AACxC,4DAAmD;AACnD,wBAAiC;AAEjC,kDAAuD;AACvD,kDAA0B;AAC1B,2DAA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AAE,CAAC,mBAAY,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAExD,MAAM,OAAO,GAAG,MAAM,eAAY,CAAC,gBAAgB,CAClD,EAAE,WAAW,EAAE,kBAAW,CAAC,KAAK,EAAE,EAClC;gBACC;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE;4BACN,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;yBAC/D;wBACD,KAAK,EAAE,KAAK;qBACZ;iBACD;aACD,EACD,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAC3B,CAAC;YAEF,IAAI,CAAC,OAAO,GAAG,GAAG,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;QACvE,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,KAAK,CA+JjB","sourcesContent":["import { index, modelOptions, pre, prop, Ref, Severity } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport {\n\tCounterType,\n\tFlagReasonType,\n\tFlagType,\n\tOrderType,\n\tUrgentOrderReasons,\n} from '../../../utilities/enum';\nimport { OrderCancel } from './embedded/order-cancel.model';\nimport { Rider } from './rider.model';\nimport { DeliveryFeeInformation } from './embedded/order-delivery-information.model';\nimport { RiderAssignment } from './embedded/rider-assignment-model';\nimport { Flag } from './flag.model';\nimport { Review } from './review.model';\nimport { TripLeg } from './embedded/trip-leg.mode';\nimport { CounterModel } from '.';\nimport { Chatroom } from './chat-room.model';\nimport { LyxaTimezone } from '../../../utilities/time';\nimport dayjs from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\nimport timezone from 'dayjs/plugin/timezone';\n\ndayjs.extend(utc);\ndayjs.extend(timezone);\n\n@modelOptions({\n\tschemaOptions: {\n\t\tcollection: 'orders',\n\t\tdiscriminatorKey: 'orderType',\n\t\ttoJSON: { virtuals: true },\n\t\ttoObject: { virtuals: true },\n\t},\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@index({ 'deliveryAddress.location': '2dsphere' })\n@index({ user: 1, status: 1, processedAt: -1 })\n@index({ shop: 1, status: 1, processedAt: -1 })\n@index({ parent: 1, status: 1, processedAt: -1 })\n@index({ orderType: 1, status: 1, processedAt: -1 })\n@index({ orderType: 1, status: 1, isEndorseLossApplied: 1, processedAt: -1 })\n@index({ itemType: 1, status: 1, isEndorseLossApplied: 1, processedAt: -1 })\n@index({ shop: 1, status: 1, isEndorseLossApplied: 1, processedAt: -1 })\n@index({ parent: 1, status: 1, isEndorseLossApplied: 1, processedAt: -1 })\n@index({ rider: 1, status: 1, isEndorseLossApplied: 1, processedAt: -1 })\n@pre<Order>('validate', async function (next) {\n\tif (this.isNew) {\n\t\tconst today = dayjs().tz(LyxaTimezone).format('DDMMYY');\n\n\t\tconst counter = await CounterModel.findOneAndUpdate(\n\t\t\t{ counterType: CounterType.ORDER },\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\t$set: {\n\t\t\t\t\t\tvalue: {\n\t\t\t\t\t\t\t$cond: [{ $eq: ['$today', today] }, { $add: ['$value', 1] }, 1],\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttoday: today,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\t{ new: true, upsert: true }\n\t\t);\n\n\t\tthis.orderId = `${today}${counter.value.toString().padStart(6, '0')}`;\n\t}\n\tnext();\n})\nexport class Order extends TimeStamps {\n\t@prop({ required: true, type: String, unique: true })\n\tpublic orderId: string;\n\n\t@prop({ type: String, enum: OrderType, default: OrderType.REGULAR })\n\tpublic orderType?: OrderType;\n\n\t@prop({ ref: () => Rider, index: true })\n\tpublic rider?: Ref<Rider>;\n\n\t@prop({ type: () => DeliveryFeeInformation })\n\tpublic deliveryFeeInformation?: DeliveryFeeInformation;\n\n\t@prop({ type: Date })\n\tpublic initialEstimatedDeliveredTime?: Date;\n\n\t@prop({ type: Number })\n\tpublic initialEstimatedDeliveredTimeInMinutes: number;\n\n\t@prop({ type: Date })\n\tpublic estimatedDeliveredTime: Date;\n\n\t@prop({ type: Number })\n\tpublic estimatedDeliveredTimeInMinutes: number;\n\n\t@prop({ type: Date })\n\tpublic deliveredAt: Date;\n\n\t@prop({ type: Number })\n\tpublic deliveredTimeInMinutes: number;\n\n\t@prop({ type: String })\n\tpublic instruction?: string;\n\n\t@prop({ type: String })\n\tpublic note?: string;\n\n\t@prop({ type: Date })\n\tpublic scheduledFor?: Date;\n\n\t@prop({ type: Date })\n\tpublic triggerAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic placedAt?: Date;\n\n\t@prop({ type: () => OrderCancel })\n\tpublic orderCancel?: OrderCancel;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isLateOrder?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isUrgentOrder?: boolean;\n\n\t@prop({ type: () => [String], enum: UrgentOrderReasons, default: [] })\n\tpublic urgentOrderReason?: UrgentOrderReasons[];\n\n\t@prop({ type: Date, default: new Date() })\n\tpublic processedAt?: Date;\n\n\t@prop({\n\t\ttype: Number,\n\t\trequired: true,\n\t\tmin: 1000,\n\t\tmax: 9999,\n\t\tvalidate: {\n\t\t\tvalidator: (v: number) => Number.isInteger(v),\n\t\t\tmessage: 'Pin code must be an integer',\n\t\t},\n\t})\n\tpublic pinCode!: number;\n\n\t// Review feature\n\t@prop({ type: Boolean, default: false })\n\tpublic isOrderReviewed?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReviewNotificationSent?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isLowRated?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isResolved?: boolean;\n\n\t@prop({\n\t\tref: () => Review,\n\t\tforeignField: 'order',\n\t\tlocalField: '_id',\n\t})\n\tpublic reviews: Ref<Review>[];\n\n\t// Flag feature\n\t@prop({ type: Boolean, default: false })\n\tpublic isFlagged?: boolean;\n\n\t@prop({ type: [String], enum: FlagType, default: [] })\n\tpublic flagTypes?: FlagType[];\n\n\t@prop({ type: () => [String], enum: FlagReasonType, default: [] })\n\tpublic flagOrderReason?: FlagReasonType[];\n\n\t@prop({ type: Date })\n\tpublic flaggedAt?: Date;\n\n\t@prop({\n\t\tref: () => Flag,\n\t\tforeignField: 'order',\n\t\tlocalField: '_id',\n\t})\n\tpublic flags: Ref<Flag>[];\n\n\t@prop({ type: () => [RiderAssignment], default: [] })\n\triderAssignments: RiderAssignment[];\n\n\t@prop()\n\testimatedPickupTime?: Date;\n\n\t@prop()\n\tactualPickupTime?: Date;\n\n\t@prop()\n\testimatedPickupArrivalTime?: Date;\n\n\t@prop()\n\testimatedPickupArrivalTimeInMinutes?: Number;\n\n\t@prop()\n\tactualPickupArrivalTime?: Date;\n\n\t@prop()\n\tactualPickupArrivalTimeInMinutes?: Number;\n\n\t@prop({ type: Date })\n\triderSearchingStartTime?: Date;\n\n\t@prop({ type: Number, default: 0 })\n\ttotalSearchAttempts?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tlastSearchRadiusInKm?: number;\n\n\t@prop({ type: () => [TripLeg], default: [] })\n\ttripSummary: TripLeg[];\n\n\t@prop({ type: String })\n\timage?: string;\n\n\t@prop({\n\t\tref: 'Chatroom', // ✅ Use string instead of () => Chatroom\n\t\tforeignField: 'order',\n\t\tlocalField: '_id',\n\t\tjustOne: false,\n\t})\n\tpublic chatrooms?: Ref<Chatroom>[];\n\n\t@prop({ type: Boolean, default: false })\n\thasChatroom?: boolean;\n}\n"]}
|
|
@@ -5,6 +5,7 @@ import { CourierAddress } from '../shared/address.model';
|
|
|
5
5
|
import { CourierOrderStatusTimeline } from '../embedded/status-timeline.model';
|
|
6
6
|
import { CourierOrderFinance } from '../embedded/courier-order-finance.model';
|
|
7
7
|
import { User } from '../user.model';
|
|
8
|
+
import { CourierOrderAddressChangeHistory } from '../embedded/address-change-history.model';
|
|
8
9
|
declare class CourierItem {
|
|
9
10
|
productName: string;
|
|
10
11
|
productImage?: string;
|
|
@@ -23,6 +24,7 @@ export declare class CourierOrder extends Order {
|
|
|
23
24
|
courierType: CourierServiceType;
|
|
24
25
|
pickupAddress: CourierAddress;
|
|
25
26
|
deliveryAddress: CourierAddress;
|
|
27
|
+
addressChangeHistory?: CourierOrderAddressChangeHistory[];
|
|
26
28
|
items?: CourierItem[];
|
|
27
29
|
receiptImage?: string;
|
|
28
30
|
receiptPrice?: number;
|
|
@@ -17,6 +17,7 @@ const address_model_1 = require("../shared/address.model");
|
|
|
17
17
|
const status_timeline_model_1 = require("../embedded/status-timeline.model");
|
|
18
18
|
const courier_order_finance_model_1 = require("../embedded/courier-order-finance.model");
|
|
19
19
|
const user_model_1 = require("../user.model");
|
|
20
|
+
const address_change_history_model_1 = require("../embedded/address-change-history.model");
|
|
20
21
|
class CourierItem {
|
|
21
22
|
productName;
|
|
22
23
|
productImage;
|
|
@@ -63,6 +64,7 @@ class CourierOrder extends order_model_1.Order {
|
|
|
63
64
|
courierType;
|
|
64
65
|
pickupAddress;
|
|
65
66
|
deliveryAddress;
|
|
67
|
+
addressChangeHistory;
|
|
66
68
|
items;
|
|
67
69
|
receiptImage;
|
|
68
70
|
receiptPrice;
|
|
@@ -98,6 +100,10 @@ __decorate([
|
|
|
98
100
|
(0, typegoose_1.prop)({ required: true, type: address_model_1.CourierAddress }),
|
|
99
101
|
__metadata("design:type", address_model_1.CourierAddress)
|
|
100
102
|
], CourierOrder.prototype, "deliveryAddress", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, typegoose_1.prop)({ type: [address_change_history_model_1.CourierOrderAddressChangeHistory] }),
|
|
105
|
+
__metadata("design:type", Array)
|
|
106
|
+
], CourierOrder.prototype, "addressChangeHistory", void 0);
|
|
101
107
|
__decorate([
|
|
102
108
|
(0, typegoose_1.prop)({ type: () => [CourierItem], default: [] }),
|
|
103
109
|
__metadata("design:type", Array)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"courier-order.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/courier-order.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,gDAAuC;AACvC,qDAA+F;AAC/F,2DAAyD;AACzD,6EAA+E;AAC/E,yFAA8E;AAC9E,8CAAqC;
|
|
1
|
+
{"version":3,"file":"courier-order.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/courier-order.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,gDAAuC;AACvC,qDAA+F;AAC/F,2DAAyD;AACzD,6EAA+E;AAC/E,yFAA8E;AAC9E,8CAAqC;AACrC,2FAA4F;AAE5F,MAAM,WAAW;IAET,WAAW,CAAS;IAGpB,YAAY,CAAU;IAGtB,QAAQ,CAAS;IAGjB,SAAS,CAAU;IAGnB,kBAAkB,CAAU;IAG5B,UAAU,CAAU;IAGpB,mBAAmB,CAAU;CACpC;AAnBO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACE;AAGpB;IADN,IAAA,gBAAI,GAAE;;iDACsB;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;6CACT;AAGjB;IADN,IAAA,gBAAI,GAAE;;8CACmB;AAGnB;IADN,IAAA,gBAAI,GAAE;;uDAC4B;AAG5B;IADN,IAAA,gBAAI,GAAE;;+CACoB;AAGpB;IADN,IAAA,gBAAI,GAAE;;wDAC6B;AAGrC,MAAa,YAAa,SAAQ,mBAAK;IAC/B,SAAS,GAAG,gBAAS,CAAC,OAAgB,CAAC;IAGvC,IAAI,CAAY;IAGhB,MAAM,CAAqB;IAG3B,cAAc,CAA+B;IAG7C,WA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AC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;2CACpB;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDACM;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDACM;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,iDAAmB,EAAE,CAAC;8BACpC,iDAAmB;6CAAC;AAG7B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,iDAAmB,EAAE,CAAC;8BACX,iDAAmB;qDAAC","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { Order } from '../order.model';\nimport { CourierOrderStatus, CourierServiceType, OrderType } from '../../../../utilities/enum';\nimport { CourierAddress } from '../shared/address.model';\nimport { CourierOrderStatusTimeline } from '../embedded/status-timeline.model';\nimport { CourierOrderFinance } from '../embedded/courier-order-finance.model';\nimport { User } from '../user.model';\nimport { CourierOrderAddressChangeHistory } from '../embedded/address-change-history.model';\n\nclass CourierItem {\n\t@prop({ required: true })\n\tpublic productName: string;\n\n\t@prop()\n\tpublic productImage?: string;\n\n\t@prop({ required: true, min: 1 })\n\tpublic quantity: number;\n\n\t@prop()\n\tpublic unitPrice?: number;\n\n\t@prop()\n\tpublic secondaryUnitPrice?: number;\n\n\t@prop()\n\tpublic totalPrice?: number;\n\n\t@prop()\n\tpublic secondaryTotalPrice?: number;\n}\n\nexport class CourierOrder extends Order {\n\tpublic orderType = OrderType.COURIER as const;\n\n\t@prop({ required: true, ref: () => User })\n\tpublic user: Ref<User>;\n\n\t@prop({ type: String, enum: CourierOrderStatus, default: CourierOrderStatus.PLACED })\n\tpublic status: CourierOrderStatus;\n\n\t@prop({ type: () => [CourierOrderStatusTimeline], default: [] })\n\tpublic statusTimeline: CourierOrderStatusTimeline[];\n\n\t@prop({ type: String })\n\tpublic description: string;\n\n\t@prop({ required: true, type: String, enum: CourierServiceType })\n\tpublic courierType!: CourierServiceType;\n\n\t@prop({ required: true, type: () => CourierAddress })\n\tpublic pickupAddress!: CourierAddress;\n\n\t@prop({ required: true, type: CourierAddress })\n\tpublic deliveryAddress!: CourierAddress;\n\n\t@prop({ type: [CourierOrderAddressChangeHistory] })\n\tpublic addressChangeHistory?: CourierOrderAddressChangeHistory[];\n\n\t@prop({ type: () => [CourierItem], default: [] })\n\tpublic items?: CourierItem[];\n\n\t@prop({ type: String })\n\tpublic receiptImage?: string;\n\n\t@prop({ type: Number })\n\tpublic receiptPrice?: number;\n\n\t@prop({ required: true, type: CourierOrderFinance })\n\tpublic finance: CourierOrderFinance;\n\n\t@prop({ type: CourierOrderFinance })\n\tpublic adjustedFinance?: CourierOrderFinance;\n}\n"]}
|
|
@@ -15,6 +15,7 @@ import { User } from '../user.model';
|
|
|
15
15
|
import { Rider } from '../rider.model';
|
|
16
16
|
import { CartParticipant } from '../cart-participant.model';
|
|
17
17
|
import { AdjustmentHistory, AdjustmentInformation } from '../embedded/adjustment-information.model';
|
|
18
|
+
import { RegularOrderAddressChangeHistory } from '../embedded/address-change-history.model';
|
|
18
19
|
export declare class RegularOrder extends Order {
|
|
19
20
|
orderType: OrderType.REGULAR;
|
|
20
21
|
user: Ref<User>;
|
|
@@ -24,6 +25,7 @@ export declare class RegularOrder extends Order {
|
|
|
24
25
|
itemType?: string;
|
|
25
26
|
pickupAddress: Address;
|
|
26
27
|
deliveryAddress: RegularOrderAddress;
|
|
28
|
+
addressChangeHistory?: RegularOrderAddressChangeHistory[];
|
|
27
29
|
parent: Ref<Parent>;
|
|
28
30
|
shop: Ref<Shop>;
|
|
29
31
|
cart: Ref<Cart>;
|
|
@@ -27,6 +27,7 @@ const user_model_1 = require("../user.model");
|
|
|
27
27
|
const rider_model_1 = require("../rider.model");
|
|
28
28
|
const cart_participant_model_1 = require("../cart-participant.model");
|
|
29
29
|
const adjustment_information_model_1 = require("../embedded/adjustment-information.model");
|
|
30
|
+
const address_change_history_model_1 = require("../embedded/address-change-history.model");
|
|
30
31
|
class RegularOrder extends order_model_1.Order {
|
|
31
32
|
orderType = enum_1.OrderType.REGULAR;
|
|
32
33
|
user;
|
|
@@ -36,6 +37,7 @@ class RegularOrder extends order_model_1.Order {
|
|
|
36
37
|
itemType;
|
|
37
38
|
pickupAddress;
|
|
38
39
|
deliveryAddress;
|
|
40
|
+
addressChangeHistory;
|
|
39
41
|
parent;
|
|
40
42
|
shop;
|
|
41
43
|
cart;
|
|
@@ -87,6 +89,10 @@ __decorate([
|
|
|
87
89
|
(0, typegoose_1.prop)({ required: true, type: address_model_1.RegularOrderAddress }),
|
|
88
90
|
__metadata("design:type", address_model_1.RegularOrderAddress)
|
|
89
91
|
], RegularOrder.prototype, "deliveryAddress", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typegoose_1.prop)({ type: [address_change_history_model_1.RegularOrderAddressChangeHistory] }),
|
|
94
|
+
__metadata("design:type", Array)
|
|
95
|
+
], RegularOrder.prototype, "addressChangeHistory", void 0);
|
|
90
96
|
__decorate([
|
|
91
97
|
(0, typegoose_1.prop)({ required: true, ref: () => parent_model_1.Parent }),
|
|
92
98
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regular-order.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/regular-order.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,gDAAuC;AACvC,qDAAuG;AACvG,kDAAyC;AACzC,8CAAqC;AACrC,8CAAqC;AACrC,2DAAuE;AACvE,6EAA+E;AAC/E,uEAA6D;AAC7D,yFAA8E;AAC9E,uEAA6D;AAC7D,iFAAuE;AACvE,wDAA8C;AAC9C,8CAAqC;AACrC,gDAAuC;AACvC,sEAA4D;AAC5D,2FAAoG;
|
|
1
|
+
{"version":3,"file":"regular-order.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/regular-order.model.ts"],"names":[],"mappings":";;;;;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C;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,iDAAmB,EAAE,CAAC;8BACpC,iDAAmB;6CAAC;AAG7B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,iDAAmB,EAAE,CAAC;8BACX,iDAAmB;qDAAC;AAGtC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;kDACV;AAOvB;IALN,IAAA,gBAAI,EAAC;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,0BAAQ;QACnB,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,MAAM;KAClB,CAAC;;+CACgC;AAO3B;IALN,IAAA,gBAAI,EAAC;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,wCAAe;QAC1B,YAAY,EAAE,MAAM;QACpB,UAAU,EAAE,MAAM;KAClB,CAAC;;sDAC8C","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { Order } from '../order.model';\nimport { AdjustmentStatus, ItemType, OrderType, RegularOrderStatus } from '../../../../utilities/enum';\nimport { Parent } from '../parent.model';\nimport { Shop } from '../shop.model';\nimport { Cart } from '../cart.model';\nimport { Address, RegularOrderAddress } from '../shared/address.model';\nimport { RegularOrderStatusTimeline } from '../embedded/status-timeline.model';\nimport { OrderRefund } from '../embedded/order-refund.model';\nimport { RegularOrderFinance } from '../embedded/regular-order-finance.model';\nimport { EndorseLoss } from '../embedded/order-cancel.model';\nimport { ReplacementOrder } from '../embedded/replacement-order.model';\nimport { LineItem } from '../line-item.model';\nimport { User } from '../user.model';\nimport { Rider } from '../rider.model';\nimport { CartParticipant } from '../cart-participant.model';\nimport { AdjustmentHistory, AdjustmentInformation } from '../embedded/adjustment-information.model';\nimport { RegularOrderAddressChangeHistory } from '../embedded/address-change-history.model';\n\nexport class RegularOrder extends Order {\n\tpublic orderType = OrderType.REGULAR as const;\n\n\t@prop({ required: true, ref: () => User })\n\tpublic user: Ref<User>;\n\n\t@prop({ ref: () => Rider })\n\tpublic supportRiders?: Ref<Rider>[];\n\n\t@prop({ type: String, enum: RegularOrderStatus, default: RegularOrderStatus.PLACED })\n\tpublic status: RegularOrderStatus;\n\n\t@prop({ type: () => [RegularOrderStatusTimeline], default: [] })\n\tpublic statusTimeline: RegularOrderStatusTimeline[];\n\n\t@prop({ type: String, enum: ItemType, default: ItemType.FOOD })\n\tpublic itemType?: string;\n\n\t@prop({ required: true, type: Address })\n\tpublic pickupAddress: Address;\n\n\t@prop({ required: true, type: RegularOrderAddress })\n\tpublic deliveryAddress: RegularOrderAddress;\n\n\t@prop({ type: [RegularOrderAddressChangeHistory] })\n\tpublic addressChangeHistory?: RegularOrderAddressChangeHistory[];\n\n\t@prop({ required: true, ref: () => Parent })\n\tpublic parent!: Ref<Parent>;\n\n\t@prop({ required: true, ref: () => Shop })\n\tpublic shop!: Ref<Shop>;\n\n\t@prop({ required: true, ref: () => Cart, unique: true })\n\tpublic cart!: Ref<Cart>;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isShopDelivery?: boolean;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic preparingTimeInMinutes?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReplacementOrder?: boolean;\n\n\t@prop({ type: () => ReplacementOrder })\n\tpublic replacementOrderInformation?: ReplacementOrder;\n\n\t@prop({ ref: () => Order })\n\tpublic replacementOrder?: Ref<Order>;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRefunded?: boolean;\n\n\t@prop({ type: OrderRefund })\n\tpublic refundInformation?: OrderRefund;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isEndorseLossApplied?: boolean;\n\n\t@prop({ type: () => EndorseLoss })\n\tpublic endorseLossInformation?: EndorseLoss;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isAdjusted?: boolean;\n\n\t@prop({ type: String, enum: AdjustmentStatus, default: AdjustmentStatus.NONE })\n\tpublic adjustmentStatus: AdjustmentStatus;\n\n\t@prop({ type: () => AdjustmentInformation })\n\tpublic adjustmentInformation?: AdjustmentInformation;\n\n\t@prop({ type: () => [AdjustmentHistory], default: [] })\n\tpublic adjustmentHistory?: AdjustmentHistory[];\n\n\t@prop({ required: true, type: RegularOrderFinance })\n\tpublic finance: RegularOrderFinance;\n\n\t@prop({ type: RegularOrderFinance })\n\tpublic adjustedFinance?: RegularOrderFinance;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isGroupOrder?: boolean;\n\n\t@prop({\n\t\tref: () => LineItem,\n\t\tforeignField: 'cart',\n\t\tlocalField: 'cart',\n\t})\n\tpublic lineItems: Ref<LineItem>[];\n\n\t@prop({\n\t\tref: () => CartParticipant,\n\t\tforeignField: 'cart',\n\t\tlocalField: 'cart',\n\t})\n\tpublic cartParticipants: Ref<CartParticipant>[];\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED