@lyxa.ai/core 1.0.108 → 1.0.110
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/app-screen-setting.model.d.ts +9 -0
- package/dist/libraries/mongo/models/app-screen-setting.model.js +72 -0
- package/dist/libraries/mongo/models/app-screen-setting.model.js.map +1 -0
- package/dist/libraries/mongo/models/embedded/order-cancel.model.d.ts +7 -2
- package/dist/libraries/mongo/models/embedded/order-cancel.model.js +15 -3
- package/dist/libraries/mongo/models/embedded/order-cancel.model.js.map +1 -1
- package/dist/libraries/mongo/models/order-payment.model.d.ts +17 -0
- package/dist/libraries/mongo/models/order-payment.model.js +84 -0
- package/dist/libraries/mongo/models/order-payment.model.js.map +1 -0
- package/dist/libraries/mongo/models/providers/rider-payout.model.d.ts +3 -3
- package/dist/libraries/mongo/models/providers/rider-payout.model.js +6 -6
- package/dist/libraries/mongo/models/providers/rider-payout.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/shop-payout.model.d.ts +2 -2
- package/dist/libraries/mongo/models/providers/shop-payout.model.js +4 -4
- package/dist/libraries/mongo/models/providers/shop-payout.model.js.map +1 -1
- package/dist/utilities/validation/common-validation.d.ts +7 -7
- package/package.json +1 -1
- package/dist/libraries/mongo/models/embedded/loyaltyPoint.model.d.ts +0 -16
- package/dist/libraries/mongo/models/embedded/loyaltyPoint.model.js +0 -61
- package/dist/libraries/mongo/models/embedded/loyaltyPoint.model.js.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
2
|
+
import { ItemType, SectionType, Status } from '../../../utilities/enum';
|
|
3
|
+
export declare class AppScreenSetting extends TimeStamps {
|
|
4
|
+
itemType: ItemType;
|
|
5
|
+
section: SectionType;
|
|
6
|
+
alias: string;
|
|
7
|
+
status?: Status;
|
|
8
|
+
sortingOrder?: number;
|
|
9
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AppScreenSetting = void 0;
|
|
13
|
+
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
|
+
const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
15
|
+
const enum_1 = require("../../../utilities/enum");
|
|
16
|
+
const _1 = require(".");
|
|
17
|
+
let AppScreenSetting = class AppScreenSetting extends defaultClasses_1.TimeStamps {
|
|
18
|
+
itemType;
|
|
19
|
+
section;
|
|
20
|
+
alias;
|
|
21
|
+
status;
|
|
22
|
+
sortingOrder;
|
|
23
|
+
};
|
|
24
|
+
exports.AppScreenSetting = AppScreenSetting;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.ItemType }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], AppScreenSetting.prototype, "itemType", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.SectionType }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], AppScreenSetting.prototype, "section", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typegoose_1.prop)({ required: true, type: String }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], AppScreenSetting.prototype, "alias", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.Status, default: enum_1.Status.ACTIVE }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], AppScreenSetting.prototype, "status", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typegoose_1.prop)({ type: Number }),
|
|
43
|
+
__metadata("design:type", Number)
|
|
44
|
+
], AppScreenSetting.prototype, "sortingOrder", void 0);
|
|
45
|
+
exports.AppScreenSetting = AppScreenSetting = __decorate([
|
|
46
|
+
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'appScreenSettings' } }),
|
|
47
|
+
(0, typegoose_1.pre)('save', async function (next) {
|
|
48
|
+
if (this.isNew || typeof this.sortingOrder === 'undefined') {
|
|
49
|
+
try {
|
|
50
|
+
const maxSortingOrder = await _1.AppScreenSettingModel.aggregate([
|
|
51
|
+
{
|
|
52
|
+
$match: {
|
|
53
|
+
deletedAt: null,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
$group: {
|
|
58
|
+
_id: null,
|
|
59
|
+
maxSortingOrder: { $max: '$sortingOrder' },
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
]).exec();
|
|
63
|
+
this.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
return next(error);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
next();
|
|
70
|
+
})
|
|
71
|
+
], AppScreenSetting);
|
|
72
|
+
//# sourceMappingURL=app-screen-setting.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-screen-setting.model.js","sourceRoot":"/","sources":["libraries/mongo/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;qBACD;oBACD;wBACC,MAAM,EAAE;4BACP,GAAG,EAAE,IAAI;4BACT,eAAe,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;yBAC1C;qBACD;iBACD,CAAC,CAAC,IAAI,EAAE,CAAC;gBAGV,IAAI,CAAC,YAAY,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACrE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,IAAI,CAAC,KAAc,CAAC,CAAC;YAC7B,CAAC;QACF,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,gBAAgB,CAe5B","sourcesContent":["import { modelOptions, pre, prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ItemType, SectionType, Status } from '../../../utilities/enum';\nimport { AppScreenSettingModel } from '.';\n\n@modelOptions({ schemaOptions: { collection: 'appScreenSettings' } })\n@pre<AppScreenSetting>('save', async function (next) {\n\t// Only set sortingOrder if it's a new document or sortingOrder is not set\n\tif (this.isNew || typeof this.sortingOrder === 'undefined') {\n\t\ttry {\n\t\t\t// Find the maximum sortingOrder that aren't deleted\n\t\t\tconst maxSortingOrder = await AppScreenSettingModel.aggregate<{ maxSortingOrder: number }>([\n\t\t\t\t{\n\t\t\t\t\t$match: {\n\t\t\t\t\t\tdeletedAt: null,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t$group: {\n\t\t\t\t\t\t_id: null,\n\t\t\t\t\t\tmaxSortingOrder: { $max: '$sortingOrder' },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]).exec();\n\n\t\t\t// Set the new sortingOrder to max + 1 (or 0 if no items found)\n\t\t\tthis.sortingOrder = (maxSortingOrder[0]?.maxSortingOrder ?? -1) + 1;\n\t\t} catch (error) {\n\t\t\treturn next(error as Error);\n\t\t}\n\t}\n\tnext();\n})\nexport class AppScreenSetting extends TimeStamps {\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ required: true, type: String, enum: SectionType })\n\tpublic section!: SectionType;\n\n\t@prop({ required: true, type: String })\n\tpublic alias!: string;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n}\n"]}
|
|
@@ -3,12 +3,16 @@ import { LogUser } from '../../../../utilities/enum';
|
|
|
3
3
|
import { Admin } from '../admin.model';
|
|
4
4
|
import { LineItem } from '../line-item.model';
|
|
5
5
|
export declare class OrderCancel {
|
|
6
|
-
|
|
6
|
+
logUsers: LogUser[];
|
|
7
7
|
admin?: Ref<Admin>;
|
|
8
8
|
cancelReason?: string;
|
|
9
9
|
}
|
|
10
|
+
declare class selectedLineItem {
|
|
11
|
+
_id: Ref<LineItem>;
|
|
12
|
+
quantity: number;
|
|
13
|
+
}
|
|
10
14
|
export declare class EndorseLoss {
|
|
11
|
-
selectedLineItems:
|
|
15
|
+
selectedLineItems: selectedLineItem[];
|
|
12
16
|
deliveryFeeIncludedInEndorsement?: Boolean;
|
|
13
17
|
endorseLossByShopForItems: number;
|
|
14
18
|
secondaryEndorseLossByShopForItems: number;
|
|
@@ -21,3 +25,4 @@ export declare class EndorseLoss {
|
|
|
21
25
|
totalAmount: number;
|
|
22
26
|
secondaryTotalAmount: number;
|
|
23
27
|
}
|
|
28
|
+
export {};
|
|
@@ -15,7 +15,7 @@ const enum_1 = require("../../../../utilities/enum");
|
|
|
15
15
|
const admin_model_1 = require("../admin.model");
|
|
16
16
|
const line_item_model_1 = require("../line-item.model");
|
|
17
17
|
class OrderCancel {
|
|
18
|
-
|
|
18
|
+
logUsers;
|
|
19
19
|
admin;
|
|
20
20
|
cancelReason;
|
|
21
21
|
}
|
|
@@ -27,7 +27,7 @@ __decorate([
|
|
|
27
27
|
default: [],
|
|
28
28
|
}),
|
|
29
29
|
__metadata("design:type", Array)
|
|
30
|
-
], OrderCancel.prototype, "
|
|
30
|
+
], OrderCancel.prototype, "logUsers", void 0);
|
|
31
31
|
__decorate([
|
|
32
32
|
(0, typegoose_1.prop)({ ref: () => admin_model_1.Admin }),
|
|
33
33
|
__metadata("design:type", Object)
|
|
@@ -36,6 +36,18 @@ __decorate([
|
|
|
36
36
|
(0, typegoose_1.prop)({ type: String }),
|
|
37
37
|
__metadata("design:type", String)
|
|
38
38
|
], OrderCancel.prototype, "cancelReason", void 0);
|
|
39
|
+
class selectedLineItem {
|
|
40
|
+
_id;
|
|
41
|
+
quantity;
|
|
42
|
+
}
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typegoose_1.prop)({ required: true, ref: () => line_item_model_1.LineItem, default: [] }),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], selectedLineItem.prototype, "_id", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typegoose_1.prop)(),
|
|
49
|
+
__metadata("design:type", Number)
|
|
50
|
+
], selectedLineItem.prototype, "quantity", void 0);
|
|
39
51
|
class EndorseLoss {
|
|
40
52
|
selectedLineItems;
|
|
41
53
|
deliveryFeeIncludedInEndorsement;
|
|
@@ -52,7 +64,7 @@ class EndorseLoss {
|
|
|
52
64
|
}
|
|
53
65
|
exports.EndorseLoss = EndorseLoss;
|
|
54
66
|
__decorate([
|
|
55
|
-
(0, typegoose_1.prop)({ required: true,
|
|
67
|
+
(0, typegoose_1.prop)({ required: true, type: () => selectedLineItem }),
|
|
56
68
|
__metadata("design:type", Array)
|
|
57
69
|
], EndorseLoss.prototype, "selectedLineItems", void 0);
|
|
58
70
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-cancel.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/order-cancel.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAqD;AACrD,gDAAuC;AACvC,wDAA8C;AAG9C,MAAa,WAAW;IAMvB,QAAQ,CAAa;IAGrB,KAAK,CAAc;IAGnB,YAAY,CAAU;CACtB;AAbD,kCAaC;AAPA;IALC,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,cAAO;QACb,OAAO,EAAE,EAAE;KACX,CAAC;;6CACmB;AAGrB;IADC,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;0CACR;AAGnB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDACD;AAGvB,MAAa,WAAW;IAEvB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"order-cancel.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/order-cancel.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAqD;AACrD,gDAAuC;AACvC,wDAA8C;AAG9C,MAAa,WAAW;IAMvB,QAAQ,CAAa;IAGrB,KAAK,CAAc;IAGnB,YAAY,CAAU;CACtB;AAbD,kCAaC;AAPA;IALC,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,cAAO;QACb,OAAO,EAAE,EAAE;KACX,CAAC;;6CACmB;AAGrB;IADC,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;0CACR;AAGnB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDACD;AAGvB,MAAM,gBAAgB;IAErB,GAAG,CAAgB;IAGnB,QAAQ,CAAQ;CAChB;AAJA;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,0BAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;6CACxC;AAGnB;IADC,IAAA,gBAAI,GA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,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;0EACJ;AAG/C;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oEACV;AAGzC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;6EACD;AAGlD;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;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 { LogUser } from '../../../../utilities/enum';\nimport { Admin } from '../admin.model';\nimport { LineItem } from '../line-item.model';\n\n\nexport class OrderCancel {\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\tadmin?: Ref<Admin>;\n\n\t@prop({ type: String })\n\tcancelReason?: string;\n}\n\nclass selectedLineItem {\n\t@prop({ required: true, ref: () => LineItem, default: [] })\n\t_id: Ref<LineItem>;\n\n\t@prop()\n\tquantity: number\n}\n\nexport class EndorseLoss {\n\t@prop({ required: true, type: () => selectedLineItem })\n\tselectedLineItems: selectedLineItem[];\n\n\t@prop({ type: Boolean, default: false })\n\tdeliveryFeeIncludedInEndorsement?: Boolean;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\tendorseLossByShopForItems!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\tsecondaryEndorseLossByShopForItems!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\tendorseLossByShopForDelivery!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\tsecondaryEndorseLossByShopForDelivery!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\tendorseLossByCompanyForItems!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\tsecondaryEndorseLossByCompanyForItems!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\tendorseLossByCompanyForDelivery!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\tsecondaryEndorseLossByCompanyForDelivery!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\ttotalAmount!: number;\n\n\t@prop({ type: Number, required: true, default: 0 })\n\tsecondaryTotalAmount!: number;\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Ref } from '@typegoose/typegoose';
|
|
2
|
+
import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
3
|
+
import { Order } from './order.model';
|
|
4
|
+
import { PaymentMethod, PaymentStatus } from '../../../utilities/enum';
|
|
5
|
+
import { PaymentInformation } from './embedded/payment-infromation.model';
|
|
6
|
+
import { PaymentAttempt } from './embedded/payment-attempt.model';
|
|
7
|
+
export declare class OrderPayment extends TimeStamps {
|
|
8
|
+
order: Ref<Order>;
|
|
9
|
+
paymentMethod?: PaymentMethod;
|
|
10
|
+
paymentInformation?: PaymentInformation;
|
|
11
|
+
status?: PaymentStatus;
|
|
12
|
+
receiptUrl?: string;
|
|
13
|
+
attempts?: PaymentAttempt[];
|
|
14
|
+
currency: string;
|
|
15
|
+
amount: number;
|
|
16
|
+
secondaryAmount?: number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
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.OrderPayment = void 0;
|
|
13
|
+
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
|
+
const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
15
|
+
const order_model_1 = require("./order.model");
|
|
16
|
+
const enum_1 = require("../../../utilities/enum");
|
|
17
|
+
const payment_infromation_model_1 = require("./embedded/payment-infromation.model");
|
|
18
|
+
const payment_attempt_model_1 = require("./embedded/payment-attempt.model");
|
|
19
|
+
let OrderPayment = class OrderPayment extends defaultClasses_1.TimeStamps {
|
|
20
|
+
order;
|
|
21
|
+
paymentMethod;
|
|
22
|
+
paymentInformation;
|
|
23
|
+
status;
|
|
24
|
+
receiptUrl;
|
|
25
|
+
attempts;
|
|
26
|
+
currency;
|
|
27
|
+
amount;
|
|
28
|
+
secondaryAmount;
|
|
29
|
+
};
|
|
30
|
+
exports.OrderPayment = OrderPayment;
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typegoose_1.prop)({ required: true, ref: () => order_model_1.Order, index: true, unique: true }),
|
|
33
|
+
__metadata("design:type", Object)
|
|
34
|
+
], OrderPayment.prototype, "order", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.PaymentMethod, default: enum_1.PaymentMethod.CASH }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], OrderPayment.prototype, "paymentMethod", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typegoose_1.prop)({ type: () => payment_infromation_model_1.PaymentInformation }),
|
|
41
|
+
__metadata("design:type", payment_infromation_model_1.PaymentInformation)
|
|
42
|
+
], OrderPayment.prototype, "paymentInformation", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.PaymentStatus, default: enum_1.PaymentStatus.PENDING }),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], OrderPayment.prototype, "status", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typegoose_1.prop)(),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], OrderPayment.prototype, "receiptUrl", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typegoose_1.prop)({ type: [payment_attempt_model_1.PaymentAttempt], default: [] }),
|
|
53
|
+
__metadata("design:type", Array)
|
|
54
|
+
], OrderPayment.prototype, "attempts", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, typegoose_1.prop)({ type: String }),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], OrderPayment.prototype, "currency", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typegoose_1.prop)({ required: true, type: Number }),
|
|
61
|
+
__metadata("design:type", Number)
|
|
62
|
+
], OrderPayment.prototype, "amount", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typegoose_1.prop)({ type: Number }),
|
|
65
|
+
__metadata("design:type", Number)
|
|
66
|
+
], OrderPayment.prototype, "secondaryAmount", void 0);
|
|
67
|
+
exports.OrderPayment = OrderPayment = __decorate([
|
|
68
|
+
(0, typegoose_1.modelOptions)({
|
|
69
|
+
schemaOptions: {
|
|
70
|
+
timestamps: true,
|
|
71
|
+
collection: 'orderPayments',
|
|
72
|
+
toJSON: { virtuals: true },
|
|
73
|
+
toObject: { virtuals: true },
|
|
74
|
+
},
|
|
75
|
+
options: {
|
|
76
|
+
allowMixed: typegoose_1.Severity.ALLOW,
|
|
77
|
+
},
|
|
78
|
+
}),
|
|
79
|
+
(0, typegoose_1.index)({ order: 1 }),
|
|
80
|
+
(0, typegoose_1.index)({ status: 1 }),
|
|
81
|
+
(0, typegoose_1.index)({ paymentMethod: 1 }),
|
|
82
|
+
(0, typegoose_1.index)({ createdAt: -1 })
|
|
83
|
+
], OrderPayment);
|
|
84
|
+
//# sourceMappingURL=order-payment.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-payment.model.js","sourceRoot":"/","sources":["libraries/mongo/models/order-payment.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAgF;AAChF,4EAAqE;AACrE,+CAAsC;AACtC,kDAAuE;AACvE,oFAA0E;AAC1E,4EAAkE;AAiB3D,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,2BAAU;IAE3C,KAAK,CAAa;IAGlB,aAAa,CAAiB;IAG9B,kBAAkB,CAAsB;IAGxC,MAAM,CAAiB;IAGvB,UAAU,CAAU;IAGpB,QAAQ,CAAoB;IAG5B,QAAQ,CAAS;IAGjB,MAAM,CAAS;IAGf,eAAe,CAAU;CACzB,CAAA;AA3BY,oCAAY;AAExB;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;2CACpD;AAGlB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAa,EAAE,OAAO,EAAE,oBAAa,CAAC,IAAI,EAAE,CAAC;;mDAC3C;AAG9B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,8CAAkB,EAAE,CAAC;8BACpB,8CAAkB;wDAAC;AAGxC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAa,EAAE,OAAO,EAAE,oBAAa,CAAC,OAAO,EAAE,CAAC;;4CACrD;AAGvB;IADC,IAAA,gBAAI,GAAE;;gDACa;AAGpB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,CAAC,sCAAc,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;8CAClB;AAG5B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CACN;AAGjB;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CACxB;AAGf;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDACE;uBA1Bb,YAAY;IAfxB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE;YACd,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,eAAe;YAC3B,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC1B,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC5B;QACD,OAAO,EAAE;YACR,UAAU,EAAE,oBAAQ,CAAC,KAAK;SAC1B;KACD,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IACnB,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IACpB,IAAA,iBAAK,EAAC,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;IAC3B,IAAA,iBAAK,EAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;GACZ,YAAY,CA2BxB","sourcesContent":["import { index, modelOptions, prop, Ref, Severity } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Order } from './order.model';\nimport { PaymentMethod, PaymentStatus } from '../../../utilities/enum';\nimport { PaymentInformation } from './embedded/payment-infromation.model';\nimport { PaymentAttempt } from './embedded/payment-attempt.model';\n\n@modelOptions({\n\tschemaOptions: {\n\t\ttimestamps: true,\n\t\tcollection: 'orderPayments',\n\t\ttoJSON: { virtuals: true },\n\t\ttoObject: { virtuals: true },\n\t},\n\toptions: {\n\t\tallowMixed: Severity.ALLOW,\n\t},\n})\n@index({ order: 1 })\n@index({ status: 1 })\n@index({ paymentMethod: 1 })\n@index({ createdAt: -1 })\nexport class OrderPayment extends TimeStamps {\n\t@prop({ required: true, ref: () => Order, index: true, unique: true })\n\torder: Ref<Order>;\n\n\t@prop({ type: String, enum: PaymentMethod, default: PaymentMethod.CASH })\n\tpaymentMethod?: PaymentMethod;\n\n\t@prop({ type: () => PaymentInformation })\n\tpaymentInformation?: PaymentInformation;\n\n\t@prop({ type: String, enum: PaymentStatus, default: PaymentStatus.PENDING })\n\tstatus?: PaymentStatus;\n\n\t@prop()\n\treceiptUrl?: string;\n\n\t@prop({ type: [PaymentAttempt], default: [] })\n\tattempts?: PaymentAttempt[];\n\n\t@prop({ type: String })\n\tcurrency: string;\n\n\t@prop({ required: true, type: Number })\n\tamount: number;\n\n\t@prop({ type: Number })\n\tsecondaryAmount?: number;\n}\n"]}
|
|
@@ -6,10 +6,10 @@ export declare class RiderPayoutBreakdown {
|
|
|
6
6
|
deliveryFee?: number;
|
|
7
7
|
companyDeliveryCut: number;
|
|
8
8
|
riderTips: number;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
addCreditToRider: number;
|
|
10
|
+
removeCreditFromRider: number;
|
|
11
11
|
riderWeeklyReward: number;
|
|
12
|
-
|
|
12
|
+
riderPayout: number;
|
|
13
13
|
}
|
|
14
14
|
export declare class RiderPayout extends Payout {
|
|
15
15
|
payoutType: PayoutType.RIDER;
|
|
@@ -18,10 +18,10 @@ class RiderPayoutBreakdown {
|
|
|
18
18
|
deliveryFee;
|
|
19
19
|
companyDeliveryCut;
|
|
20
20
|
riderTips;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
addCreditToRider;
|
|
22
|
+
removeCreditFromRider;
|
|
23
23
|
riderWeeklyReward;
|
|
24
|
-
|
|
24
|
+
riderPayout;
|
|
25
25
|
}
|
|
26
26
|
exports.RiderPayoutBreakdown = RiderPayoutBreakdown;
|
|
27
27
|
__decorate([
|
|
@@ -39,11 +39,11 @@ __decorate([
|
|
|
39
39
|
__decorate([
|
|
40
40
|
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
41
41
|
__metadata("design:type", Number)
|
|
42
|
-
], RiderPayoutBreakdown.prototype, "
|
|
42
|
+
], RiderPayoutBreakdown.prototype, "addCreditToRider", void 0);
|
|
43
43
|
__decorate([
|
|
44
44
|
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
45
45
|
__metadata("design:type", Number)
|
|
46
|
-
], RiderPayoutBreakdown.prototype, "
|
|
46
|
+
], RiderPayoutBreakdown.prototype, "removeCreditFromRider", void 0);
|
|
47
47
|
__decorate([
|
|
48
48
|
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
49
49
|
__metadata("design:type", Number)
|
|
@@ -51,7 +51,7 @@ __decorate([
|
|
|
51
51
|
__decorate([
|
|
52
52
|
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
53
53
|
__metadata("design:type", Number)
|
|
54
|
-
], RiderPayoutBreakdown.prototype, "
|
|
54
|
+
], RiderPayoutBreakdown.prototype, "riderPayout", void 0);
|
|
55
55
|
class RiderPayout extends payout_model_1.Payout {
|
|
56
56
|
payoutType = enum_1.PayoutType.RIDER;
|
|
57
57
|
rider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rider-payout.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/rider-payout.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAwD;AACxD,kDAAyC;AACzC,gDAAuC;AAEvC,MAAa,oBAAoB;IAEhC,WAAW,CAAU;IAGrB,kBAAkB,CAAS;IAG3B,SAAS,CAAS;IAGlB,
|
|
1
|
+
{"version":3,"file":"rider-payout.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/rider-payout.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAwD;AACxD,kDAAyC;AACzC,gDAAuC;AAEvC,MAAa,oBAAoB;IAEhC,WAAW,CAAU;IAGrB,kBAAkB,CAAS;IAG3B,SAAS,CAAS;IAGlB,gBAAgB,CAAS;IAGzB,qBAAqB,CAAS;IAG9B,iBAAiB,CAAS;IAG1B,WAAW,CAAS;CACpB;AArBD,oDAqBC;AAnBA;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;yDACd;AAGrB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;gEACR;AAG3B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;uDACjB;AAGlB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;8DACV;AAGzB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;mEACL;AAG9B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;+DACT;AAG1B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;yDACf;AAGrB,MAAa,WAAY,SAAQ,qBAAM;IAC/B,UAAU,GAAG,iBAAU,CAAC,KAAc,CAAC;IAGvC,KAAK,CAAc;IAGnB,eAAe,CAAwB;CAC9C;AARD,kCAQC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;0CACjB;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,oBAAoB,EAAE,CAAC;8BAC5B,oBAAoB;oDAAC","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { PayoutType } from '../../../../utilities/enum';\nimport { Payout } from '../payout.model';\nimport { Rider } from '../rider.model';\n\nexport class RiderPayoutBreakdown {\n\t@prop({ type: Number, default: 0 })\n\tdeliveryFee?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tcompanyDeliveryCut: number;\n\n\t@prop({ type: Number, default: 0 })\n\triderTips: number;\n\n\t@prop({ type: Number, default: 0 })\n\taddCreditToRider: number;\n\n\t@prop({ type: Number, default: 0 })\n\tremoveCreditFromRider: number;\n\n\t@prop({ type: Number, default: 0 })\n\triderWeeklyReward: number;\n\n\t@prop({ type: Number, default: 0 })\n\triderPayout: number;\n}\n\nexport class RiderPayout extends Payout {\n\tpublic payoutType = PayoutType.RIDER as const;\n\n\t@prop({ required: true, ref: () => Rider })\n\tpublic rider!: Ref<Rider>;\n\n\t@prop({ required: true, type: RiderPayoutBreakdown })\n\tpublic payoutBreakdown!: RiderPayoutBreakdown;\n}\n"]}
|
|
@@ -23,9 +23,9 @@ export declare class ShopPayoutBreakdown {
|
|
|
23
23
|
addCreditToShop: number;
|
|
24
24
|
shopSelfDelivery: number;
|
|
25
25
|
vat: number;
|
|
26
|
-
|
|
26
|
+
shopPayout: number;
|
|
27
27
|
shopSelfCashInHand: number;
|
|
28
|
-
|
|
28
|
+
totalPayout: number;
|
|
29
29
|
}
|
|
30
30
|
export declare class ShopPayout extends Payout {
|
|
31
31
|
payoutType: PayoutType.SHOP;
|
|
@@ -35,9 +35,9 @@ class ShopPayoutBreakdown {
|
|
|
35
35
|
addCreditToShop;
|
|
36
36
|
shopSelfDelivery;
|
|
37
37
|
vat;
|
|
38
|
-
|
|
38
|
+
shopPayout;
|
|
39
39
|
shopSelfCashInHand;
|
|
40
|
-
|
|
40
|
+
totalPayout;
|
|
41
41
|
}
|
|
42
42
|
exports.ShopPayoutBreakdown = ShopPayoutBreakdown;
|
|
43
43
|
__decorate([
|
|
@@ -119,7 +119,7 @@ __decorate([
|
|
|
119
119
|
__decorate([
|
|
120
120
|
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
121
121
|
__metadata("design:type", Number)
|
|
122
|
-
], ShopPayoutBreakdown.prototype, "
|
|
122
|
+
], ShopPayoutBreakdown.prototype, "shopPayout", void 0);
|
|
123
123
|
__decorate([
|
|
124
124
|
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
125
125
|
__metadata("design:type", Number)
|
|
@@ -127,7 +127,7 @@ __decorate([
|
|
|
127
127
|
__decorate([
|
|
128
128
|
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
129
129
|
__metadata("design:type", Number)
|
|
130
|
-
], ShopPayoutBreakdown.prototype, "
|
|
130
|
+
], ShopPayoutBreakdown.prototype, "totalPayout", void 0);
|
|
131
131
|
class ShopPayout extends payout_model_1.Payout {
|
|
132
132
|
payoutType = enum_1.PayoutType.SHOP;
|
|
133
133
|
parent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shop-payout.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/shop-payout.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAwD;AACxD,kDAAyC;AACzC,kDAAyC;AACzC,8CAAqC;AAErC,MAAa,mBAAmB;IAE/B,mBAAmB,CAAU;IAG7B,QAAQ,CAAS;IAGjB,YAAY,CAAS;IAGrB,QAAQ,CAAS;IAGjB,MAAM,CAAS;IAGf,wBAAwB,CAAS;IAGjC,WAAW,CAAS;IAGpB,WAAW,CAAS;IAGpB,kBAAkB,CAAS;IAG3B,QAAQ,CAAS;IAGjB,sBAAsB,CAAS;IAG/B,yBAAyB,CAAS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MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;4DACX;AAGxB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;6DACV;AAGzB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;gDACvB;AAGZ;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;uDAChB;AAGnB;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;+DACR;AAG3B;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;wDACf;AAGrB,MAAa,UAAW,SAAQ,qBAAM;IAC9B,UAAU,GAAG,iBAAU,CAAC,IAAa,CAAC;IAGtC,MAAM,CAAe;IAGrB,IAAI,CAAa;IAGjB,eAAe,CAAuB;CAC7C;AAXD,gCAWC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,CAAC;;0CAChB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;wCAClB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC;8BAC3B,mBAAmB;mDAAC","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { PayoutType } from '../../../../utilities/enum';\nimport { Payout } from '../payout.model';\nimport { Parent } from '../parent.model';\nimport { Shop } from '../shop.model';\n\nexport class ShopPayoutBreakdown {\n\t@prop({ type: Number, default: 0 })\n\toriginalOrderAmount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tdiscount: number;\n\n\t@prop({ type: Number, default: 0 })\n\tloyaltyPoint: number;\n\n\t@prop({ type: Number, default: 0 })\n\tbuy1get1: number;\n\n\t@prop({ type: Number, default: 0 })\n\tcoupon: number;\n\n\t@prop({ type: Number, default: 0 })\n\tcompanyMarketingCashback: number;\n\n\t@prop({ type: Number, default: 0 })\n\torderAmount: number;\n\n\t@prop({ type: Number, default: 0 })\n\tcompanyFees: number;\n\n\t@prop({ type: Number, default: 0 })\n\tfreeDeliveryByShop: number;\n\n\t@prop({ type: Number, default: 0 })\n\tfeatured: number;\n\n\t@prop({ type: Number, default: 0 })\n\treplacementOrderByShop: number;\n\n\t@prop({ type: Number, default: 0 })\n\treplacementOrderByCompany: number;\n\n\t@prop({ type: Number, default: 0 })\n\tendorseLossByShopForItems: number;\n\n\t@prop({ type: Number, default: 0 })\n\tendorseLossByShopForDelivery: number;\n\n\t@prop({ type: Number, default: 0 })\n\trefundedAmountByShop: number;\n\n\t@prop({ type: Number, default: 0 })\n\tremoveCreditFromShop: number;\n\n\t@prop({ type: Number, default: 0 })\n\taddCreditToShop: number;\n\n\t@prop({ type: Number, default: 0 })\n\tshopSelfDelivery: number;\n\n\t@prop({ type: Number, default: 0 })\n\tvat: number;\n\n\t@prop({ type: Number, default: 0 })\n\tshopPayout: number;\n\n\t@prop({ type: Number, default: 0 })\n\tshopSelfCashInHand: number;\n\n\t@prop({ type: Number, default: 0 })\n\ttotalPayout: number;\n}\n\nexport class ShopPayout extends Payout {\n\tpublic payoutType = PayoutType.SHOP as const;\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, type: ShopPayoutBreakdown })\n\tpublic payoutBreakdown!: ShopPayoutBreakdown;\n}\n"]}
|
|
@@ -196,7 +196,7 @@ export declare const AddressSchema: z.ZodObject<{
|
|
|
196
196
|
zone?: string | import("mongoose").Types.ObjectId | undefined;
|
|
197
197
|
}>;
|
|
198
198
|
export type AddressDTO = DTO<typeof AddressSchema>;
|
|
199
|
-
export declare const UserAddressSchema: z.ZodObject<
|
|
199
|
+
export declare const UserAddressSchema: z.ZodObject<{
|
|
200
200
|
address: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
201
201
|
description: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
202
202
|
city: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
@@ -215,13 +215,13 @@ export declare const UserAddressSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
215
215
|
latitude: z.ZodNumber;
|
|
216
216
|
longitude: z.ZodNumber;
|
|
217
217
|
zone: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
218
|
-
}
|
|
218
|
+
} & {
|
|
219
219
|
addressLabel: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
220
220
|
apartment: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
221
221
|
buildingName: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
222
222
|
deliveryOption: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
223
223
|
instructions: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
224
|
-
}
|
|
224
|
+
}, "strip", z.ZodTypeAny, {
|
|
225
225
|
location: {
|
|
226
226
|
type: GeoLocationType;
|
|
227
227
|
coordinates: [number, number];
|
|
@@ -259,7 +259,7 @@ export declare const UserAddressSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
259
259
|
instructions?: string | undefined;
|
|
260
260
|
}>;
|
|
261
261
|
export type UserAddressDTO = DTO<typeof UserAddressSchema>;
|
|
262
|
-
export declare const CourierAddressSchema: z.ZodObject<
|
|
262
|
+
export declare const CourierAddressSchema: z.ZodObject<{
|
|
263
263
|
address: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
264
264
|
description: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
265
265
|
city: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
@@ -278,16 +278,16 @@ export declare const CourierAddressSchema: z.ZodObject<z.objectUtil.extendShape<
|
|
|
278
278
|
latitude: z.ZodNumber;
|
|
279
279
|
longitude: z.ZodNumber;
|
|
280
280
|
zone: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
|
|
281
|
-
}
|
|
281
|
+
} & {
|
|
282
282
|
addressLabel: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
283
283
|
apartment: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
284
284
|
buildingName: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
285
285
|
deliveryOption: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
286
286
|
instructions: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
287
|
-
}
|
|
287
|
+
} & {
|
|
288
288
|
name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
289
289
|
phoneNumber: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
290
|
-
}
|
|
290
|
+
}, "strip", z.ZodTypeAny, {
|
|
291
291
|
name: string;
|
|
292
292
|
location: {
|
|
293
293
|
type: GeoLocationType;
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Ref } from '@typegoose/typegoose';
|
|
2
|
-
import { Shop } from '../shop.model';
|
|
3
|
-
import { Order } from '../order.model';
|
|
4
|
-
declare class UsedPoint {
|
|
5
|
-
amountUsed: number;
|
|
6
|
-
dateUsed: Date;
|
|
7
|
-
}
|
|
8
|
-
export declare class LoyaltyPoint {
|
|
9
|
-
points: number;
|
|
10
|
-
dateGenerated: Date;
|
|
11
|
-
dateExpiry: Date;
|
|
12
|
-
shop?: Ref<Shop>;
|
|
13
|
-
order?: Ref<Order>;
|
|
14
|
-
usedPoints: UsedPoint[];
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
@@ -1,61 +0,0 @@
|
|
|
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.LoyaltyPoint = void 0;
|
|
13
|
-
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
|
-
const shop_model_1 = require("../shop.model");
|
|
15
|
-
const order_model_1 = require("../order.model");
|
|
16
|
-
class UsedPoint {
|
|
17
|
-
amountUsed;
|
|
18
|
-
dateUsed;
|
|
19
|
-
}
|
|
20
|
-
__decorate([
|
|
21
|
-
(0, typegoose_1.prop)({ required: true }),
|
|
22
|
-
__metadata("design:type", Number)
|
|
23
|
-
], UsedPoint.prototype, "amountUsed", void 0);
|
|
24
|
-
__decorate([
|
|
25
|
-
(0, typegoose_1.prop)({ required: true }),
|
|
26
|
-
__metadata("design:type", Date)
|
|
27
|
-
], UsedPoint.prototype, "dateUsed", void 0);
|
|
28
|
-
class LoyaltyPoint {
|
|
29
|
-
points;
|
|
30
|
-
dateGenerated;
|
|
31
|
-
dateExpiry;
|
|
32
|
-
shop;
|
|
33
|
-
order;
|
|
34
|
-
usedPoints;
|
|
35
|
-
}
|
|
36
|
-
exports.LoyaltyPoint = LoyaltyPoint;
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, typegoose_1.prop)({ required: true }),
|
|
39
|
-
__metadata("design:type", Number)
|
|
40
|
-
], LoyaltyPoint.prototype, "points", void 0);
|
|
41
|
-
__decorate([
|
|
42
|
-
(0, typegoose_1.prop)({ required: true }),
|
|
43
|
-
__metadata("design:type", Date)
|
|
44
|
-
], LoyaltyPoint.prototype, "dateGenerated", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
(0, typegoose_1.prop)({ required: true }),
|
|
47
|
-
__metadata("design:type", Date)
|
|
48
|
-
], LoyaltyPoint.prototype, "dateExpiry", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, typegoose_1.prop)({ ref: () => shop_model_1.Shop, required: true }),
|
|
51
|
-
__metadata("design:type", Object)
|
|
52
|
-
], LoyaltyPoint.prototype, "shop", void 0);
|
|
53
|
-
__decorate([
|
|
54
|
-
(0, typegoose_1.prop)({ ref: () => order_model_1.Order, required: true }),
|
|
55
|
-
__metadata("design:type", Object)
|
|
56
|
-
], LoyaltyPoint.prototype, "order", void 0);
|
|
57
|
-
__decorate([
|
|
58
|
-
(0, typegoose_1.prop)({ type: () => [UsedPoint], default: [] }),
|
|
59
|
-
__metadata("design:type", Array)
|
|
60
|
-
], LoyaltyPoint.prototype, "usedPoints", void 0);
|
|
61
|
-
//# sourceMappingURL=loyaltyPoint.model.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loyaltyPoint.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/loyaltyPoint.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,oDAAiD;AACjD,8CAAqC;AACrC,gDAAuC;AAEvC,MAAM,SAAS;IAEP,UAAU,CAAU;IAGpB,QAAQ,CAAQ;CACvB;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACE;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACP,IAAI;2CAAC;AAGxB,MAAa,YAAY;IAEjB,MAAM,CAAU;IAGhB,aAAa,CAAQ;IAGrB,UAAU,CAAQ;IAGlB,IAAI,CAAa;IAGjB,KAAK,CAAc;IAEnB,UAAU,CAAe;CAChC;AAjBD,oCAiBC;AAfO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACF;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACF,IAAI;mDAAC;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACL,IAAI;gDAAC;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CAClB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACjB;AAEnB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;gDACf","sourcesContent":["// loyaltyPoint.model.ts\nimport { prop, Ref } from '@typegoose/typegoose';\nimport { Shop } from '../shop.model';\nimport { Order } from '../order.model';\n\nclass UsedPoint {\n\t@prop({ required: true })\n\tpublic amountUsed!: number;\n\n\t@prop({ required: true })\n\tpublic dateUsed!: Date;\n}\n\nexport class LoyaltyPoint {\n\t@prop({ required: true })\n\tpublic points!: number;\n\n\t@prop({ required: true })\n\tpublic dateGenerated!: Date;\n\n\t@prop({ required: true })\n\tpublic dateExpiry!: Date;\n\n\t@prop({ ref: () => Shop, required: true })\n\tpublic shop?: Ref<Shop>;\n\n\t@prop({ ref: () => Order, required: true })\n\tpublic order?: Ref<Order>;\n\t@prop({ type: () => [UsedPoint], default: [] })\n\tpublic usedPoints!: UsedPoint[];\n}\n"]}
|