@lyxa.ai/core 1.4.127 → 1.4.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/libraries/mongo/models/embedded/service-line-item.model.d.ts +11 -2
- package/dist/libraries/mongo/models/embedded/service-line-item.model.js +39 -5
- package/dist/libraries/mongo/models/embedded/service-line-item.model.js.map +1 -1
- package/dist/libraries/mongo/models/parent.model.d.ts +1 -0
- package/dist/libraries/mongo/models/parent.model.js +5 -0
- package/dist/libraries/mongo/models/parent.model.js.map +1 -1
- package/dist/libraries/mongo/models/service-booking.model.d.ts +3 -2
- package/dist/libraries/mongo/models/service-booking.model.js +10 -5
- package/dist/libraries/mongo/models/service-booking.model.js.map +1 -1
- package/dist/libraries/mongo/models/shop.model.d.ts +1 -0
- package/dist/libraries/mongo/models/shop.model.js +5 -0
- package/dist/libraries/mongo/models/shop.model.js.map +1 -1
- package/dist/libraries/mongo/models/user-action.model.js +7 -2
- package/dist/libraries/mongo/models/user-action.model.js.map +1 -1
- package/dist/libraries/trpc/middlewares/auth.d.ts +1 -1
- package/dist/libraries/trpc/middlewares/createRoleProtectedProcedure.d.ts +1 -1
- package/dist/libraries/trpc/middlewares/phone-verified.d.ts +1 -1
- package/dist/libraries/trpc/middlewares/publicUserDecoder.d.ts +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/dist/types/utilities/validation/common-validation.d.ts +12 -12
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Ref } from '@typegoose/typegoose';
|
|
2
|
-
import { ServiceLineItemType } from '../../../../utilities/enum';
|
|
2
|
+
import { ServiceLineItemType, ValueType } from '../../../../utilities/enum';
|
|
3
3
|
import { ServicePackage } from '../service-package.model';
|
|
4
4
|
import { ServiceAddon } from '../service-addon.model';
|
|
5
5
|
import { PreparingTime } from './preparing-time.model';
|
|
6
|
+
import { ServicePromotion } from '../service-promotion.model';
|
|
6
7
|
export declare class LineItemSnap {
|
|
7
8
|
name?: string;
|
|
8
9
|
image?: string;
|
|
@@ -11,6 +12,14 @@ export declare class LineItemSnap {
|
|
|
11
12
|
materialCost?: number;
|
|
12
13
|
secondaryMaterialCost?: number;
|
|
13
14
|
}
|
|
15
|
+
export declare class PromotionSnap {
|
|
16
|
+
servicePromotion?: Ref<ServicePromotion>;
|
|
17
|
+
isAppliedByCompany?: boolean;
|
|
18
|
+
isMaxDiscountPerOrderEnabled?: boolean;
|
|
19
|
+
maxDiscountPerOrder?: number;
|
|
20
|
+
valueType?: ValueType;
|
|
21
|
+
value?: number;
|
|
22
|
+
}
|
|
14
23
|
export declare class ServiceLineItem {
|
|
15
24
|
lineItemType: ServiceLineItemType;
|
|
16
25
|
servicePackage?: Ref<ServicePackage>;
|
|
@@ -21,5 +30,5 @@ export declare class ServiceLineItem {
|
|
|
21
30
|
secondaryPrice?: number;
|
|
22
31
|
discountedPrice?: number;
|
|
23
32
|
secondaryDiscountedPrice?: number;
|
|
24
|
-
|
|
33
|
+
promotionSnap?: PromotionSnap;
|
|
25
34
|
}
|
|
@@ -9,12 +9,13 @@ 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.ServiceLineItem = exports.LineItemSnap = void 0;
|
|
12
|
+
exports.ServiceLineItem = exports.PromotionSnap = exports.LineItemSnap = void 0;
|
|
13
13
|
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
14
|
const enum_1 = require("../../../../utilities/enum");
|
|
15
15
|
const service_package_model_1 = require("../service-package.model");
|
|
16
16
|
const service_addon_model_1 = require("../service-addon.model");
|
|
17
17
|
const preparing_time_model_1 = require("./preparing-time.model");
|
|
18
|
+
const service_promotion_model_1 = require("../service-promotion.model");
|
|
18
19
|
class LineItemSnap {
|
|
19
20
|
name;
|
|
20
21
|
image;
|
|
@@ -48,6 +49,39 @@ __decorate([
|
|
|
48
49
|
(0, typegoose_1.prop)({ type: Number }),
|
|
49
50
|
__metadata("design:type", Number)
|
|
50
51
|
], LineItemSnap.prototype, "secondaryMaterialCost", void 0);
|
|
52
|
+
class PromotionSnap {
|
|
53
|
+
servicePromotion;
|
|
54
|
+
isAppliedByCompany;
|
|
55
|
+
isMaxDiscountPerOrderEnabled;
|
|
56
|
+
maxDiscountPerOrder;
|
|
57
|
+
valueType;
|
|
58
|
+
value;
|
|
59
|
+
}
|
|
60
|
+
exports.PromotionSnap = PromotionSnap;
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typegoose_1.prop)({ ref: () => service_promotion_model_1.ServicePromotion }),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], PromotionSnap.prototype, "servicePromotion", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typegoose_1.prop)({ type: Boolean }),
|
|
67
|
+
__metadata("design:type", Boolean)
|
|
68
|
+
], PromotionSnap.prototype, "isAppliedByCompany", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
71
|
+
__metadata("design:type", Boolean)
|
|
72
|
+
], PromotionSnap.prototype, "isMaxDiscountPerOrderEnabled", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, typegoose_1.prop)({ type: Number }),
|
|
75
|
+
__metadata("design:type", Number)
|
|
76
|
+
], PromotionSnap.prototype, "maxDiscountPerOrder", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.ValueType, default: enum_1.ValueType.PERCENTAGE }),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], PromotionSnap.prototype, "valueType", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, typegoose_1.prop)({ type: Number }),
|
|
83
|
+
__metadata("design:type", Number)
|
|
84
|
+
], PromotionSnap.prototype, "value", void 0);
|
|
51
85
|
class ServiceLineItem {
|
|
52
86
|
lineItemType;
|
|
53
87
|
servicePackage;
|
|
@@ -58,7 +92,7 @@ class ServiceLineItem {
|
|
|
58
92
|
secondaryPrice;
|
|
59
93
|
discountedPrice;
|
|
60
94
|
secondaryDiscountedPrice;
|
|
61
|
-
|
|
95
|
+
promotionSnap;
|
|
62
96
|
}
|
|
63
97
|
exports.ServiceLineItem = ServiceLineItem;
|
|
64
98
|
__decorate([
|
|
@@ -98,7 +132,7 @@ __decorate([
|
|
|
98
132
|
__metadata("design:type", Number)
|
|
99
133
|
], ServiceLineItem.prototype, "secondaryDiscountedPrice", void 0);
|
|
100
134
|
__decorate([
|
|
101
|
-
(0, typegoose_1.prop)({ type:
|
|
102
|
-
__metadata("design:type",
|
|
103
|
-
], ServiceLineItem.prototype, "
|
|
135
|
+
(0, typegoose_1.prop)({ type: PromotionSnap, _id: false }),
|
|
136
|
+
__metadata("design:type", PromotionSnap)
|
|
137
|
+
], ServiceLineItem.prototype, "promotionSnap", void 0);
|
|
104
138
|
//# sourceMappingURL=service-line-item.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-line-item.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/service-line-item.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"service-line-item.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/service-line-item.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAA4E;AAC5E,oEAA0D;AAC1D,gEAAsD;AACtD,iEAAuD;AACvD,wEAA8D;AAE9D,MAAa,YAAY;IAEjB,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,WAAW,CAAU;IAGrB,QAAQ,CAAiB;IAGzB,YAAY,CAAU;IAGtB,qBAAqB,CAAU;CACtC;AAlBD,oCAkBC;AAhBO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI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K,CAAU;IAGf,QAAQ,CAAU;IAIlB,YAAY,CAAgB;IAG5B,cAAc,CAAU;IAGxB,eAAe,CAAU;IAGzB,wBAAwB,CAAU;IAGlC,aAAa,CAAiB;CACrC;AA/BD,0CA+BC;AA7BO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,0BAAmB,EAAE,CAAC;;qDACxB;AAGnC;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,sCAAc,EAAE,CAAC;;uDACQ;AAGrC;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;;8CACD;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;iDACtB;AAIlB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;8BACnB,YAAY;qDAAC;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDACQ;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wDACS;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iEACkB;AAGlC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;8BACnB,aAAa;sDAAC","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { ServiceLineItemType, ValueType } from '../../../../utilities/enum';\nimport { ServicePackage } from '../service-package.model';\nimport { ServiceAddon } from '../service-addon.model';\nimport { PreparingTime } from './preparing-time.model';\nimport { ServicePromotion } from '../service-promotion.model';\n\nexport class LineItemSnap {\n\t@prop({ type: String })\n\tpublic name?: string;\n\n\t@prop({ type: String })\n\tpublic image?: string;\n\n\t@prop({ type: String })\n\tpublic description?: string;\n\n\t@prop({ type: PreparingTime })\n\tpublic duration?: PreparingTime;\n\n\t@prop({ type: Number })\n\tpublic materialCost?: number;\n\n\t@prop({ type: Number })\n\tpublic secondaryMaterialCost?: number;\n}\n\nexport class PromotionSnap {\n\t@prop({ ref: () => ServicePromotion })\n\tpublic servicePromotion?: Ref<ServicePromotion>;\n\n\t@prop({ type: Boolean })\n\tpublic isAppliedByCompany?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isMaxDiscountPerOrderEnabled?: boolean;\n\n\t@prop({ type: Number })\n\tpublic maxDiscountPerOrder?: number;\n\n\t@prop({ type: String, enum: ValueType, default: ValueType.PERCENTAGE })\n\tpublic valueType?: ValueType;\n\n\t@prop({ type: Number })\n\tpublic value?: number;\n}\n\n/**\n * A single line item in the service cart.\n *\n * Each line item is either a PACKAGE or an ADDON — never both.\n * The `lineItemType` field is the discriminator:\n *\n * - lineItemType = PACKAGE → `servicePackage` + `lineItemSnap` are set; addon field is absent.\n * - lineItemType = ADDON → `addon` + `lineItemSnap` are set; servicePackage field is absent.\n *\n * `price` — unit price of the item (package price or addon price).\n * `quantity` — how many units of this item are being booked.\n */\nexport class ServiceLineItem {\n\t@prop({ required: true, type: String, enum: ServiceLineItemType })\n\tpublic lineItemType!: ServiceLineItemType;\n\n\t@prop({ ref: () => ServicePackage })\n\tpublic servicePackage?: Ref<ServicePackage>;\n\n\t@prop({ ref: () => ServiceAddon })\n\tpublic addon?: Ref<ServiceAddon>;\n\n\t@prop({ required: true, type: Number })\n\tpublic price!: number;\n\n\t@prop({ required: true, type: Number, min: 1 })\n\tpublic quantity!: number;\n\n\t// Add these fields when cart will be submitted\n\t@prop({ type: LineItemSnap, _id: false })\n\tpublic lineItemSnap?: LineItemSnap;\n\n\t@prop({ type: Number })\n\tpublic secondaryPrice?: number;\n\n\t@prop({ type: Number })\n\tpublic discountedPrice?: number;\n\n\t@prop({ type: Number })\n\tpublic secondaryDiscountedPrice?: number;\n\n\t@prop({ type: PromotionSnap, _id: false })\n\tpublic promotionSnap?: PromotionSnap;\n}\n"]}
|
|
@@ -40,6 +40,7 @@ let Parent = class Parent extends defaultClasses_1.TimeStamps {
|
|
|
40
40
|
shopCount;
|
|
41
41
|
allowTakingOrders;
|
|
42
42
|
showCustomerNumber;
|
|
43
|
+
hideOutOfStockProducts;
|
|
43
44
|
};
|
|
44
45
|
exports.Parent = Parent;
|
|
45
46
|
__decorate([
|
|
@@ -120,6 +121,10 @@ __decorate([
|
|
|
120
121
|
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
121
122
|
__metadata("design:type", Boolean)
|
|
122
123
|
], Parent.prototype, "showCustomerNumber", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
126
|
+
__metadata("design:type", Boolean)
|
|
127
|
+
], Parent.prototype, "hideOutOfStockProducts", void 0);
|
|
123
128
|
exports.Parent = Parent = __decorate([
|
|
124
129
|
(0, typegoose_1.index)({ name: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } }),
|
|
125
130
|
(0, typegoose_1.index)({ email: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parent.model.js","sourceRoot":"/","sources":["libraries/mongo/models/parent.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAqF;AACrF,4EAAqE;AACrE,kDAAoF;AACpF,+CAAsC;AACtC,0DAAiD;AACjD,4EAAkE;AAClE,0DAAiD;AACjD,4DAAmD;AACnD,6CAAoC;AACpC,kEAA6D;AAC7D,wBAAiC;AAgB1B,IAAM,MAAM,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,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IAC9E,IAAA,eAAG,EAAS,MAAM,EAAE,KAAK;QACzB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,MAAM,CAAC,CAAC;QACpE,CAAC;IACF,CAAC,CAAC;IACD,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;QAClG,OAAO,EAAE;YACR,UAAU,EAAE,oBAAQ,CAAC,KAAK;SAC1B;KACD,CAAC;GACW,MAAM,CA+DlB","sourcesContent":["import { index, modelOptions, pre, prop, Ref, Severity } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ChargeType, CounterType, ItemType, Status } from '../../../utilities/enum';\nimport { Admin } from './admin.model';\nimport { Charge } from './embedded/charge.model';\nimport { ParentDocument } from './embedded/parent-document.model';\nimport { Address } from './shared/address.model';\nimport { Duration } from './shared/duration.model';\nimport { Shop } from './shop.model';\nimport { generateId } from '../../../utilities/id-generator';\nimport { CounterModel } from '.';\n\n@index({ name: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@index({ email: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@index({ accountManager: 1 }, { partialFilterExpression: { deletedAt: null } })\n@pre<Parent>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.parentId = await generateId(CounterModel, CounterType.PARENT);\n\t}\n})\n@modelOptions({\n\tschemaOptions: { collection: 'parents', toJSON: { virtuals: true }, toObject: { virtuals: true } },\n\toptions: {\n\t\tallowMixed: Severity.ALLOW,\n\t},\n})\nexport class Parent extends TimeStamps {\n\t@prop({ required: true, type: String, maxlength: 50 })\n\tpublic name!: string;\n\n\t@prop({ type: String, unique: true })\n\tpublic parentId: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: Address })\n\tpublic address!: Address;\n\n\t@prop({ required: true, type: String, enum: ChargeType, default: ChargeType.CUSTOM })\n\tpublic chargeType!: ChargeType;\n\n\t@prop({ required: true, type: Charge })\n\tpublic charge!: Charge;\n\n\t@prop({ required: true, type: Duration })\n\tpublic commissionDuration!: Duration;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ required: true, type: Boolean, default: true })\n\tpublic isServiceFeeCharged!: boolean;\n\n\t@prop({ ref: () => Admin })\n\tpublic businessDevExecutive?: Ref<Admin>;\n\n\t@prop({ ref: () => Admin })\n\tpublic accountManager?: Ref<Admin>;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: String })\n\tpublic profilePhoto?: string;\n\n\t@prop({ type: ParentDocument })\n\tpublic document?: ParentDocument;\n\n\t@prop({\n\t\tref: () => Shop,\n\t\tforeignField: 'parent',\n\t\tlocalField: '_id',\n\t\tcount: true,\n\t\tmatch: { deletedAt: null },\n\t})\n\tpublic shopCount?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic allowTakingOrders: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic showCustomerNumber: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic hideOutOfStockProducts?: boolean;\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ref } from '@typegoose/typegoose';
|
|
2
2
|
import { User } from './user.model';
|
|
3
3
|
import { Vendor } from './vendor.model';
|
|
4
|
-
import { ServiceBookingStatus, ServiceType, SubServiceType } from '../../../utilities/enum';
|
|
4
|
+
import { ServiceBookingStatus, ServiceType, SubServiceType, AdjustmentStatus } from '../../../utilities/enum';
|
|
5
5
|
import { Professional } from './professional.model';
|
|
6
6
|
import { ServiceCart } from './service-cart.model';
|
|
7
7
|
import { ServiceBookingFinance } from './embedded/service-booking-finance.model';
|
|
@@ -45,6 +45,7 @@ export declare class ServiceBooking extends TimeStamps {
|
|
|
45
45
|
isEndorseLossApplied?: boolean;
|
|
46
46
|
endorseLossInformation?: ServiceBookingEndorseLoss;
|
|
47
47
|
isAdjusted?: boolean;
|
|
48
|
+
adjustmentStatus?: AdjustmentStatus;
|
|
48
49
|
isFlagged?: boolean;
|
|
49
50
|
flaggedAt?: Date;
|
|
50
51
|
isRefunded?: boolean;
|
|
@@ -57,7 +58,7 @@ export declare class ServiceBooking extends TimeStamps {
|
|
|
57
58
|
isReviewed?: boolean;
|
|
58
59
|
isReviewNotificationSent?: boolean;
|
|
59
60
|
isLowRated?: boolean;
|
|
61
|
+
servicePromotion?: Ref<ServicePromotion>;
|
|
60
62
|
flags?: Ref<ServiceFlag>[];
|
|
61
63
|
reviews?: Ref<Review>[];
|
|
62
|
-
servicePromotion?: Ref<ServicePromotion>;
|
|
63
64
|
}
|
|
@@ -58,6 +58,7 @@ let ServiceBooking = class ServiceBooking extends defaultClasses_1.TimeStamps {
|
|
|
58
58
|
isEndorseLossApplied;
|
|
59
59
|
endorseLossInformation;
|
|
60
60
|
isAdjusted;
|
|
61
|
+
adjustmentStatus;
|
|
61
62
|
isFlagged;
|
|
62
63
|
flaggedAt;
|
|
63
64
|
isRefunded;
|
|
@@ -70,9 +71,9 @@ let ServiceBooking = class ServiceBooking extends defaultClasses_1.TimeStamps {
|
|
|
70
71
|
isReviewed;
|
|
71
72
|
isReviewNotificationSent;
|
|
72
73
|
isLowRated;
|
|
74
|
+
servicePromotion;
|
|
73
75
|
flags;
|
|
74
76
|
reviews;
|
|
75
|
-
servicePromotion;
|
|
76
77
|
};
|
|
77
78
|
exports.ServiceBooking = ServiceBooking;
|
|
78
79
|
__decorate([
|
|
@@ -191,6 +192,10 @@ __decorate([
|
|
|
191
192
|
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
192
193
|
__metadata("design:type", Boolean)
|
|
193
194
|
], ServiceBooking.prototype, "isAdjusted", void 0);
|
|
195
|
+
__decorate([
|
|
196
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.AdjustmentStatus, default: enum_1.AdjustmentStatus.NONE }),
|
|
197
|
+
__metadata("design:type", String)
|
|
198
|
+
], ServiceBooking.prototype, "adjustmentStatus", void 0);
|
|
194
199
|
__decorate([
|
|
195
200
|
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
196
201
|
__metadata("design:type", Boolean)
|
|
@@ -239,6 +244,10 @@ __decorate([
|
|
|
239
244
|
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
240
245
|
__metadata("design:type", Boolean)
|
|
241
246
|
], ServiceBooking.prototype, "isLowRated", void 0);
|
|
247
|
+
__decorate([
|
|
248
|
+
(0, typegoose_1.prop)({ ref: () => service_promotion_model_1.ServicePromotion }),
|
|
249
|
+
__metadata("design:type", Object)
|
|
250
|
+
], ServiceBooking.prototype, "servicePromotion", void 0);
|
|
242
251
|
__decorate([
|
|
243
252
|
(0, typegoose_1.prop)({
|
|
244
253
|
ref: () => service_flag_model_1.ServiceFlag,
|
|
@@ -255,10 +264,6 @@ __decorate([
|
|
|
255
264
|
}),
|
|
256
265
|
__metadata("design:type", Array)
|
|
257
266
|
], ServiceBooking.prototype, "reviews", void 0);
|
|
258
|
-
__decorate([
|
|
259
|
-
(0, typegoose_1.prop)({ ref: () => service_promotion_model_1.ServicePromotion }),
|
|
260
|
-
__metadata("design:type", Object)
|
|
261
|
-
], ServiceBooking.prototype, "servicePromotion", void 0);
|
|
262
267
|
exports.ServiceBooking = ServiceBooking = __decorate([
|
|
263
268
|
(0, typegoose_1.modelOptions)({
|
|
264
269
|
schemaOptions: { collection: 'serviceBookings', timestamps: true },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-booking.model.js","sourceRoot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U,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,EAAE;QAClE,OAAO,EAAE,EAAE,UAAU,EAAE,oBAAQ,CAAC,KAAK,EAAE;KACvC,CAAC;IACD,IAAA,eAAG,EAAiB,UAAU,EAAE,KAAK,WAAW,IAAI;QACpD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,KAAK,GAAG,IAAA,aAAK,GAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAEvC,MAAM,OAAO,GAAG,MAAM,eAAY,CAAC,gBAAgB,CAClD,EAAE,WAAW,EAAE,kBAAW,CAAC,KAAK,EAAE,EAClC;gBACC;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE;4BACN,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;yBAC/D;wBACD,KAAK,EAAE,KAAK;qBACZ;iBACD;aACD,EACD,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAC3B,CAAC;YAEF,IAAI,CAAC,OAAO,GAAG,GAAG,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;QACvE,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,cAAc,CA6I1B","sourcesContent":["import { modelOptions, pre, prop, Ref, Severity } from '@typegoose/typegoose';\nimport { User } from './user.model';\nimport { Vendor } from './vendor.model';\nimport { ServiceBookingStatus, CounterType, ServiceType, SubServiceType } from '../../../utilities/enum';\nimport { Professional } from './professional.model';\nimport { ServiceCart } from './service-cart.model';\nimport { ServiceBookingFinance } from './embedded/service-booking-finance.model';\nimport {\n\tServiceBookingCancellationDetails,\n\tServiceBookingEndorseLoss,\n} from './embedded/service-booking-cancellation-details.model';\nimport { ServiceBookingStatusTimeline } from './embedded/status-timeline.model';\nimport { CounterModel, Review, VendorParent} from '.';\nimport { ServicePromotion } from './service-promotion.model';\nimport { RegularOrderAddress } from './shared/address.model';\nimport { OrderSlotRange } from './shared/duration.model';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceBookingRefundInformation } from './embedded/service-booking-refund-information.model';\nimport { ServiceBookingReplacementInformation } from './embedded/service-booking-replacement-information.model';\nimport { ServiceFlag } from './service-flag.model';\nimport { dayjs } from '../../../utilities/dayjs';\n@modelOptions({\n\tschemaOptions: { collection: 'serviceBookings', timestamps: true },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@pre<ServiceBooking>('validate', async function (next) {\n\tif (this.isNew) {\n\t\tconst today = dayjs().format('DDMMYY');\n\n\t\tconst counter = await CounterModel.findOneAndUpdate(\n\t\t\t{ counterType: CounterType.ORDER },\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\t$set: {\n\t\t\t\t\t\tvalue: {\n\t\t\t\t\t\t\t$cond: [{ $eq: ['$today', today] }, { $add: ['$value', 1] }, 1],\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttoday: today,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\t{ new: true, upsert: true }\n\t\t);\n\n\t\tthis.orderId = `${today}${counter.value.toString().padStart(6, '0')}`;\n\t}\n\tnext();\n})\nexport class ServiceBooking extends TimeStamps {\n\t@prop({ type: String, unique: true })\n\tpublic orderId?: string;\n\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ required: true, ref: () => VendorParent })\n\tpublic vendorParent!: Ref<VendorParent>;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType;\n\n\t@prop({ type: String, enum: SubServiceType })\n\tpublic subServiceType?: SubServiceType;\n\n\t@prop({ required: true, ref: () => ServiceCart })\n\tpublic cart!: Ref<ServiceCart>;\n\n\t@prop({ required: true, type: () => RegularOrderAddress })\n\tpublic userAddress!: RegularOrderAddress;\n\n\t@prop({ required: true, type: OrderSlotRange, _id: false })\n\tpublic slotRange!: OrderSlotRange;\n\n\t@prop({ type: String, enum: ServiceBookingStatus, default: ServiceBookingStatus.PENDING })\n\tpublic status!: ServiceBookingStatus;\n\n\t@prop({ ref: () => Professional })\n\tpublic professionals?: Ref<Professional>[];\n\n\t@prop({ ref: () => Professional })\n\tpublic responsibleProfessional?: Ref<Professional>;\n\n\t@prop({ type: Date, default: new Date() })\n\tpublic processedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic placedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic startedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic estimatedCompletionAt?: Date;\n\n\t@prop({ type: Number })\n\tpublic estimatedCompletionInMinutes?: number;\n\n\t@prop({ type: Date })\n\tpublic completedAt?: Date;\n\n\t@prop({ type: Number })\n\tpublic actualCompletionInMinutes?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isUrgent?: boolean;\n\n\t@prop({ type: Date })\n\tpublic urgentAt?: Date;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isOverdue?: boolean;\n\n\t@prop({ type: Date })\n\tpublic overdueAt?: Date;\n\n\t@prop({ required: true, type: ServiceBookingFinance, _id: false })\n\tpublic finance!: ServiceBookingFinance;\n\n\t@prop({ required: true, type: ServiceBookingFinance, _id: false })\n\tpublic adjustedFinance!: ServiceBookingFinance;\n\n\t@prop({ type: () => ServiceBookingCancellationDetails, _id: false })\n\tpublic cancellationDetails?: ServiceBookingCancellationDetails;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isEndorseLossApplied?: boolean;\n\n\t@prop({ type: () => ServiceBookingEndorseLoss, _id: false })\n\tpublic endorseLossInformation?: ServiceBookingEndorseLoss;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isAdjusted?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isFlagged?: boolean;\n\n\t@prop({ type: Date })\n\tpublic flaggedAt?: Date;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRefunded?: boolean;\n\n\t@prop({ type: ServiceBookingRefundInformation, _id: false })\n\tpublic refundInformation?: ServiceBookingRefundInformation;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReplacement?: boolean;\n\n\t@prop({ type: () => ServiceBookingReplacementInformation, _id: false })\n\tpublic replacementInformation?: ServiceBookingReplacementInformation;\n\n\t@prop({ ref: () => ServiceBooking })\n\tpublic replacementBooking?: Ref<ServiceBooking>;\n\n\t@prop({ type: () => [ServiceBookingStatusTimeline], default: [] })\n\tpublic statusTimeline?: ServiceBookingStatusTimeline[];\n\n\t@prop({ type: Number })\n\tpublic bufferTime?: number; // minutes\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReviewed?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReviewNotificationSent?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isLowRated?: boolean;\n\n\t// Virtual field\n\t@prop({\n\t\tref: () => ServiceFlag,\n\t\tforeignField: 'serviceBooking',\n\t\tlocalField: '_id',\n\t})\n\tpublic flags?: Ref<ServiceFlag>[];\n\n\t@prop({\n\t\tref: () => Review,\n\t\tforeignField: 'serviceBooking',\n\t\tlocalField: '_id',\n\t})\n\tpublic reviews?: Ref<Review>[];\n\n\t@prop({ ref: () => ServicePromotion })\n\tpublic servicePromotion?: Ref<ServicePromotion>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"service-booking.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-booking.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA8E;AAC9E,6CAAoC;AACpC,iDAAwC;AACxC,kDAMiC;AACjC,6DAAoD;AACpD,6DAAmD;AACnD,4FAAiF;AACjF,sHAG+D;AAC/D,4EAAgF;AAChF,wBA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,EAAE;QAClE,OAAO,EAAE,EAAE,UAAU,EAAE,oBAAQ,CAAC,KAAK,EAAE;KACvC,CAAC;IACD,IAAA,eAAG,EAAiB,UAAU,EAAE,KAAK,WAAW,IAAI;QACpD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,MAAM,KAAK,GAAG,IAAA,aAAK,GAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAEvC,MAAM,OAAO,GAAG,MAAM,eAAY,CAAC,gBAAgB,CAClD,EAAE,WAAW,EAAE,kBAAW,CAAC,KAAK,EAAE,EAClC;gBACC;oBACC,IAAI,EAAE;wBACL,KAAK,EAAE;4BACN,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;yBAC/D;wBACD,KAAK,EAAE,KAAK;qBACZ;iBACD;aACD,EACD,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAC3B,CAAC;YAEF,IAAI,CAAC,OAAO,GAAG,GAAG,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;QACvE,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,cAAc,CAgJ1B","sourcesContent":["import { modelOptions, pre, prop, Ref, Severity } from '@typegoose/typegoose';\nimport { User } from './user.model';\nimport { Vendor } from './vendor.model';\nimport {\n\tServiceBookingStatus,\n\tCounterType,\n\tServiceType,\n\tSubServiceType,\n\tAdjustmentStatus,\n} from '../../../utilities/enum';\nimport { Professional } from './professional.model';\nimport { ServiceCart } from './service-cart.model';\nimport { ServiceBookingFinance } from './embedded/service-booking-finance.model';\nimport {\n\tServiceBookingCancellationDetails,\n\tServiceBookingEndorseLoss,\n} from './embedded/service-booking-cancellation-details.model';\nimport { ServiceBookingStatusTimeline } from './embedded/status-timeline.model';\nimport { CounterModel, Review, VendorParent } from '.';\nimport { ServicePromotion } from './service-promotion.model';\nimport { RegularOrderAddress } from './shared/address.model';\nimport { OrderSlotRange } from './shared/duration.model';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ServiceBookingRefundInformation } from './embedded/service-booking-refund-information.model';\nimport { ServiceBookingReplacementInformation } from './embedded/service-booking-replacement-information.model';\nimport { ServiceFlag } from './service-flag.model';\nimport { dayjs } from '../../../utilities/dayjs';\n@modelOptions({\n\tschemaOptions: { collection: 'serviceBookings', timestamps: true },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@pre<ServiceBooking>('validate', async function (next) {\n\tif (this.isNew) {\n\t\tconst today = dayjs().format('DDMMYY');\n\n\t\tconst counter = await CounterModel.findOneAndUpdate(\n\t\t\t{ counterType: CounterType.ORDER },\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\t$set: {\n\t\t\t\t\t\tvalue: {\n\t\t\t\t\t\t\t$cond: [{ $eq: ['$today', today] }, { $add: ['$value', 1] }, 1],\n\t\t\t\t\t\t},\n\t\t\t\t\t\ttoday: today,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\t{ new: true, upsert: true }\n\t\t);\n\n\t\tthis.orderId = `${today}${counter.value.toString().padStart(6, '0')}`;\n\t}\n\tnext();\n})\nexport class ServiceBooking extends TimeStamps {\n\t@prop({ type: String, unique: true })\n\tpublic orderId?: string;\n\n\t@prop({ required: true, ref: () => User })\n\tpublic user!: Ref<User>;\n\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ required: true, ref: () => VendorParent })\n\tpublic vendorParent!: Ref<VendorParent>;\n\n\t@prop({ required: true, type: String, enum: ServiceType })\n\tpublic serviceType!: ServiceType;\n\n\t@prop({ type: String, enum: SubServiceType })\n\tpublic subServiceType?: SubServiceType;\n\n\t@prop({ required: true, ref: () => ServiceCart })\n\tpublic cart!: Ref<ServiceCart>;\n\n\t@prop({ required: true, type: () => RegularOrderAddress })\n\tpublic userAddress!: RegularOrderAddress;\n\n\t@prop({ required: true, type: OrderSlotRange, _id: false })\n\tpublic slotRange!: OrderSlotRange;\n\n\t@prop({ type: String, enum: ServiceBookingStatus, default: ServiceBookingStatus.PENDING })\n\tpublic status!: ServiceBookingStatus;\n\n\t@prop({ ref: () => Professional })\n\tpublic professionals?: Ref<Professional>[];\n\n\t@prop({ ref: () => Professional })\n\tpublic responsibleProfessional?: Ref<Professional>;\n\n\t@prop({ type: Date, default: new Date() })\n\tpublic processedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic placedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic startedAt?: Date;\n\n\t@prop({ type: Date })\n\tpublic estimatedCompletionAt?: Date;\n\n\t@prop({ type: Number })\n\tpublic estimatedCompletionInMinutes?: number;\n\n\t@prop({ type: Date })\n\tpublic completedAt?: Date;\n\n\t@prop({ type: Number })\n\tpublic actualCompletionInMinutes?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isUrgent?: boolean;\n\n\t@prop({ type: Date })\n\tpublic urgentAt?: Date;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isOverdue?: boolean;\n\n\t@prop({ type: Date })\n\tpublic overdueAt?: Date;\n\n\t@prop({ required: true, type: ServiceBookingFinance, _id: false })\n\tpublic finance!: ServiceBookingFinance;\n\n\t@prop({ required: true, type: ServiceBookingFinance, _id: false })\n\tpublic adjustedFinance!: ServiceBookingFinance;\n\n\t@prop({ type: () => ServiceBookingCancellationDetails, _id: false })\n\tpublic cancellationDetails?: ServiceBookingCancellationDetails;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isEndorseLossApplied?: boolean;\n\n\t@prop({ type: () => ServiceBookingEndorseLoss, _id: false })\n\tpublic endorseLossInformation?: ServiceBookingEndorseLoss;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isAdjusted?: boolean;\n\n\t@prop({ type: String, enum: AdjustmentStatus, default: AdjustmentStatus.NONE })\n\tpublic adjustmentStatus?: AdjustmentStatus;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isFlagged?: boolean;\n\n\t@prop({ type: Date })\n\tpublic flaggedAt?: Date;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRefunded?: boolean;\n\n\t@prop({ type: ServiceBookingRefundInformation, _id: false })\n\tpublic refundInformation?: ServiceBookingRefundInformation;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReplacement?: boolean;\n\n\t@prop({ type: () => ServiceBookingReplacementInformation, _id: false })\n\tpublic replacementInformation?: ServiceBookingReplacementInformation;\n\n\t@prop({ ref: () => ServiceBooking })\n\tpublic replacementBooking?: Ref<ServiceBooking>;\n\n\t@prop({ type: () => [ServiceBookingStatusTimeline], default: [] })\n\tpublic statusTimeline?: ServiceBookingStatusTimeline[];\n\n\t@prop({ type: Number })\n\tpublic bufferTime?: number; // minutes\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReviewed?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isReviewNotificationSent?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isLowRated?: boolean;\n\n\t@prop({ ref: () => ServicePromotion })\n\tpublic servicePromotion?: Ref<ServicePromotion>;\n\n\t// Virtual field\n\t@prop({\n\t\tref: () => ServiceFlag,\n\t\tforeignField: 'serviceBooking',\n\t\tlocalField: '_id',\n\t})\n\tpublic flags?: Ref<ServiceFlag>[];\n\n\t@prop({\n\t\tref: () => Review,\n\t\tforeignField: 'serviceBooking',\n\t\tlocalField: '_id',\n\t})\n\tpublic reviews?: Ref<Review>[];\n}\n"]}
|
|
@@ -74,6 +74,7 @@ let Shop = class Shop extends defaultClasses_1.TimeStamps {
|
|
|
74
74
|
searchFields;
|
|
75
75
|
isMenuDietaryFilterEnabled;
|
|
76
76
|
categoryNumberingEnabled;
|
|
77
|
+
hideOutOfStockProducts;
|
|
77
78
|
};
|
|
78
79
|
exports.Shop = Shop;
|
|
79
80
|
__decorate([
|
|
@@ -272,6 +273,10 @@ __decorate([
|
|
|
272
273
|
(0, typegoose_1.prop)({ type: Boolean }),
|
|
273
274
|
__metadata("design:type", Boolean)
|
|
274
275
|
], Shop.prototype, "categoryNumberingEnabled", void 0);
|
|
276
|
+
__decorate([
|
|
277
|
+
(0, typegoose_1.prop)({ type: Boolean, default: false }),
|
|
278
|
+
__metadata("design:type", Boolean)
|
|
279
|
+
], Shop.prototype, "hideOutOfStockProducts", void 0);
|
|
275
280
|
exports.Shop = Shop = __decorate([
|
|
276
281
|
(0, typegoose_1.modelOptions)({
|
|
277
282
|
schemaOptions: { collection: 'shops' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shop.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shop.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wBAAiC;AACjC,2CAAkC;AAClC,+CAAsC;AACtC,iDAAwC;AACxC,0DAAiD;AACjD,wDAA4D;AAC5D,kEAA6D;AAC7D,wEAA8D;AAC9D,wEAA8D;AAC9D,4EAAqE;AACrE,kFAAuE;AACvE,8DAAyE;AACzE,oDAAqF;AACrF,kDAAsG;AACtG,wFAAgG;AAmBzF,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,MAAM,CAAU;IAGhB,IAAI,CAAU;IAGd,SAAS,CAAU;IAGnB,KAAK,CAAU;IAGf,MAAM,CAAe;IAGrB,QAAQ,CAAY;IAGpB,MAAM,CAAU;IAGhB,cAAc,CAAc;IAG5B,KAAK,CAAc;IAGnB,UAAU,CAAU;IAGpB,WAAW,CAAU;IAGrB,eAAe,CAAU;IAGzB,sBAAsB,CAAY;IAGlC,mBAAmB,CAAU;IAG7B,kBAAkB,CAAU;IAG5B,qBAAqB,CAAU;IAG/B,OAAO,CAAW;IAGlB,IAAI,CAAU;IAGd,MAAM,CAAU;IAGhB,QA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AAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACrF,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK,WAAW,IAAI;QACtC,MAAM,8BAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnC,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK;QACvB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,IAAI,CAAC,CAAC;QAChE,CAAC;IACF,CAAC,CAAC;GACW,IAAI,CAuJhB","sourcesContent":["import { CounterModel } from '.';\nimport { Tag } from './tag.model';\nimport { Brand } from './brand.model';\nimport { Parent } from './parent.model';\nimport { Address } from './shared/address.model';\nimport { handleShopPreSave } from '../utilities/shop.hooks';\nimport { generateId } from '../../../utilities/id-generator';\nimport { ShopDocument } from './embedded/shop-document.model';\nimport { DeliveryInfo } from './embedded/delivery-info.model';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ShopSearchFields } from './embedded/shop-search-fields.model';\nimport { StartEndTime, WorkHourSetting } from './shared/work-hour.model';\nimport { modelOptions, prop, Ref, Severity, index, pre } from '@typegoose/typegoose';\nimport { CounterType, ItemType, ShopOnlineStatus, Status, ZoneStatus } from '../../../utilities/enum';\nimport { BestSellerCategory, FavouritesCategory } from './embedded/shop-default-category.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'shops' },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@index({ name: 1, itemType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@index({ parent: 1, status: 1, isVisibleToUser: 1 }, { partialFilterExpression: { deletedAt: null } })\n@index({ status: 1, createdAt: -1 }, { partialFilterExpression: { deletedAt: null } })\n@pre<Shop>('save', async function (next) {\n\tawait handleShopPreSave.call(this);\n\n\tnext();\n})\n@pre<Shop>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.shopId = await generateId(CounterModel, CounterType.SHOP);\n\t}\n})\nexport class Shop extends TimeStamps {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic shopId?: string;\n\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic ownerName!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: true, ref: () => Parent })\n\tpublic parent!: Ref<Parent>;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ type: String, enum: ZoneStatus, default: ZoneStatus.ACTIVE })\n\tpublic shopZoneStatus?: ZoneStatus;\n\n\t@prop({ required: true, ref: () => Brand })\n\tpublic brand!: Ref<Brand>;\n\n\t@prop({ type: Number, default: 1, min: 1, max: 4 })\n\tpublic priceRange?: number;\n\n\t@prop({ required: true, type: String })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic userPhoneNumber!: string;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic additionalPhoneNumbers?: string[];\n\n\t@prop({ type: String, maxlength: 100 })\n\tpublic bobContactFirstName?: string;\n\n\t@prop({ type: String, maxlength: 100 })\n\tpublic bobContactLastName?: string;\n\n\t@prop({ type: String, maxlength: 15 })\n\tpublic bobContactPhoneNumber?: string;\n\n\t@prop({ required: true, type: Address })\n\tpublic address!: Address;\n\n\t@prop({ type: String })\n\tpublic logo?: string;\n\n\t@prop({ type: String })\n\tpublic banner?: string;\n\n\t@prop({ type: ShopDocument })\n\tpublic document?: ShopDocument;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: ShopOnlineStatus,\n\t\tdefault: ShopOnlineStatus.OFFLINE,\n\t})\n\tpublic onlineStatus?: ShopOnlineStatus;\n\n\t@prop({ type: WorkHourSetting })\n\tpublic workHourSetting?: WorkHourSetting;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic dietaries?: string[];\n\n\t@prop({ ref: () => Tag, default: [] })\n\tpublic tags?: Ref<Tag>[];\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isBeirutAuthentic!: boolean;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isVisibleToUser!: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isShopDelivery?: boolean;\n\n\t@prop({ type: Number })\n\tpublic deliveryFee?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic minimumOrderAmount?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic orderCapacityEnabled?: boolean;\n\n\t@prop({ type: Number })\n\tpublic orderCapacity?: number;\n\n\t@prop({ type: () => [StartEndTime], default: [] })\n\tpublic shopActiveTimingsOfCurrentDate?: StartEndTime[];\n\n\t@prop({ type: DeliveryInfo })\n\tpublic deliveryInfo?: DeliveryInfo;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t// Setting\n\t@prop({ type: Boolean, default: false })\n\tpublic allowSpecialInstructions?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRiderNoteVisible?: boolean;\n\n\t@prop({ type: String })\n\tpublic riderNote?: string;\n\n\t@prop({ type: Number, default: 10 })\n\tpublic defaultPreparationTime?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic averagePreparationTime?: number; // based on order prep time in mins\n\n\t// Best seller category\n\t@prop({ type: BestSellerCategory })\n\tpublic bestSellerCategory?: BestSellerCategory;\n\n\t// Favourites category\n\t@prop({ type: FavouritesCategory })\n\tpublic favouritesCategory?: FavouritesCategory;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic ordersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic customersCount?: number;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic fcmTokens?: string[];\n\n\t@prop({ type: ShopSearchFields })\n\tpublic searchFields?: ShopSearchFields;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isMenuDietaryFilterEnabled?: boolean;\n\n\t@prop({ type: Boolean })\n\tpublic categoryNumberingEnabled?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"shop.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shop.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wBAAiC;AACjC,2CAAkC;AAClC,+CAAsC;AACtC,iDAAwC;AACxC,0DAAiD;AACjD,wDAA4D;AAC5D,kEAA6D;AAC7D,wEAA8D;AAC9D,wEAA8D;AAC9D,4EAAqE;AACrE,kFAAuE;AACvE,8DAAyE;AACzE,oDAAqF;AACrF,kDAAsG;AACtG,wFAAgG;AAmBzF,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,MAAM,CAAU;IAGhB,IAAI,CAAU;IAGd,SAAS,CAAU;IAGnB,KAAK,CAAU;IAGf,MAAM,CAAe;IAGrB,QAAQ,CAAY;IAGpB,MAAM,CAAU;IAGhB,cAAc,CAAc;IAG5B,KAAK,CAAc;IAGnB,UAAU,CAAU;IAGpB,WAAW,CAAU;IAGrB,eAAe,CAAU;IAGzB,sBAAsB,CAAY;IAGlC,mBAAmB,CAAU;IAG7B,kBAAkB,CAAU;IAG5B,qBAAqB,CAAU;IAG/B,OAAO,CAAW;IAGlB,IAAI,CAAU;IAGd,MAAM,CAAU;IAGhB,QAAQ,CAAgB;IAOxB,YAAY,CAAoB;IAGhC,eAAe,CAAmB;IAGlC,SAAS,CAAY;IAGrB,IAAI,CAAc;IAGlB,iBAAiB,CAAW;IAG5B,eAAe,CAAW;IAG1B,cAAc,CAAW;IAGzB,WAAW,CAAU;IAGrB,kBAAkB,CAAU;IAG5B,oBAAoB,CAAW;IA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,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACrF,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK,WAAW,IAAI;QACtC,MAAM,8BAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnC,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK;QACvB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,IAAI,CAAC,CAAC;QAChE,CAAC;IACF,CAAC,CAAC;GACW,IAAI,CA0JhB","sourcesContent":["import { CounterModel } from '.';\nimport { Tag } from './tag.model';\nimport { Brand } from './brand.model';\nimport { Parent } from './parent.model';\nimport { Address } from './shared/address.model';\nimport { handleShopPreSave } from '../utilities/shop.hooks';\nimport { generateId } from '../../../utilities/id-generator';\nimport { ShopDocument } from './embedded/shop-document.model';\nimport { DeliveryInfo } from './embedded/delivery-info.model';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { ShopSearchFields } from './embedded/shop-search-fields.model';\nimport { StartEndTime, WorkHourSetting } from './shared/work-hour.model';\nimport { modelOptions, prop, Ref, Severity, index, pre } from '@typegoose/typegoose';\nimport { CounterType, ItemType, ShopOnlineStatus, Status, ZoneStatus } from '../../../utilities/enum';\nimport { BestSellerCategory, FavouritesCategory } from './embedded/shop-default-category.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'shops' },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@index({ name: 1, itemType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@index({ parent: 1, status: 1, isVisibleToUser: 1 }, { partialFilterExpression: { deletedAt: null } })\n@index({ status: 1, createdAt: -1 }, { partialFilterExpression: { deletedAt: null } })\n@pre<Shop>('save', async function (next) {\n\tawait handleShopPreSave.call(this);\n\n\tnext();\n})\n@pre<Shop>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.shopId = await generateId(CounterModel, CounterType.SHOP);\n\t}\n})\nexport class Shop extends TimeStamps {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic shopId?: string;\n\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic ownerName!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: true, ref: () => Parent })\n\tpublic parent!: Ref<Parent>;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ type: String, enum: ZoneStatus, default: ZoneStatus.ACTIVE })\n\tpublic shopZoneStatus?: ZoneStatus;\n\n\t@prop({ required: true, ref: () => Brand })\n\tpublic brand!: Ref<Brand>;\n\n\t@prop({ type: Number, default: 1, min: 1, max: 4 })\n\tpublic priceRange?: number;\n\n\t@prop({ required: true, type: String })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic userPhoneNumber!: string;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic additionalPhoneNumbers?: string[];\n\n\t@prop({ type: String, maxlength: 100 })\n\tpublic bobContactFirstName?: string;\n\n\t@prop({ type: String, maxlength: 100 })\n\tpublic bobContactLastName?: string;\n\n\t@prop({ type: String, maxlength: 15 })\n\tpublic bobContactPhoneNumber?: string;\n\n\t@prop({ required: true, type: Address })\n\tpublic address!: Address;\n\n\t@prop({ type: String })\n\tpublic logo?: string;\n\n\t@prop({ type: String })\n\tpublic banner?: string;\n\n\t@prop({ type: ShopDocument })\n\tpublic document?: ShopDocument;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: ShopOnlineStatus,\n\t\tdefault: ShopOnlineStatus.OFFLINE,\n\t})\n\tpublic onlineStatus?: ShopOnlineStatus;\n\n\t@prop({ type: WorkHourSetting })\n\tpublic workHourSetting?: WorkHourSetting;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic dietaries?: string[];\n\n\t@prop({ ref: () => Tag, default: [] })\n\tpublic tags?: Ref<Tag>[];\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isBeirutAuthentic!: boolean;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isVisibleToUser!: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isShopDelivery?: boolean;\n\n\t@prop({ type: Number })\n\tpublic deliveryFee?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic minimumOrderAmount?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic orderCapacityEnabled?: boolean;\n\n\t@prop({ type: Number })\n\tpublic orderCapacity?: number;\n\n\t@prop({ type: () => [StartEndTime], default: [] })\n\tpublic shopActiveTimingsOfCurrentDate?: StartEndTime[];\n\n\t@prop({ type: DeliveryInfo })\n\tpublic deliveryInfo?: DeliveryInfo;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t// Setting\n\t@prop({ type: Boolean, default: false })\n\tpublic allowSpecialInstructions?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRiderNoteVisible?: boolean;\n\n\t@prop({ type: String })\n\tpublic riderNote?: string;\n\n\t@prop({ type: Number, default: 10 })\n\tpublic defaultPreparationTime?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic averagePreparationTime?: number; // based on order prep time in mins\n\n\t// Best seller category\n\t@prop({ type: BestSellerCategory })\n\tpublic bestSellerCategory?: BestSellerCategory;\n\n\t// Favourites category\n\t@prop({ type: FavouritesCategory })\n\tpublic favouritesCategory?: FavouritesCategory;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic ordersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic customersCount?: number;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic fcmTokens?: string[];\n\n\t@prop({ type: ShopSearchFields })\n\tpublic searchFields?: ShopSearchFields;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isMenuDietaryFilterEnabled?: boolean;\n\n\t@prop({ type: Boolean })\n\tpublic categoryNumberingEnabled?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic hideOutOfStockProducts?: boolean;\n}\n"]}
|
|
@@ -15,14 +15,14 @@ const defaultClasses_1 = require("@typegoose/typegoose/lib/defaultClasses");
|
|
|
15
15
|
const user_model_1 = require("./user.model");
|
|
16
16
|
const enum_1 = require("../../../utilities/enum");
|
|
17
17
|
const order_model_1 = require("./order.model");
|
|
18
|
-
class UserAction extends defaultClasses_1.TimeStamps {
|
|
18
|
+
let UserAction = class UserAction extends defaultClasses_1.TimeStamps {
|
|
19
19
|
user;
|
|
20
20
|
order;
|
|
21
21
|
orderId;
|
|
22
22
|
actionType;
|
|
23
23
|
actionReason;
|
|
24
24
|
isResolved;
|
|
25
|
-
}
|
|
25
|
+
};
|
|
26
26
|
exports.UserAction = UserAction;
|
|
27
27
|
__decorate([
|
|
28
28
|
(0, typegoose_1.prop)({ ref: () => user_model_1.User, index: true, required: true }),
|
|
@@ -48,4 +48,9 @@ __decorate([
|
|
|
48
48
|
(0, typegoose_1.prop)({ required: true, type: Boolean, default: false }),
|
|
49
49
|
__metadata("design:type", Boolean)
|
|
50
50
|
], UserAction.prototype, "isResolved", void 0);
|
|
51
|
+
exports.UserAction = UserAction = __decorate([
|
|
52
|
+
(0, typegoose_1.modelOptions)({
|
|
53
|
+
schemaOptions: { collection: 'userActions' },
|
|
54
|
+
})
|
|
55
|
+
], UserAction);
|
|
51
56
|
//# sourceMappingURL=user-action.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-action.model.js","sourceRoot":"/","sources":["libraries/mongo/models/user-action.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"user-action.model.js","sourceRoot":"/","sources":["libraries/mongo/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from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { User } from './user.model';\nimport { UserActionReason, UserActionType } from '../../../utilities/enum';\nimport { Order } from './order.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'userActions' },\n})\nexport class UserAction extends TimeStamps {\n\t@prop({ ref: () => User, index: true, required: true })\n\tpublic user: Ref<User>;\n\n\t@prop({ ref: () => Order, index: true, required: true })\n\tpublic order: Ref<Order>;\n\n\t@prop({ required: true, type: String })\n\tpublic orderId: string;\n\n\t@prop({ required: true, type: String, enum: UserActionType })\n\tpublic actionType: UserActionType;\n\n\t@prop({ required: true, type: String, enum: UserActionReason })\n\tpublic actionReason: UserActionReason;\n\n\t@prop({ required: true, type: Boolean, default: false })\n\tpublic isResolved: boolean;\n}\n"]}
|
|
@@ -5,9 +5,9 @@ interface AuthOptions {
|
|
|
5
5
|
autoRefresh?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare function createAuthenticatedProcedure(options: AuthOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
|
|
8
|
-
req: import("http").IncomingMessage;
|
|
9
8
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
10
9
|
tokenType: TokenType | undefined;
|
|
10
|
+
req: import("http").IncomingMessage;
|
|
11
11
|
requestId: string | undefined;
|
|
12
12
|
entity: import("../context").EntityContext | undefined;
|
|
13
13
|
usedRefreshToken: boolean | undefined;
|
|
@@ -4,9 +4,9 @@ interface RoleProtectedOptions {
|
|
|
4
4
|
allowedRoles: string[];
|
|
5
5
|
}
|
|
6
6
|
export declare function createRoleProtectedProcedure(options: RoleProtectedOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
|
|
7
|
-
req: import("http").IncomingMessage;
|
|
8
7
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
9
8
|
tokenType: import("../../auth").TokenType | undefined;
|
|
9
|
+
req: import("http").IncomingMessage;
|
|
10
10
|
requestId: string | undefined;
|
|
11
11
|
entity: import("../context").EntityContext | undefined;
|
|
12
12
|
usedRefreshToken: boolean | undefined;
|
|
@@ -3,9 +3,9 @@ interface PhoneVerifiedOptions {
|
|
|
3
3
|
entityTypes: AuthEntityType[];
|
|
4
4
|
}
|
|
5
5
|
export declare function createPhoneVerifiedProcedure(options: PhoneVerifiedOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
|
|
6
|
-
req: import("http").IncomingMessage;
|
|
7
6
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
8
7
|
tokenType: import("../../auth").TokenType | undefined;
|
|
8
|
+
req: import("http").IncomingMessage;
|
|
9
9
|
requestId: string | undefined;
|
|
10
10
|
entity: import("../context").EntityContext | undefined;
|
|
11
11
|
usedRefreshToken: boolean | undefined;
|
|
@@ -5,9 +5,9 @@ interface AuthOptions {
|
|
|
5
5
|
autoRefresh?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare function publicUserDecoder(options: AuthOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
|
|
8
|
-
req: import("http").IncomingMessage;
|
|
9
8
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
10
9
|
tokenType: TokenType | undefined;
|
|
10
|
+
req: import("http").IncomingMessage;
|
|
11
11
|
requestId: string | undefined;
|
|
12
12
|
entity: import("../context").EntityContext | undefined;
|
|
13
13
|
usedRefreshToken: boolean | undefined;
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -26,8 +26,8 @@ export declare const FilterSchema: z.ZodOptional<z.ZodObject<{
|
|
|
26
26
|
searchFields?: string[] | undefined;
|
|
27
27
|
} | undefined;
|
|
28
28
|
sort?: Record<string, 1 | -1> | undefined;
|
|
29
|
-
populate?: any;
|
|
30
29
|
select?: Record<string, 0 | 1> | undefined;
|
|
30
|
+
populate?: any;
|
|
31
31
|
query?: Record<string, any> | undefined;
|
|
32
32
|
}, {
|
|
33
33
|
search?: {
|
|
@@ -36,8 +36,8 @@ export declare const FilterSchema: z.ZodOptional<z.ZodObject<{
|
|
|
36
36
|
} | undefined;
|
|
37
37
|
sort?: Record<string, 1 | -1> | undefined;
|
|
38
38
|
size?: number | undefined;
|
|
39
|
-
populate?: any;
|
|
40
39
|
select?: Record<string, 0 | 1> | undefined;
|
|
40
|
+
populate?: any;
|
|
41
41
|
query?: Record<string, any> | undefined;
|
|
42
42
|
page?: number | undefined;
|
|
43
43
|
}>>;
|
|
@@ -736,12 +736,12 @@ export declare const GetByIdInputSchema: z.ZodObject<{
|
|
|
736
736
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
737
737
|
}, "strip", z.ZodTypeAny, {
|
|
738
738
|
_id: import("mongoose").Types.ObjectId;
|
|
739
|
-
populate?: any;
|
|
740
739
|
select?: Record<string, 0 | 1> | undefined;
|
|
740
|
+
populate?: any;
|
|
741
741
|
}, {
|
|
742
742
|
_id: string | import("mongoose").Types.ObjectId;
|
|
743
|
-
populate?: any;
|
|
744
743
|
select?: Record<string, 0 | 1> | undefined;
|
|
744
|
+
populate?: any;
|
|
745
745
|
}>;
|
|
746
746
|
export type GetByIdInputDTO = DTO<typeof GetByIdInputSchema>;
|
|
747
747
|
export declare const GetProductByIdInputSchema: z.ZodObject<{
|
|
@@ -754,12 +754,12 @@ export declare const GetProductByIdInputSchema: z.ZodObject<{
|
|
|
754
754
|
_id: import("mongoose").Types.ObjectId;
|
|
755
755
|
withAttributeHiddenItems: boolean;
|
|
756
756
|
withAddonsHiddenItems: boolean;
|
|
757
|
-
populate?: any;
|
|
758
757
|
select?: Record<string, 0 | 1> | undefined;
|
|
758
|
+
populate?: any;
|
|
759
759
|
}, {
|
|
760
760
|
_id: string | import("mongoose").Types.ObjectId;
|
|
761
|
-
populate?: any;
|
|
762
761
|
select?: Record<string, 0 | 1> | undefined;
|
|
762
|
+
populate?: any;
|
|
763
763
|
withAttributeHiddenItems?: boolean | undefined;
|
|
764
764
|
withAddonsHiddenItems?: boolean | undefined;
|
|
765
765
|
}>;
|
|
@@ -773,15 +773,15 @@ export declare const GetOrderByIdInputSchema: z.ZodObject<{
|
|
|
773
773
|
userOrderCompletionScope: z.ZodOptional<z.ZodNativeEnum<typeof UserOrderCompletionScope>>;
|
|
774
774
|
}, "strip", z.ZodTypeAny, {
|
|
775
775
|
_id: import("mongoose").Types.ObjectId;
|
|
776
|
-
populate?: any;
|
|
777
776
|
select?: Record<string, 0 | 1> | undefined;
|
|
777
|
+
populate?: any;
|
|
778
778
|
groupByCategories?: boolean | undefined;
|
|
779
779
|
getParentCategory?: boolean | undefined;
|
|
780
780
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
781
781
|
}, {
|
|
782
782
|
_id: string | import("mongoose").Types.ObjectId;
|
|
783
|
-
populate?: any;
|
|
784
783
|
select?: Record<string, 0 | 1> | undefined;
|
|
784
|
+
populate?: any;
|
|
785
785
|
groupByCategories?: boolean | undefined;
|
|
786
786
|
getParentCategory?: boolean | undefined;
|
|
787
787
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
@@ -791,11 +791,11 @@ export declare const GetByTokenInputSchema: z.ZodOptional<z.ZodObject<{
|
|
|
791
791
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
792
792
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
793
793
|
}, "strip", z.ZodTypeAny, {
|
|
794
|
-
populate?: any;
|
|
795
794
|
select?: Record<string, 0 | 1> | undefined;
|
|
796
|
-
}, {
|
|
797
795
|
populate?: any;
|
|
796
|
+
}, {
|
|
798
797
|
select?: Record<string, 0 | 1> | undefined;
|
|
798
|
+
populate?: any;
|
|
799
799
|
}>>;
|
|
800
800
|
export type GetByTokenInputDTO = DTO<typeof GetByTokenInputSchema>;
|
|
801
801
|
export declare const GetOneQuerySchema: z.ZodObject<{
|
|
@@ -803,12 +803,12 @@ export declare const GetOneQuerySchema: z.ZodObject<{
|
|
|
803
803
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
804
804
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
805
805
|
}, "strip", z.ZodTypeAny, {
|
|
806
|
-
populate?: any;
|
|
807
806
|
select?: Record<string, 0 | 1> | undefined;
|
|
807
|
+
populate?: any;
|
|
808
808
|
query?: Record<string, any> | undefined;
|
|
809
809
|
}, {
|
|
810
|
-
populate?: any;
|
|
811
810
|
select?: Record<string, 0 | 1> | undefined;
|
|
811
|
+
populate?: any;
|
|
812
812
|
query?: Record<string, any> | undefined;
|
|
813
813
|
}>;
|
|
814
814
|
export type GetOneQueryDTO = DTO<typeof GetOneQuerySchema>;
|