@lyxa.ai/core 1.0.20 → 1.0.22
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/index.js.map +1 -1
- package/dist/libraries/logger/index.d.ts +2 -0
- package/dist/libraries/logger/index.js +17 -1
- package/dist/libraries/logger/index.js.map +1 -1
- package/dist/libraries/mongo/index.js +49 -16
- package/dist/libraries/mongo/index.js.map +1 -1
- package/dist/libraries/mongo/models/cart-participant.model.d.ts +2 -2
- package/dist/libraries/mongo/models/cart-participant.model.js +2 -2
- package/dist/libraries/mongo/models/cart-participant.model.js.map +1 -1
- package/dist/libraries/mongo/models/cart.model.d.ts +5 -7
- package/dist/libraries/mongo/models/cart.model.js +22 -31
- package/dist/libraries/mongo/models/cart.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/line-item-attribute.model.d.ts +7 -0
- package/dist/libraries/mongo/models/embedded/line-item-attribute.model.js +29 -0
- package/dist/libraries/mongo/models/embedded/line-item-attribute.model.js.map +1 -0
- package/dist/libraries/mongo/models/embedded/order-cancel.model.d.ts +7 -0
- package/dist/libraries/mongo/models/embedded/order-cancel.model.js +34 -0
- package/dist/libraries/mongo/models/embedded/order-cancel.model.js.map +1 -0
- package/dist/libraries/mongo/models/embedded/order-pricing.model.d.ts +18 -0
- package/dist/libraries/mongo/models/embedded/order-pricing.model.js +97 -0
- package/dist/libraries/mongo/models/embedded/order-pricing.model.js.map +1 -0
- package/dist/libraries/mongo/models/embedded/payment-attempt.model.d.ts +10 -0
- package/dist/libraries/mongo/models/embedded/payment-attempt.model.js +60 -0
- package/dist/libraries/mongo/models/embedded/payment-attempt.model.js.map +1 -0
- package/dist/libraries/mongo/models/embedded/payment-infromation.model.d.ts +1 -0
- package/dist/libraries/mongo/models/embedded/payment-infromation.model.js +5 -0
- package/dist/libraries/mongo/models/embedded/payment-infromation.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/price-breakdown.model.d.ts +5 -0
- package/dist/libraries/mongo/models/embedded/price-breakdown.model.js +32 -0
- package/dist/libraries/mongo/models/embedded/price-breakdown.model.js.map +1 -0
- package/dist/libraries/mongo/models/embedded/status-timeline.model.d.ts +14 -0
- package/dist/libraries/mongo/models/embedded/status-timeline.model.js +59 -0
- package/dist/libraries/mongo/models/embedded/status-timeline.model.js.map +1 -0
- package/dist/libraries/mongo/models/index.d.ts +24 -0
- package/dist/libraries/mongo/models/index.js +26 -2
- package/dist/libraries/mongo/models/index.js.map +1 -1
- package/dist/libraries/mongo/models/line-item.model.d.ts +9 -8
- package/dist/libraries/mongo/models/line-item.model.js +17 -16
- package/dist/libraries/mongo/models/line-item.model.js.map +1 -1
- package/dist/libraries/mongo/models/order-delivery.model.d.ts +24 -0
- package/dist/libraries/mongo/models/order-delivery.model.js +119 -0
- package/dist/libraries/mongo/models/order-delivery.model.js.map +1 -0
- package/dist/libraries/mongo/models/order-payment.model.d.ts +21 -0
- package/dist/libraries/mongo/models/order-payment.model.js +96 -0
- package/dist/libraries/mongo/models/order-payment.model.js.map +1 -0
- package/dist/libraries/mongo/models/order.model.d.ts +15 -0
- package/dist/libraries/mongo/models/order.model.js +60 -7
- package/dist/libraries/mongo/models/order.model.js.map +1 -1
- package/dist/libraries/mongo/models/product.model.d.ts +5 -6
- package/dist/libraries/mongo/models/product.model.js +12 -17
- package/dist/libraries/mongo/models/product.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/courier-order.model.d.ts +23 -0
- package/dist/libraries/mongo/models/providers/courier-order.model.js +89 -0
- package/dist/libraries/mongo/models/providers/courier-order.model.js.map +1 -0
- package/dist/libraries/mongo/models/providers/regular-order.model.d.ts +23 -0
- package/dist/libraries/mongo/models/providers/regular-order.model.js +85 -0
- package/dist/libraries/mongo/models/providers/regular-order.model.js.map +1 -0
- package/dist/libraries/mongo/models/rating-setting.model.d.ts +1 -0
- package/dist/libraries/mongo/models/rating-setting.model.js +11 -2
- package/dist/libraries/mongo/models/rating-setting.model.js.map +1 -1
- package/dist/libraries/mongo/models/shared/address.model.d.ts +4 -0
- package/dist/libraries/mongo/models/shared/address.model.js +14 -1
- package/dist/libraries/mongo/models/shared/address.model.js.map +1 -1
- package/dist/libraries/mongo/models/shared/work-hour.model.js +1 -1
- package/dist/libraries/mongo/models/shared/work-hour.model.js.map +1 -1
- package/dist/libraries/mongo/models/shop-access-control.model.js +10 -6
- package/dist/libraries/mongo/models/shop-access-control.model.js.map +1 -1
- package/dist/libraries/mongo/models/shop-product.model.d.ts +4 -4
- package/dist/libraries/mongo/models/shop-product.model.js +7 -7
- package/dist/libraries/mongo/models/shop-product.model.js.map +1 -1
- package/dist/libraries/mongo/models/shop.model.d.ts +1 -1
- package/dist/libraries/mongo/models/shop.model.js +2 -2
- package/dist/libraries/mongo/models/shop.model.js.map +1 -1
- package/dist/utilities/common/password.d.ts +1 -0
- package/dist/utilities/common/password.js +12 -0
- package/dist/utilities/common/password.js.map +1 -0
- package/dist/utilities/common/week.d.ts +1 -0
- package/dist/utilities/common/week.js +5 -0
- package/dist/utilities/common/week.js.map +1 -0
- package/dist/utilities/enum.d.ts +60 -10
- package/dist/utilities/enum.js +77 -19
- package/dist/utilities/enum.js.map +1 -1
- package/dist/utilities/pagination.d.ts +4 -2
- package/dist/utilities/pagination.js +42 -5
- package/dist/utilities/pagination.js.map +1 -1
- package/dist/utilities/transformers.d.ts +1 -1
- package/dist/utilities/transformers.js +0 -12
- package/dist/utilities/transformers.js.map +1 -1
- package/dist/utilities/validation/common-validation.d.ts +182 -64
- package/dist/utilities/validation/common-validation.js +24 -13
- package/dist/utilities/validation/common-validation.js.map +1 -1
- package/dist/utilities/validation/global-validation.d.ts +40 -20
- package/dist/utilities/validation/global-validation.js +6 -4
- package/dist/utilities/validation/global-validation.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,89 @@
|
|
|
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.CourierOrder = void 0;
|
|
13
|
+
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
|
+
const order_model_1 = require("../order.model");
|
|
15
|
+
const enum_1 = require("../../../../utilities/enum");
|
|
16
|
+
const address_model_1 = require("../shared/address.model");
|
|
17
|
+
const status_timeline_model_1 = require("../embedded/status-timeline.model");
|
|
18
|
+
class CourierItem {
|
|
19
|
+
productName;
|
|
20
|
+
productImage;
|
|
21
|
+
quantity;
|
|
22
|
+
unitPrice;
|
|
23
|
+
secondaryUnitPrice;
|
|
24
|
+
totalPrice;
|
|
25
|
+
secondaryTotalPrice;
|
|
26
|
+
}
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typegoose_1.prop)({ required: true }),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], CourierItem.prototype, "productName", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typegoose_1.prop)(),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], CourierItem.prototype, "productImage", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typegoose_1.prop)({ required: true, min: 1 }),
|
|
37
|
+
__metadata("design:type", Number)
|
|
38
|
+
], CourierItem.prototype, "quantity", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typegoose_1.prop)(),
|
|
41
|
+
__metadata("design:type", Number)
|
|
42
|
+
], CourierItem.prototype, "unitPrice", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typegoose_1.prop)(),
|
|
45
|
+
__metadata("design:type", Number)
|
|
46
|
+
], CourierItem.prototype, "secondaryUnitPrice", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typegoose_1.prop)(),
|
|
49
|
+
__metadata("design:type", Number)
|
|
50
|
+
], CourierItem.prototype, "totalPrice", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typegoose_1.prop)(),
|
|
53
|
+
__metadata("design:type", Number)
|
|
54
|
+
], CourierItem.prototype, "secondaryTotalPrice", void 0);
|
|
55
|
+
class CourierOrder extends order_model_1.Order {
|
|
56
|
+
orderType = enum_1.OrderType.COURIER;
|
|
57
|
+
status;
|
|
58
|
+
statusTimeline;
|
|
59
|
+
courierType;
|
|
60
|
+
pickupLocation;
|
|
61
|
+
deliveryLocation;
|
|
62
|
+
items;
|
|
63
|
+
}
|
|
64
|
+
exports.CourierOrder = CourierOrder;
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.CourierOrderStatus, default: enum_1.CourierOrderStatus.PLACED }),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], CourierOrder.prototype, "status", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typegoose_1.prop)({ type: () => [status_timeline_model_1.CourierOrderStatusTimeline], default: [] }),
|
|
71
|
+
__metadata("design:type", Array)
|
|
72
|
+
], CourierOrder.prototype, "statusTimeline", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typegoose_1.prop)({ required: true, type: String, enum: enum_1.CourierServiceType }),
|
|
75
|
+
__metadata("design:type", String)
|
|
76
|
+
], CourierOrder.prototype, "courierType", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typegoose_1.prop)({ required: true, type: () => address_model_1.CourierAddress }),
|
|
79
|
+
__metadata("design:type", address_model_1.CourierAddress)
|
|
80
|
+
], CourierOrder.prototype, "pickupLocation", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, typegoose_1.prop)({ required: true, type: address_model_1.CourierAddress }),
|
|
83
|
+
__metadata("design:type", address_model_1.CourierAddress)
|
|
84
|
+
], CourierOrder.prototype, "deliveryLocation", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, typegoose_1.prop)({ type: () => [CourierItem], default: [] }),
|
|
87
|
+
__metadata("design:type", Array)
|
|
88
|
+
], CourierOrder.prototype, "items", void 0);
|
|
89
|
+
//# sourceMappingURL=courier-order.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"courier-order.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/courier-order.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,gDAAuC;AACvC,qDAA+F;AAC/F,2DAAyD;AACzD,6EAA+E;AAE/E,MAAM,WAAW;IAEhB,WAAW,CAAS;IAGpB,YAAY,CAAU;IAGtB,QAAQ,CAAS;IAGjB,SAAS,CAAU;IAGnB,kBAAkB,CAAU;IAG5B,UAAU,CAAU;IAGpB,mBAAmB,CAAU;CAC7B;AAnBA;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACL;AAGpB;IADC,IAAA,gBAAI,GAAE;;iDACe;AAGtB;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;6CAChB;AAGjB;IADC,IAAA,gBAAI,GAAE;;8CACY;AAGnB;IADC,IAAA,gBAAI,GAAE;;uDACqB;AAG5B;IADC,IAAA,gBAAI,GAAE;;+CACa;AAGpB;IADC,IAAA,gBAAI,GAAE;;wDACsB;AAG9B,MAAa,YAAa,SAAQ,mBAAK;IAC/B,SAAS,GAAG,gBAAS,CAAC,OAAgB,CAAC;IAGvC,MAAM,CAAsB;IAG5B,cAAc,CAA+B;IAGpD,WAAW,CAAsB;IAGjC,cAAc,CAAkB;IAGhC,gBAAgB,CAAkB;IAGlC,KAAK,CAAiB;CACtB;AApBD,oCAoBC;AAhBO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAkB,EAAE,OAAO,EAAE,yBAAkB,CAAC,MAAM,EAAE,CAAC;;4CAClD;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,kDAA0B,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;oDACZ;AAGpD;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAkB,EAAE,CAAC;;iDAChC;AAGjC;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,8BAAc,EAAE,CAAC;8BACpC,8BAAc;oDAAC;AAGhC;IADC,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,8BAAc,EAAE,CAAC;8BAC5B,8BAAc;sDAAC;AAGlC;IADC,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;2CAC3B","sourcesContent":["import { prop } from '@typegoose/typegoose';\r\nimport { Order } from '../order.model';\r\nimport { CourierOrderStatus, CourierServiceType, OrderType } from '../../../../utilities/enum';\r\nimport { CourierAddress } from '../shared/address.model';\r\nimport { CourierOrderStatusTimeline } from '../embedded/status-timeline.model';\r\n\r\nclass CourierItem {\r\n\t@prop({ required: true })\r\n\tproductName: string;\r\n\r\n\t@prop()\r\n\tproductImage?: string;\r\n\r\n\t@prop({ required: true, min: 1 })\r\n\tquantity: number;\r\n\r\n\t@prop()\r\n\tunitPrice?: number;\r\n\r\n\t@prop()\r\n\tsecondaryUnitPrice?: number;\r\n\r\n\t@prop()\r\n\ttotalPrice?: number;\r\n\r\n\t@prop()\r\n\tsecondaryTotalPrice?: number;\r\n}\r\n\r\nexport class CourierOrder extends Order {\r\n\tpublic orderType = OrderType.COURIER as const;\r\n\r\n\t@prop({ type: String, enum: CourierOrderStatus, default: CourierOrderStatus.PLACED })\r\n\tpublic status?: CourierOrderStatus;\r\n\r\n\t@prop({ type: () => [CourierOrderStatusTimeline], default: [] })\r\n\tpublic statusTimeline: CourierOrderStatusTimeline[];\r\n\r\n\t@prop({ required: true, type: String, enum: CourierServiceType })\r\n\tcourierType!: CourierServiceType;\r\n\r\n\t@prop({ required: true, type: () => CourierAddress })\r\n\tpickupLocation!: CourierAddress;\r\n\r\n\t@prop({ required: true, type: CourierAddress })\r\n\tdeliveryLocation!: CourierAddress;\r\n\r\n\t@prop({ type: () => [CourierItem], default: [] })\r\n\titems?: CourierItem[];\r\n}\r\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Ref } from '@typegoose/typegoose';
|
|
2
|
+
import { Order } from '../order.model';
|
|
3
|
+
import { OrderType } from '../../../../utilities/enum';
|
|
4
|
+
import { Parent } from '../parent.model';
|
|
5
|
+
import { Shop } from '../shop.model';
|
|
6
|
+
import { Cart } from '../cart.model';
|
|
7
|
+
import { Address, UserAddress } from '../shared/address.model';
|
|
8
|
+
import { RegularOrderStatusTimeline } from '../embedded/status-timeline.model';
|
|
9
|
+
export declare class RegularOrder extends Order {
|
|
10
|
+
orderType: OrderType.REGULAR;
|
|
11
|
+
status?: string;
|
|
12
|
+
statusTimeline: RegularOrderStatusTimeline[];
|
|
13
|
+
itemType?: string;
|
|
14
|
+
pickupLocation: Address;
|
|
15
|
+
deliveryLocation: UserAddress;
|
|
16
|
+
parent?: Ref<Parent>;
|
|
17
|
+
shop?: Ref<Shop>;
|
|
18
|
+
cart?: Ref<Cart>;
|
|
19
|
+
isShopDelivery?: boolean;
|
|
20
|
+
preparingTimeInMinutes?: number;
|
|
21
|
+
isReplacementOrder?: boolean;
|
|
22
|
+
originalOrderForReplacement?: Ref<Order>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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.RegularOrder = void 0;
|
|
13
|
+
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
|
+
const order_model_1 = require("../order.model");
|
|
15
|
+
const enum_1 = require("../../../../utilities/enum");
|
|
16
|
+
const parent_model_1 = require("../parent.model");
|
|
17
|
+
const shop_model_1 = require("../shop.model");
|
|
18
|
+
const cart_model_1 = require("../cart.model");
|
|
19
|
+
const address_model_1 = require("../shared/address.model");
|
|
20
|
+
const status_timeline_model_1 = require("../embedded/status-timeline.model");
|
|
21
|
+
class RegularOrder extends order_model_1.Order {
|
|
22
|
+
orderType = enum_1.OrderType.REGULAR;
|
|
23
|
+
status;
|
|
24
|
+
statusTimeline;
|
|
25
|
+
itemType;
|
|
26
|
+
pickupLocation;
|
|
27
|
+
deliveryLocation;
|
|
28
|
+
parent;
|
|
29
|
+
shop;
|
|
30
|
+
cart;
|
|
31
|
+
isShopDelivery;
|
|
32
|
+
preparingTimeInMinutes;
|
|
33
|
+
isReplacementOrder;
|
|
34
|
+
originalOrderForReplacement;
|
|
35
|
+
}
|
|
36
|
+
exports.RegularOrder = RegularOrder;
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.RegularOrderStatus, default: enum_1.RegularOrderStatus.PLACED }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], RegularOrder.prototype, "status", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typegoose_1.prop)({ type: () => [status_timeline_model_1.RegularOrderStatusTimeline], default: [] }),
|
|
43
|
+
__metadata("design:type", Array)
|
|
44
|
+
], RegularOrder.prototype, "statusTimeline", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.ItemType, default: enum_1.ItemType.FOOD }),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], RegularOrder.prototype, "itemType", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typegoose_1.prop)({ required: true, type: address_model_1.Address }),
|
|
51
|
+
__metadata("design:type", address_model_1.Address)
|
|
52
|
+
], RegularOrder.prototype, "pickupLocation", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typegoose_1.prop)({ required: true, type: address_model_1.UserAddress }),
|
|
55
|
+
__metadata("design:type", address_model_1.UserAddress)
|
|
56
|
+
], RegularOrder.prototype, "deliveryLocation", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typegoose_1.prop)({ ref: () => parent_model_1.Parent }),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], RegularOrder.prototype, "parent", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typegoose_1.prop)({ ref: () => shop_model_1.Shop }),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], RegularOrder.prototype, "shop", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typegoose_1.prop)({ ref: () => cart_model_1.Cart }),
|
|
67
|
+
__metadata("design:type", Object)
|
|
68
|
+
], RegularOrder.prototype, "cart", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
71
|
+
__metadata("design:type", Boolean)
|
|
72
|
+
], RegularOrder.prototype, "isShopDelivery", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
75
|
+
__metadata("design:type", Number)
|
|
76
|
+
], RegularOrder.prototype, "preparingTimeInMinutes", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
79
|
+
__metadata("design:type", Boolean)
|
|
80
|
+
], RegularOrder.prototype, "isReplacementOrder", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, typegoose_1.prop)({ ref: () => order_model_1.Order }),
|
|
83
|
+
__metadata("design:type", Object)
|
|
84
|
+
], RegularOrder.prototype, "originalOrderForReplacement", void 0);
|
|
85
|
+
//# sourceMappingURL=regular-order.model.js.map
|
|
@@ -0,0 +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,qDAAqF;AACrF,kDAAyC;AACzC,8CAAqC;AACrC,8CAAqC;AACrC,2DAA+D;AAC/D,6EAA+E;AAE/E,MAAa,YAAa,SAAQ,mBAAK;IAC/B,SAAS,GAAG,gBAAS,CAAC,OAAgB,CAAC;IAGvC,MAAM,CAAU;IAGhB,cAAc,CAA+B;IAGpD,QAAQ,CAAU;IAGlB,cAAc,CAAU;IAGxB,gBAAgB,CAAc;IAG9B,MAAM,CAAe;IAGrB,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E,CAAC,EAAE,CAAC;;4DACI;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;wDACJ;AAG7B;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;iEACqB","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\r\nimport { Order } from '../order.model';\r\nimport { ItemType, OrderType, RegularOrderStatus } from '../../../../utilities/enum';\r\nimport { Parent } from '../parent.model';\r\nimport { Shop } from '../shop.model';\r\nimport { Cart } from '../cart.model';\r\nimport { Address, UserAddress } from '../shared/address.model';\r\nimport { RegularOrderStatusTimeline } from '../embedded/status-timeline.model';\r\n\r\nexport class RegularOrder extends Order {\r\n\tpublic orderType = OrderType.REGULAR as const;\r\n\r\n\t@prop({ type: String, enum: RegularOrderStatus, default: RegularOrderStatus.PLACED })\r\n\tpublic status?: string;\r\n\r\n\t@prop({ type: () => [RegularOrderStatusTimeline], default: [] })\r\n\tpublic statusTimeline: RegularOrderStatusTimeline[];\r\n\r\n\t@prop({ type: String, enum: ItemType, default: ItemType.FOOD })\r\n\titemType?: string;\r\n\r\n\t@prop({ required: true, type: Address })\r\n\tpickupLocation: Address;\r\n\r\n\t@prop({ required: true, type: UserAddress })\r\n\tdeliveryLocation: UserAddress;\r\n\r\n\t@prop({ ref: () => Parent })\r\n\tparent?: Ref<Parent>;\r\n\r\n\t@prop({ ref: () => Shop })\r\n\tshop?: Ref<Shop>;\r\n\r\n\t@prop({ ref: () => Cart })\r\n\tcart?: Ref<Cart>;\r\n\r\n\t@prop({ type: Boolean, default: false })\r\n\tpublic isShopDelivery?: boolean;\r\n\r\n\t@prop({ type: Number, default: 0 })\r\n\tpublic preparingTimeInMinutes?: number;\r\n\r\n\t@prop({ type: Boolean, default: false })\r\n\tpublic isReplacementOrder?: boolean;\r\n\r\n\t@prop({ ref: () => Order })\r\n\tpublic originalOrderForReplacement?: Ref<Order>;\r\n}\r\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
2
2
|
import { RatingAccountType } from '../../../utilities/enum';
|
|
3
3
|
export declare class RatingSetting extends TimeStamps {
|
|
4
|
+
title?: string;
|
|
4
5
|
rating: number;
|
|
5
6
|
tags: string[];
|
|
6
7
|
accountType: RatingAccountType;
|
|
@@ -14,13 +14,18 @@ const typegoose_1 = require("@typegoose/typegoose");
|
|
|
14
14
|
const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
15
15
|
const enum_1 = require("../../../utilities/enum");
|
|
16
16
|
let RatingSetting = class RatingSetting extends defaultClasses_1.TimeStamps {
|
|
17
|
+
title;
|
|
17
18
|
rating;
|
|
18
19
|
tags;
|
|
19
20
|
accountType;
|
|
20
21
|
};
|
|
21
22
|
exports.RatingSetting = RatingSetting;
|
|
22
23
|
__decorate([
|
|
23
|
-
(0, typegoose_1.prop)({
|
|
24
|
+
(0, typegoose_1.prop)({ type: String }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], RatingSetting.prototype, "title", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typegoose_1.prop)({ required: true, type: Number, min: 1, max: 5 }),
|
|
24
29
|
__metadata("design:type", Number)
|
|
25
30
|
], RatingSetting.prototype, "rating", void 0);
|
|
26
31
|
__decorate([
|
|
@@ -32,6 +37,10 @@ __decorate([
|
|
|
32
37
|
__metadata("design:type", String)
|
|
33
38
|
], RatingSetting.prototype, "accountType", void 0);
|
|
34
39
|
exports.RatingSetting = RatingSetting = __decorate([
|
|
35
|
-
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'ratingSettings' } })
|
|
40
|
+
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'ratingSettings' } }),
|
|
41
|
+
(0, typegoose_1.Index)({ rating: 1, accountType: 1 }, {
|
|
42
|
+
unique: true,
|
|
43
|
+
partialFilterExpression: { deletedAt: null },
|
|
44
|
+
})
|
|
36
45
|
], RatingSetting);
|
|
37
46
|
//# sourceMappingURL=rating-setting.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rating-setting.model.js","sourceRoot":"/","sources":["libraries/mongo/models/rating-setting.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"rating-setting.model.js","sourceRoot":"/","sources":["libraries/mongo/models/rating-setting.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiE;AACjE,4EAAqE;AACrE,kDAA4D;AAUrD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,2BAAU;IAErC,KAAK,CAAU;IAGf,MAAM,CAAU;IAGhB,IAAI,CAAY;IAGhB,WAAW,CAAqB;CACvC,CAAA;AAZY,sCAAa;AAElB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CACD;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;6CAChC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;;2CACxB;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAiB,EAAE,CAAC;;kDACzB;wBAX3B,aAAa;IARzB,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,gBAAgB,EAAE,EAAE,CAAC;IACjE,IAAA,iBAAK,EACL,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,EAC7B;QACC,MAAM,EAAE,IAAI;QACZ,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;KAC5C,CACD;GACY,aAAa,CAYzB","sourcesContent":["import { Index, modelOptions, prop } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { RatingAccountType } from '../../../utilities/enum';\r\n\r\n@modelOptions({ schemaOptions: { collection: 'ratingSettings' } })\r\n@Index(\r\n\t{ rating: 1, accountType: 1 },\r\n\t{\r\n\t\tunique: true,\r\n\t\tpartialFilterExpression: { deletedAt: null },\r\n\t}\r\n)\r\nexport class RatingSetting extends TimeStamps {\r\n\t@prop({ type: String })\r\n\tpublic title?: string;\r\n\r\n\t@prop({ required: true, type: Number, min: 1, max: 5 })\r\n\tpublic rating!: number;\r\n\r\n\t@prop({ required: true, type: () => [String] })\r\n\tpublic tags!: string[];\r\n\r\n\t@prop({ required: true, type: String, enum: RatingAccountType })\r\n\tpublic accountType!: RatingAccountType;\r\n}\r\n"]}
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.UserAddress = exports.Address = void 0;
|
|
12
|
+
exports.CourierAddress = exports.UserAddress = exports.Address = void 0;
|
|
13
13
|
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
14
|
const geo_location_model_1 = require("./geo-location.model");
|
|
15
15
|
let Address = class Address {
|
|
@@ -86,4 +86,17 @@ __decorate([
|
|
|
86
86
|
(0, typegoose_1.prop)({ type: String }),
|
|
87
87
|
__metadata("design:type", String)
|
|
88
88
|
], UserAddress.prototype, "instructions", void 0);
|
|
89
|
+
class CourierAddress extends UserAddress {
|
|
90
|
+
name;
|
|
91
|
+
phonenumber;
|
|
92
|
+
}
|
|
93
|
+
exports.CourierAddress = CourierAddress;
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, typegoose_1.prop)({ type: String }),
|
|
96
|
+
__metadata("design:type", String)
|
|
97
|
+
], CourierAddress.prototype, "name", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, typegoose_1.prop)({ required: true, type: String }),
|
|
100
|
+
__metadata("design:type", String)
|
|
101
|
+
], CourierAddress.prototype, "phonenumber", void 0);
|
|
89
102
|
//# sourceMappingURL=address.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shared/address.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AAEjD,6DAAiD;AAG1C,IAAM,OAAO,GAAb,MAAM,OAAO;IAEZ,OAAO,CAAU;IAGjB,WAAW,CAAU;IAGrB,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,OAAO,CAAU;IAGjB,QAAQ,CAAe;IAGvB,QAAQ,CAAU;IAGlB,SAAS,CAAU;CAC1B,CAAA;AAxBY,0BAAO;AAEZ;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCACf;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CACK;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qCAClB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sCACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCACf;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,gCAAW,EAAE,CAAC;8BACV,gCAAW;yCAAC;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCACd;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;0CACb;kBAvBd,OAAO;IADnB,IAAA,iBAAK,EAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;GACnB,OAAO,CAwBnB;AAED,MAAa,WAAY,SAAQ,OAAO;IAEhC,YAAY,CAAU;IAGtB,SAAS,CAAU;IAGnB,YAAY,CAAU;IAGtB,cAAc,CAAU;IAGxB,YAAY,CAAU;CAC7B;AAfD,kCAeC;AAbO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDACV;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CACb;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDACV;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mDACQ;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDACM","sourcesContent":["import {index, prop} from '@typegoose/typegoose';\r\nimport { GeoLocationType } from '../../../../utilities/enum';\r\nimport {GeoLocation} from \"./geo-location.model\";\r\n\r\n@index({ location: '2dsphere' })\r\nexport class Address {\r\n\t@prop({ required: true, type: String })\r\n\tpublic address!: string;\r\n\r\n\t@prop({ type: String })\r\n\tpublic description?: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic city!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic state!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic country!: string;\r\n\r\n\t@prop({ type: GeoLocation })\r\n\tpublic location!: GeoLocation;\r\n\r\n\t@prop({ required: true, type: Number })\r\n\tpublic latitude!: number;\r\n\r\n\t@prop({ required: true, type: Number })\r\n\tpublic longitude!: number;\r\n}\r\n\r\nexport class UserAddress extends Address {\r\n\t@prop({ required: true, type: String })\r\n\tpublic addressLabel!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic apartment!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic buildingName!: string;\r\n\r\n\t@prop({ type: String })\r\n\tpublic deliveryOption?: string;\r\n\r\n\t@prop({ type: String })\r\n\tpublic instructions?: string;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"address.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shared/address.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AAEjD,6DAAiD;AAG1C,IAAM,OAAO,GAAb,MAAM,OAAO;IAEZ,OAAO,CAAU;IAGjB,WAAW,CAAU;IAGrB,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,OAAO,CAAU;IAGjB,QAAQ,CAAe;IAGvB,QAAQ,CAAU;IAGlB,SAAS,CAAU;CAC1B,CAAA;AAxBY,0BAAO;AAEZ;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCACf;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CACK;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qCAClB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sCACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCAC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CAAC;;mDACZ","sourcesContent":["import {index, prop} from '@typegoose/typegoose';\r\nimport { GeoLocationType } from '../../../../utilities/enum';\r\nimport {GeoLocation} from \"./geo-location.model\";\r\n\r\n@index({ location: '2dsphere' })\r\nexport class Address {\r\n\t@prop({ required: true, type: String })\r\n\tpublic address!: string;\r\n\r\n\t@prop({ type: String })\r\n\tpublic description?: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic city!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic state!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic country!: string;\r\n\r\n\t@prop({ type: GeoLocation })\r\n\tpublic location!: GeoLocation;\r\n\r\n\t@prop({ required: true, type: Number })\r\n\tpublic latitude!: number;\r\n\r\n\t@prop({ required: true, type: Number })\r\n\tpublic longitude!: number;\r\n}\r\n\r\nexport class UserAddress extends Address {\r\n\t@prop({ required: true, type: String })\r\n\tpublic addressLabel!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic apartment!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic buildingName!: string;\r\n\r\n\t@prop({ type: String })\r\n\tpublic deliveryOption?: string;\r\n\r\n\t@prop({ type: String })\r\n\tpublic instructions?: string;\r\n}\r\n\r\nexport class CourierAddress extends UserAddress {\r\n\t@prop({ type: String })\r\n\tpublic name: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic phonenumber: string;\r\n}\r\n"]}
|
|
@@ -31,7 +31,7 @@ class NormalHour {
|
|
|
31
31
|
}
|
|
32
32
|
exports.NormalHour = NormalHour;
|
|
33
33
|
__decorate([
|
|
34
|
-
(0, typegoose_1.prop)({ required: true,
|
|
34
|
+
(0, typegoose_1.prop)({ required: true, type: Number, enum: enum_1.WeekDay }),
|
|
35
35
|
__metadata("design:type", Number)
|
|
36
36
|
], NormalHour.prototype, "day", void 0);
|
|
37
37
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-hour.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shared/work-hour.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,qDAAoF;AAEpF,MAAM,YAAY;IAEV,KAAK,CAAU;IAGf,GAAG,CAAU;CACpB;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCACnB;AAGrB,MAAa,UAAU;IAEf,GAAG,CAAW;IAGd,MAAM,CAAc;IAGpB,YAAY,CAAkB;CACrC;AATD,gCASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"work-hour.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shared/work-hour.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,qDAAoF;AAEpF,MAAM,YAAY;IAEV,KAAK,CAAU;IAGf,GAAG,CAAU;CACpB;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCACnB;AAGrB,MAAa,UAAU;IAEf,GAAG,CAAW;IAGd,MAAM,CAAc;IAGpB,YAAY,CAAkB;CACrC;AATD,gCASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAO,EAAE,CAAC;;uCACjC;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAU,EAAE,CAAC;;0CAC9B;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;gDACb;AAGtC,MAAa,WAAW;IAEhB,IAAI,CAAQ;IAOZ,MAAM,CAAqB;IAG3B,WAAW,CAAgB;CAClC;AAbD,kCAaC;AAXO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;8BACvB,IAAI;yCAAC;AAOZ;IALN,IAAA,gBAAI,EAAC;QACL,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,wBAAiB;KACvB,CAAC;;2CACgC;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BACR,YAAY;gDAAC;AAGnC,MAAa,eAAe;IAEpB,WAAW,CAAgB;IAG3B,YAAY,CAAiB;CACpC;AAND,0CAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;oDACd;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;qDACb","sourcesContent":["import { prop } from '@typegoose/typegoose';\r\nimport { HolidayWorkStatus, WeekDay, WorkStatus } from '../../../../utilities/enum';\r\n\r\nclass StartEndTime {\r\n\t@prop({ required: true, type: String })\r\n\tpublic start!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic end!: string;\r\n}\r\n\r\nexport class NormalHour {\r\n\t@prop({ required: true, type: Number, enum: WeekDay })\r\n\tpublic day!: WeekDay;\r\n\r\n\t@prop({ required: true, type: String, enum: WorkStatus })\r\n\tpublic status!: WorkStatus;\r\n\r\n\t@prop({ type: () => [StartEndTime], default: [] })\r\n\tpublic openingHours?: StartEndTime[];\r\n}\r\n\r\nexport class HolidayHour {\r\n\t@prop({ required: true, type: Date })\r\n\tpublic date?: Date;\r\n\r\n\t@prop({\r\n\t\trequired: true,\r\n\t\ttype: String,\r\n\t\tenum: HolidayWorkStatus,\r\n\t})\r\n\tpublic status!: HolidayWorkStatus;\r\n\r\n\t@prop({ type: StartEndTime })\r\n\tpublic closingHour?: StartEndTime;\r\n}\r\n\r\nexport class WorkHourSetting {\r\n\t@prop({ type: () => [NormalHour], default: [] })\r\n\tpublic normalHours?: NormalHour[];\r\n\r\n\t@prop({ type: () => [HolidayHour], default: [] })\r\n\tpublic holidayHours?: HolidayHour[];\r\n}\r\n"]}
|
|
@@ -8,17 +8,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.ShopAccessControl = void 0;
|
|
16
13
|
const typegoose_1 = require("@typegoose/typegoose");
|
|
17
14
|
const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
18
|
-
const bcryptjs_1 = __importDefault(require("bcryptjs"));
|
|
19
15
|
const enum_1 = require("../../../utilities/enum");
|
|
20
16
|
const parent_model_1 = require("./parent.model");
|
|
21
17
|
const shop_model_1 = require("./shop.model");
|
|
18
|
+
const password_1 = require("../../../utilities/common/password");
|
|
22
19
|
let ShopAccessControl = class ShopAccessControl extends defaultClasses_1.TimeStamps {
|
|
23
20
|
email;
|
|
24
21
|
password;
|
|
@@ -50,8 +47,15 @@ __decorate([
|
|
|
50
47
|
exports.ShopAccessControl = ShopAccessControl = __decorate([
|
|
51
48
|
(0, typegoose_1.pre)('save', async function (next) {
|
|
52
49
|
if (this.isModified('password')) {
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
this.password = await (0, password_1.hashPassword)(this.password);
|
|
51
|
+
}
|
|
52
|
+
next();
|
|
53
|
+
}),
|
|
54
|
+
(0, typegoose_1.pre)('findOneAndUpdate', async function (next) {
|
|
55
|
+
const update = this.getUpdate();
|
|
56
|
+
if (update?.password) {
|
|
57
|
+
update.password = await (0, password_1.hashPassword)(update.password);
|
|
58
|
+
this.setUpdate(update);
|
|
55
59
|
}
|
|
56
60
|
next();
|
|
57
61
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shop-access-control.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shop-access-control.model.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shop-access-control.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shop-access-control.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoE;AACpE,4EAAqE;AAErE,kDAAmD;AACnD,iDAAwC;AACxC,6CAAoC;AACpC,iEAAkE;AAiB3D,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,2BAAU;IAEzC,KAAK,CAAU;IAGf,QAAQ,CAAU;IAGlB,MAAM,CAAe;IAGrB,KAAK,CAAe;IAGpB,IAAI,CAAY;CACvB,CAAA;AAfY,8CAAiB;AAEtB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;gDAC/B;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mDACd;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,CAAC;;iDAChB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;gDACf;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAQ,EAAE,CAAC;;+CAChC;4BAdX,iBAAiB;IAf7B,IAAA,eAAG,EAAoB,MAAM,EAAE,KAAK,WAAW,IAAI;QACnD,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAA,uBAAY,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnD,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,eAAG,EAAgC,kBAAkB,EAAE,KAAK,WAAW,IAAI;QAC3E,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAyB,CAAC;QACvD,IAAI,MAAM,EAAE,QAAQ,EAAE,CAAC;YACtB,MAAM,CAAC,QAAQ,GAAG,MAAM,IAAA,uBAAY,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACtD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,oBAAoB,EAAE,EAAE,CAAC;GACzD,iBAAiB,CAe7B","sourcesContent":["import { modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { Query } from 'mongoose';\r\nimport { ShopRole } from '../../../utilities/enum';\r\nimport { Parent } from './parent.model';\r\nimport { Shop } from './shop.model';\r\nimport { hashPassword } from '../../../utilities/common/password';\r\n\r\n@pre<ShopAccessControl>('save', async function (next) {\r\n\tif (this.isModified('password')) {\r\n\t\tthis.password = await hashPassword(this.password);\r\n\t}\r\n\tnext();\r\n})\r\n@pre<Query<any, ShopAccessControl>>('findOneAndUpdate', async function (next) {\r\n\tconst update = this.getUpdate() as Record<string, any>;\r\n\tif (update?.password) {\r\n\t\tupdate.password = await hashPassword(update.password);\r\n\t\tthis.setUpdate(update);\r\n\t}\r\n\tnext();\r\n})\r\n@modelOptions({ schemaOptions: { collection: 'shopAccessControls' } })\r\nexport class ShopAccessControl extends TimeStamps {\r\n\t@prop({ required: true, type: String, unique: true })\r\n\tpublic email!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic password!: string;\r\n\r\n\t@prop({ required: true, ref: () => Parent })\r\n\tpublic parent!: Ref<Parent>;\r\n\r\n\t@prop({ required: true, ref: () => Shop })\r\n\tpublic shops!: Ref<Shop>[];\r\n\r\n\t@prop({ required: true, type: String, enum: ShopRole })\r\n\tpublic role!: ShopRole;\r\n}\r\n"]}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Ref } from '@typegoose/typegoose';
|
|
2
2
|
import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
3
|
-
import {
|
|
3
|
+
import { PriceOption, Status } from '../../../utilities/enum';
|
|
4
4
|
import { AttributeMap } from './embedded/attribute-map.model';
|
|
5
|
-
import {
|
|
5
|
+
import { PriceBreakdown } from './embedded/price-breakdown.model';
|
|
6
6
|
import { Product } from './product.model';
|
|
7
7
|
import { ShopCategory } from './shop-category.model';
|
|
8
8
|
import { Shop } from './shop.model';
|
|
9
9
|
export declare class ShopProduct extends TimeStamps {
|
|
10
10
|
product: Ref<Product>;
|
|
11
11
|
shop: Ref<Shop>;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
priceOption?: PriceOption;
|
|
13
|
+
priceBreakdowns?: PriceBreakdown[];
|
|
14
14
|
description?: string;
|
|
15
15
|
attributeMaps?: AttributeMap[];
|
|
16
16
|
addons?: Ref<ShopProduct>[];
|
|
@@ -14,15 +14,15 @@ const typegoose_1 = require("@typegoose/typegoose");
|
|
|
14
14
|
const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
15
15
|
const enum_1 = require("../../../utilities/enum");
|
|
16
16
|
const attribute_map_model_1 = require("./embedded/attribute-map.model");
|
|
17
|
-
const
|
|
17
|
+
const price_breakdown_model_1 = require("./embedded/price-breakdown.model");
|
|
18
18
|
const product_model_1 = require("./product.model");
|
|
19
19
|
const shop_category_model_1 = require("./shop-category.model");
|
|
20
20
|
const shop_model_1 = require("./shop.model");
|
|
21
21
|
let ShopProduct = class ShopProduct extends defaultClasses_1.TimeStamps {
|
|
22
22
|
product;
|
|
23
23
|
shop;
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
priceOption;
|
|
25
|
+
priceBreakdowns;
|
|
26
26
|
description;
|
|
27
27
|
attributeMaps;
|
|
28
28
|
addons;
|
|
@@ -45,13 +45,13 @@ __decorate([
|
|
|
45
45
|
__metadata("design:type", Object)
|
|
46
46
|
], ShopProduct.prototype, "shop", void 0);
|
|
47
47
|
__decorate([
|
|
48
|
-
(0, typegoose_1.prop)({ type: String, enum: enum_1.
|
|
48
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.PriceOption, default: enum_1.PriceOption.SINGLE_PRICE }),
|
|
49
49
|
__metadata("design:type", String)
|
|
50
|
-
], ShopProduct.prototype, "
|
|
50
|
+
], ShopProduct.prototype, "priceOption", void 0);
|
|
51
51
|
__decorate([
|
|
52
|
-
(0, typegoose_1.prop)({ required: true, type: [
|
|
52
|
+
(0, typegoose_1.prop)({ required: true, type: [price_breakdown_model_1.PriceBreakdown], min: 1 }),
|
|
53
53
|
__metadata("design:type", Array)
|
|
54
|
-
], ShopProduct.prototype, "
|
|
54
|
+
], ShopProduct.prototype, "priceBreakdowns", void 0);
|
|
55
55
|
__decorate([
|
|
56
56
|
(0, typegoose_1.prop)({ type: String }),
|
|
57
57
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shop-product.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shop-product.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"shop-product.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shop-product.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,kDAA8D;AAC9D,wEAA8D;AAC9D,4EAAkE;AAClE,mDAA0C;AAC1C,+DAAqD;AACrD,6CAAoC;AAG7B,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,2BAAU;IAEnC,OAAO,CAAgB;IAGvB,IAAI,CAAa;IAGjB,WAAW,CAAe;IAG1B,eAAe,CAAoB;IAGnC,WAAW,CAAU;IAGrB,aAAa,CAAkB;IAG/B,MAAM,CAAsB;IAG5B,MAAM,CAAU;IAGhB,YAAY,CAAqB;IAGjC,YAAY,CAAU;IAGtB,cAAc,CAAW;IAGzB,aAAa,CAAU;IAGvB,IAAI,CAAU;IAGd,eAAe,CAAW;IAG1B,kBAAkB,CAAU;CACnC,CAAA;AA7CY,kCAAW;AAEhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,uBAAO,EAAE,CAAC;;4CACf;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAI,EAAE,CAAC;;yCAClB;AAGjB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAW,EAAE,OAAO,EAAE,kBAAW,CAAC,YAAY,EAAE,CAAC;;gDAC5C;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ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AAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,CAAC;GACnD,WAAW,CA6CvB","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { PriceOption, Status } from '../../../utilities/enum';\r\nimport { AttributeMap } from './embedded/attribute-map.model';\r\nimport { PriceBreakdown } from './embedded/price-breakdown.model';\r\nimport { Product } from './product.model';\r\nimport { ShopCategory } from './shop-category.model';\r\nimport { Shop } from './shop.model';\r\n\r\n@modelOptions({ schemaOptions: { collection: 'shopProducts' } })\r\nexport class ShopProduct extends TimeStamps {\r\n\t@prop({ required: true, ref: () => Product })\r\n\tpublic product!: Ref<Product>;\r\n\r\n\t@prop({ required: true, ref: () => Shop })\r\n\tpublic shop!: Ref<Shop>;\r\n\r\n\t@prop({ type: String, enum: PriceOption, default: PriceOption.SINGLE_PRICE })\r\n\tpublic priceOption?: PriceOption;\r\n\r\n\t@prop({ required: true, type: [PriceBreakdown], min: 1 })\r\n\tpublic priceBreakdowns?: PriceBreakdown[];\r\n\r\n\t@prop({ type: String })\r\n\tpublic description?: string;\r\n\r\n\t@prop({ type: [AttributeMap], default: [] })\r\n\tpublic attributeMaps?: AttributeMap[];\r\n\r\n\t@prop({ ref: () => ShopProduct, default: [] })\r\n\tpublic addons?: Ref<ShopProduct>[];\r\n\r\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\r\n\tpublic status?: Status;\r\n\r\n\t@prop({ required: true, ref: () => ShopCategory })\r\n\tpublic shopCategory!: Ref<ShopCategory>;\r\n\r\n\t@prop({ type: Number, default: 0 })\r\n\tpublic sortingOrder?: number;\r\n\r\n\t@prop({ type: Boolean, default: false })\r\n\tpublic isStockEnabled?: boolean;\r\n\r\n\t@prop({ type: Number })\r\n\tpublic stockQuantity?: number;\r\n\r\n\t@prop({ type: String })\r\n\tpublic note?: string;\r\n\r\n\t@prop({ type: Boolean, default: false })\r\n\tpublic isDrinkIncluded?: boolean;\r\n\r\n\t@prop({ type: Number, default: 0 })\r\n\tpublic orderQuantityLimit?: number;\r\n}\r\n"]}
|
|
@@ -46,7 +46,7 @@ let Shop = class Shop extends defaultClasses_1.TimeStamps {
|
|
|
46
46
|
priceRange;
|
|
47
47
|
dietaries;
|
|
48
48
|
tags;
|
|
49
|
-
|
|
49
|
+
isShopDelivery;
|
|
50
50
|
deliveryFee;
|
|
51
51
|
minimumOrderAmount;
|
|
52
52
|
orderCapacity;
|
|
@@ -167,7 +167,7 @@ __decorate([
|
|
|
167
167
|
__decorate([
|
|
168
168
|
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
169
169
|
__metadata("design:type", Boolean)
|
|
170
|
-
], Shop.prototype, "
|
|
170
|
+
], Shop.prototype, "isShopDelivery", void 0);
|
|
171
171
|
__decorate([
|
|
172
172
|
(0, typegoose_1.prop)({ type: Number }),
|
|
173
173
|
__metadata("design:type", Number)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shop.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shop.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAyE;AACzE,4EAAqE;AACrE,kDAA6E;AAC7E,+CAAsC;AACtC,wEAA8D;AAC9D,iDAAwC;AACxC,0DAAiD;AACjD,8DAA2D;AAC3D,2CAAkC;AAClC,6CAAoC;
|
|
1
|
+
{"version":3,"file":"shop.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shop.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAyE;AACzE,4EAAqE;AACrE,kDAA6E;AAC7E,+CAAsC;AACtC,wEAA8D;AAC9D,iDAAwC;AACxC,0DAAiD;AACjD,8DAA2D;AAC3D,2CAAkC;AAClC,6CAAoC;AAO7B,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,IAAI,CAAU;IAGd,MAAM,CAAc;IAGpB,QAAQ,CAAY;IAGpB,I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GACW,IAAI,CAoHhB","sourcesContent":["import { modelOptions, prop, Ref, Severity } from '@typegoose/typegoose';\r\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\r\nimport { ItemType, ShopOnlineStatus, Status } from '../../../utilities/enum';\r\nimport { Brand } from './brand.model';\r\nimport { ShopDocument } from './embedded/shop-document.model';\r\nimport { Parent } from './parent.model';\r\nimport { Address } from './shared/address.model';\r\nimport { WorkHourSetting } from './shared/work-hour.model';\r\nimport { Tag } from './tag.model';\r\nimport { Zone } from './zone.model';\r\n\r\n\r\n@modelOptions({\r\n\tschemaOptions: { collection: 'shops' },\r\n\toptions: { allowMixed: Severity.ALLOW },\r\n})\r\nexport class Shop extends TimeStamps {\r\n\t@prop({ required: true, unique: true, type: String })\r\n\tpublic slug!: string;\r\n\r\n\t@prop({ required: true, ref: () => Parent })\r\n\tpublic parent: Ref<Parent>;\r\n\r\n\t@prop({ required: true, type: String, enum: ItemType })\r\n\tpublic itemType!: ItemType;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic name!: string;\r\n\r\n\t@prop({ required: true, ref: () => Brand })\r\n\tpublic brand: Ref<Brand>;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic ownerName!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic email!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic phoneNumber!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic userPhoneNumber!: string;\r\n\r\n\t@prop({ type: () => [String], default: [] })\r\n\tpublic additionalPhoneNumbers?: string[];\r\n\r\n\t@prop({ required: true, type: Address })\r\n\tpublic address!: Address;\r\n\r\n\t@prop({ required: true, ref: () => Zone })\r\n\tpublic zone!: Ref<Zone>;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic logo!: string;\r\n\r\n\t@prop({ required: true, type: String })\r\n\tpublic banner!: string;\r\n\r\n\t@prop({ required: true, type: ShopDocument })\r\n\tpublic document!: ShopDocument;\r\n\r\n\t@prop({ required: true, type: Boolean })\r\n\tpublic isBeirutAuthentic!: boolean;\r\n\r\n\t@prop({ required: true, type: Boolean })\r\n\tpublic isVisibleToUser!: boolean;\r\n\r\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\r\n\tpublic status!: Status;\r\n\r\n\t@prop({\r\n\t\ttype: String,\r\n\t\tenum: ShopOnlineStatus,\r\n\t\tdefault: ShopOnlineStatus.OFFLINE,\r\n\t})\r\n\tpublic onlineStatus?: ShopOnlineStatus;\r\n\r\n\t// Setting\r\n\t@prop({ type: Boolean, default: false })\r\n\tpublic allowSpecialInstructions?: boolean;\r\n\r\n\t@prop({ type: Boolean, default: false })\r\n\tpublic isRiderNoteVisible?: boolean;\r\n\r\n\t@prop({ type: String })\r\n\tpublic riderNote?: string;\r\n\r\n\t@prop({ type: Number, default: 1, min: 1, max: 4 })\r\n\tpublic priceRange?: number;\r\n\r\n\t@prop({ type: () => [String], default: [] })\r\n\tpublic dietaries?: string[];\r\n\r\n\t@prop({ ref: () => Tag, default: [] })\r\n\tpublic tags?: Ref<Tag>[];\r\n\r\n\t@prop({ type: Boolean, default: false })\r\n\tpublic isShopDelivery?: boolean;\r\n\r\n\t@prop({ type: Number })\r\n\tpublic deliveryFee?: number;\r\n\r\n\t@prop({ type: Number, default: 0 })\r\n\tpublic minimumOrderAmount?: number;\r\n\r\n\t@prop({ type: Number, default: Infinity })\r\n\tpublic orderCapacity?: number;\r\n\r\n\t@prop({ type: Number, default: 10 })\r\n\tpublic defaultPreparationTime?: number;\r\n\r\n\t@prop({ type: Number, default: null })\r\n\texchangeRate?: number;\r\n\r\n\t@prop({ type: WorkHourSetting })\r\n\tpublic workHourSetting?: WorkHourSetting;\r\n\r\n\t@prop({ required: false, type: () => Boolean })\r\n\tpublic isFavouriteCategoryVisible?: boolean;\r\n\r\n\t@prop({ required: false, type: () => String })\r\n\tpublic favouriteCategoryTitle?: string;\r\n\r\n\t@prop({ required: false, type: () => Boolean })\r\n\tpublic isBestSellerCategoryVisible?: boolean;\r\n\r\n\t@prop({ required: false, type: () => String })\r\n\tpublic bestSellerCategoryTitle?: string;\r\n\r\n\t@prop({ type: Number, default: 0 })\r\n\tpublic sortingOrder?: number;\r\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hashPassword(password: string): Promise<string>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.hashPassword = hashPassword;
|
|
7
|
+
const bcryptjs_1 = __importDefault(require("bcryptjs"));
|
|
8
|
+
async function hashPassword(password) {
|
|
9
|
+
const salt = await bcryptjs_1.default.genSalt(10);
|
|
10
|
+
return bcryptjs_1.default.hash(password, salt);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=password.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password.js","sourceRoot":"/","sources":["utilities/common/password.ts"],"names":[],"mappings":";;;;;AAEA,oCAGC;AALD,wDAA8B;AAEvB,KAAK,UAAU,YAAY,CAAC,QAAgB;IAC/C,MAAM,IAAI,GAAG,MAAM,kBAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACtC,OAAO,kBAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import bcrypt from 'bcryptjs';\r\n\r\nexport async function hashPassword(password: string): Promise<string> {\r\n const salt = await bcrypt.genSalt(10);\r\n return bcrypt.hash(password, salt);\r\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const daysOfWeek: string[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.daysOfWeek = void 0;
|
|
4
|
+
exports.daysOfWeek = Array.from({ length: 7 }, (_, i) => new Intl.DateTimeFormat('en-US', { weekday: 'long' }).format(new Date(1970, 0, 4 + i)));
|
|
5
|
+
//# sourceMappingURL=week.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"week.js","sourceRoot":"/","sources":["utilities/common/week.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACzD,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CACvF,CAAC","sourcesContent":["export const daysOfWeek = Array.from({ length: 7 }, (_, i) =>\r\n new Intl.DateTimeFormat('en-US', { weekday: 'long' }).format(new Date(1970, 0, 4 + i))\r\n );"]}
|