@lyxa.ai/core 1.4.230 → 1.4.231
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-booking-pricing.model.d.ts +1 -2
- package/dist/libraries/mongo/models/embedded/service-booking-pricing.model.js +1 -2
- package/dist/libraries/mongo/models/embedded/service-booking-pricing.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/service-line-item.model.d.ts +4 -0
- package/dist/libraries/mongo/models/embedded/service-line-item.model.js +16 -0
- package/dist/libraries/mongo/models/embedded/service-line-item.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/shared/common-methods.js +1 -1
- package/dist/types/utilities/shared/common-methods.js.map +1 -1
- package/dist/types/utilities/validation/common-validation.d.ts +12 -12
- package/dist/utilities/shared/common-methods.js +1 -1
- package/dist/utilities/shared/common-methods.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,8 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ServiceBookingPricing = void 0;
|
|
13
13
|
const typegoose_1 = require("@typegoose/typegoose");
|
|
14
|
-
|
|
15
|
-
class ServiceBookingPricing extends defaultClasses_1.TimeStamps {
|
|
14
|
+
class ServiceBookingPricing {
|
|
16
15
|
subtotal;
|
|
17
16
|
secondarySubtotal;
|
|
18
17
|
materialCost;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-booking-pricing.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/service-booking-pricing.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;
|
|
1
|
+
{"version":3,"file":"service-booking-pricing.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/service-booking-pricing.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAE5C,MAAa,qBAAqB;IAE1B,QAAQ,CAAU;IAGlB,iBAAiB,CAAU;IAG3B,YAAY,CAAU;IAGtB,qBAAqB,CAAU;IAG/B,QAAQ,CAAU;IAGlB,iBAAiB,CAAU;IAG3B,cAAc,CAAU;IAGxB,uBAAuB,CAAU;IAGjC,eAAe,CAAU;IAGzB,wBAAwB,CAAU;IAGlC,kBAAkB,CAAU;IAG5B,2BAA2B,CAAU;IAGrC,KAAK,CAAU;IAGf,cAAc,CAAU;IAGxB,MAAM,CAAU;IAGhB,eAAe,CAAU;IAGzB,aAAa,CAAU;IAGvB,sBAAsB,CAAU;IAGhC,UAAU,CAAU;IAGpB,mBAAmB,CAAU;IAI7B,YAAY,CAAU;IAGtB,qBAAqB,CAAU;CACtC;AAnED,sDAmEC;AAjEO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;uDACV;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;gEACD;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;2DACN;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oEACG;AAG/B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;uDACV;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,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AAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;yDACR;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;kEACC;AAI7B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;2DACN;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oEACG","sourcesContent":["import { prop } from '@typegoose/typegoose';\n\nexport class ServiceBookingPricing {\n\t@prop({ type: Number, default: 0 })\n\tpublic subtotal?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondarySubtotal?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic materialCost?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondaryMaterialCost?: number;\n\n\t@prop({ type: Number, default: 0 }) // slotDiscount + packageDiscount\n\tpublic discount?: number;\n\n\t@prop({ type: Number, default: 0 }) // slotDiscount + packageDiscount\n\tpublic secondaryDiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic couponDiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondaryCouponDiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic reschedulingFee?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondaryReschedulingFee?: number;\n\n\t@prop({ type: Number, default: 0 }) // negative wallet deduction\n\tpublic outstandingBalance?: number;\n\n\t@prop({ type: Number, default: 0 }) // negative wallet deduction\n\tpublic secondaryOutstandingBalance?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic total?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondaryTotal?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic wallet?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondaryWallet?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic reserveWallet?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondaryReserveWallet?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic paidAmount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondaryPaidAmount?: number;\n\n\t// It is also including discount\n\t@prop({ type: Number, default: 0 })\n\tpublic slotDiscount?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic secondarySlotDiscount?: number;\n}\n"]}
|
|
@@ -4,6 +4,7 @@ import { ServicePackage } from '../service-package.model';
|
|
|
4
4
|
import { ServiceAddon } from '../service-addon.model';
|
|
5
5
|
import { PreparingTime } from './preparing-time.model';
|
|
6
6
|
import { ServicePromotion } from '../service-promotion.model';
|
|
7
|
+
import { ServicePromotionCut } from './marketing-cut.model';
|
|
7
8
|
export declare class LineItemSnap {
|
|
8
9
|
name?: string;
|
|
9
10
|
image?: string;
|
|
@@ -30,5 +31,8 @@ export declare class ServiceLineItem {
|
|
|
30
31
|
secondaryPrice?: number;
|
|
31
32
|
discountedPrice?: number;
|
|
32
33
|
secondaryDiscountedPrice?: number;
|
|
34
|
+
discountAmount?: number;
|
|
35
|
+
secondaryDiscountAmount?: number;
|
|
33
36
|
promotionSnaps?: PromotionSnap[];
|
|
37
|
+
discount?: ServicePromotionCut;
|
|
34
38
|
}
|
|
@@ -16,6 +16,7 @@ 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
18
|
const service_promotion_model_1 = require("../service-promotion.model");
|
|
19
|
+
const marketing_cut_model_1 = require("./marketing-cut.model");
|
|
19
20
|
class LineItemSnap {
|
|
20
21
|
name;
|
|
21
22
|
image;
|
|
@@ -92,7 +93,10 @@ class ServiceLineItem {
|
|
|
92
93
|
secondaryPrice;
|
|
93
94
|
discountedPrice;
|
|
94
95
|
secondaryDiscountedPrice;
|
|
96
|
+
discountAmount;
|
|
97
|
+
secondaryDiscountAmount;
|
|
95
98
|
promotionSnaps;
|
|
99
|
+
discount;
|
|
96
100
|
}
|
|
97
101
|
exports.ServiceLineItem = ServiceLineItem;
|
|
98
102
|
__decorate([
|
|
@@ -131,8 +135,20 @@ __decorate([
|
|
|
131
135
|
(0, typegoose_1.prop)({ type: Number }),
|
|
132
136
|
__metadata("design:type", Number)
|
|
133
137
|
], ServiceLineItem.prototype, "secondaryDiscountedPrice", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, typegoose_1.prop)({ type: Number }),
|
|
140
|
+
__metadata("design:type", Number)
|
|
141
|
+
], ServiceLineItem.prototype, "discountAmount", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, typegoose_1.prop)({ type: Number }),
|
|
144
|
+
__metadata("design:type", Number)
|
|
145
|
+
], ServiceLineItem.prototype, "secondaryDiscountAmount", void 0);
|
|
134
146
|
__decorate([
|
|
135
147
|
(0, typegoose_1.prop)({ type: [PromotionSnap], _id: false }),
|
|
136
148
|
__metadata("design:type", Array)
|
|
137
149
|
], ServiceLineItem.prototype, "promotionSnaps", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, typegoose_1.prop)({ type: () => marketing_cut_model_1.ServicePromotionCut, _id: false }),
|
|
152
|
+
__metadata("design:type", marketing_cut_model_1.ServicePromotionCut)
|
|
153
|
+
], ServiceLineItem.prototype, "discount", void 0);
|
|
138
154
|
//# 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,qDAA4E;AAC5E,oEAA0D;AAC1D,gEAAsD;AACtD,iEAAuD;AACvD,wEAA8D;
|
|
1
|
+
{"version":3,"file":"service-line-item.model.js","sourceRoot":"/","sources":["libraries/mongo/models/emb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A,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,MAAM,EAAE,CAAC;;uDACQ;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gEACiB;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;;uDACJ;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,yCAAmB,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;8BACpC,yCAAmB;iDAAC","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';\nimport { ServicePromotionCut } from './marketing-cut.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: Number })\n\tpublic discountAmount?: number;\n\n\t@prop({ type: Number })\n\tpublic secondaryDiscountAmount?: number;\n\n\t@prop({ type: [PromotionSnap], _id: false })\n\tpublic promotionSnaps?: PromotionSnap[];\n\n\t@prop({ type: () => ServicePromotionCut, _id: false })\n\tpublic discount?: ServicePromotionCut;\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
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isGroceryFamilyItemType = isGroceryFamilyItemType;
|
|
4
4
|
exports.getProductDietariesByItemType = getProductDietariesByItemType;
|
|
5
5
|
const enum_1 = require("../enum");
|
|
6
|
-
const GROCERY_FAMILY_ITEM_TYPES = [enum_1.ItemType.GROCERY, enum_1.ItemType.PET];
|
|
6
|
+
const GROCERY_FAMILY_ITEM_TYPES = [enum_1.ItemType.GROCERY, enum_1.ItemType.PET, enum_1.ItemType.WELLNESS, enum_1.ItemType.ELECTRONICS, enum_1.ItemType.BEAUTY];
|
|
7
7
|
function isGroceryFamilyItemType(itemType) {
|
|
8
8
|
return GROCERY_FAMILY_ITEM_TYPES.includes(itemType);
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-methods.js","sourceRoot":"/","sources":["utilities/shared/common-methods.ts"],"names":[],"mappings":";;AAIA,0DAEC;AAED,sEAmBC;AA3BD,kCAAuD;AAEvD,MAAM,yBAAyB,GAAe,CAAC,eAAQ,CAAC,OAAO,EAAE,eAAQ,CAAC,GAAG,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"common-methods.js","sourceRoot":"/","sources":["utilities/shared/common-methods.ts"],"names":[],"mappings":";;AAIA,0DAEC;AAED,sEAmBC;AA3BD,kCAAuD;AAEvD,MAA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EAAE,IAAI,EAAE,4EAA4E,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,yBAAkB,CAAC,KAAK,EAAE;YACpJ,EAAE,IAAI,EAAE,iFAAiF,EAAE,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,yBAAkB,CAAC,WAAW,EAAE;YACrK,EAAE,IAAI,EAAE,sFAAsF,EAAE,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,yBAAkB,CAAC,OAAO,EAAE;SACrK,CAAC;IACN,CAAC;AACL,CAAC","sourcesContent":["import { ItemType, ProductDietaryType } from \"../enum\";\n\nconst GROCERY_FAMILY_ITEM_TYPES: ItemType[] = [ItemType.GROCERY, ItemType.PET, ItemType.WELLNESS, ItemType.ELECTRONICS, ItemType.BEAUTY] as const;\n\nexport function isGroceryFamilyItemType(itemType: ItemType): boolean {\n return GROCERY_FAMILY_ITEM_TYPES.includes(itemType);\n}\n\nexport function getProductDietariesByItemType(itemType: ItemType): { icon: string, label: string, productDietaryType: ProductDietaryType }[] {\n if (isGroceryFamilyItemType(itemType)) {\n return [\n { icon: '', label: 'Gluten Free', productDietaryType: ProductDietaryType.GLUTEN_FREE },\n { icon: '', label: 'Lactose Free', productDietaryType: ProductDietaryType.LACTOSE_FREE },\n { icon: '', label: 'Low Cal', productDietaryType: ProductDietaryType.LOW_CAL },\n { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/vegetarian.png', label: 'Vegetarian', productDietaryType: ProductDietaryType.VEGETARIAN },\n { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/vegan.png', label: 'Vegan', productDietaryType: ProductDietaryType.VEGAN },\n { icon: '', label: 'Keto', productDietaryType: ProductDietaryType.KETO },\n { icon: '', label: 'High Protein', productDietaryType: ProductDietaryType.HIGH_PROTEIN }\n ];\n } else {\n return [\n { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/vegetarian.png', label: 'Vegeterian', productDietaryType: ProductDietaryType.VEGETARIAN },\n { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/vegan.png', label: 'Vegan', productDietaryType: ProductDietaryType.VEGAN },\n { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/glutenFree.png', label: 'Gluten Free', productDietaryType: ProductDietaryType.GLUTEN_FREE },\n { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/allergyFriendly.png', label: 'Low Cal', productDietaryType: ProductDietaryType.LOW_CAL }\n ];\n }\n}"]}
|
|
@@ -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
|
}>>;
|
|
@@ -735,12 +735,12 @@ export declare const GetByIdInputSchema: z.ZodObject<{
|
|
|
735
735
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
736
736
|
}, "strip", z.ZodTypeAny, {
|
|
737
737
|
_id: import("mongoose").Types.ObjectId;
|
|
738
|
-
populate?: any;
|
|
739
738
|
select?: Record<string, 0 | 1> | undefined;
|
|
739
|
+
populate?: any;
|
|
740
740
|
}, {
|
|
741
741
|
_id: string | import("mongoose").Types.ObjectId;
|
|
742
|
-
populate?: any;
|
|
743
742
|
select?: Record<string, 0 | 1> | undefined;
|
|
743
|
+
populate?: any;
|
|
744
744
|
}>;
|
|
745
745
|
export type GetByIdInputDTO = DTO<typeof GetByIdInputSchema>;
|
|
746
746
|
export declare const GetProductByIdInputSchema: z.ZodObject<{
|
|
@@ -753,12 +753,12 @@ export declare const GetProductByIdInputSchema: z.ZodObject<{
|
|
|
753
753
|
_id: import("mongoose").Types.ObjectId;
|
|
754
754
|
withAttributeHiddenItems: boolean;
|
|
755
755
|
withAddonsHiddenItems: boolean;
|
|
756
|
-
populate?: any;
|
|
757
756
|
select?: Record<string, 0 | 1> | undefined;
|
|
757
|
+
populate?: any;
|
|
758
758
|
}, {
|
|
759
759
|
_id: string | import("mongoose").Types.ObjectId;
|
|
760
|
-
populate?: any;
|
|
761
760
|
select?: Record<string, 0 | 1> | undefined;
|
|
761
|
+
populate?: any;
|
|
762
762
|
withAttributeHiddenItems?: boolean | undefined;
|
|
763
763
|
withAddonsHiddenItems?: boolean | undefined;
|
|
764
764
|
}>;
|
|
@@ -772,15 +772,15 @@ export declare const GetOrderByIdInputSchema: z.ZodObject<{
|
|
|
772
772
|
userOrderCompletionScope: z.ZodOptional<z.ZodNativeEnum<typeof UserOrderCompletionScope>>;
|
|
773
773
|
}, "strip", z.ZodTypeAny, {
|
|
774
774
|
_id: import("mongoose").Types.ObjectId;
|
|
775
|
-
populate?: any;
|
|
776
775
|
select?: Record<string, 0 | 1> | undefined;
|
|
776
|
+
populate?: any;
|
|
777
777
|
groupByCategories?: boolean | undefined;
|
|
778
778
|
getParentCategory?: boolean | undefined;
|
|
779
779
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
780
780
|
}, {
|
|
781
781
|
_id: string | import("mongoose").Types.ObjectId;
|
|
782
|
-
populate?: any;
|
|
783
782
|
select?: Record<string, 0 | 1> | undefined;
|
|
783
|
+
populate?: any;
|
|
784
784
|
groupByCategories?: boolean | undefined;
|
|
785
785
|
getParentCategory?: boolean | undefined;
|
|
786
786
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
@@ -790,11 +790,11 @@ export declare const GetByTokenInputSchema: z.ZodOptional<z.ZodObject<{
|
|
|
790
790
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
791
791
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
792
792
|
}, "strip", z.ZodTypeAny, {
|
|
793
|
-
populate?: any;
|
|
794
793
|
select?: Record<string, 0 | 1> | undefined;
|
|
795
|
-
}, {
|
|
796
794
|
populate?: any;
|
|
795
|
+
}, {
|
|
797
796
|
select?: Record<string, 0 | 1> | undefined;
|
|
797
|
+
populate?: any;
|
|
798
798
|
}>>;
|
|
799
799
|
export type GetByTokenInputDTO = DTO<typeof GetByTokenInputSchema>;
|
|
800
800
|
export declare const GetOneQuerySchema: z.ZodObject<{
|
|
@@ -802,12 +802,12 @@ export declare const GetOneQuerySchema: z.ZodObject<{
|
|
|
802
802
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
803
803
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
804
804
|
}, "strip", z.ZodTypeAny, {
|
|
805
|
-
populate?: any;
|
|
806
805
|
select?: Record<string, 0 | 1> | undefined;
|
|
806
|
+
populate?: any;
|
|
807
807
|
query?: Record<string, any> | undefined;
|
|
808
808
|
}, {
|
|
809
|
-
populate?: any;
|
|
810
809
|
select?: Record<string, 0 | 1> | undefined;
|
|
810
|
+
populate?: any;
|
|
811
811
|
query?: Record<string, any> | undefined;
|
|
812
812
|
}>;
|
|
813
813
|
export type GetOneQueryDTO = DTO<typeof GetOneQuerySchema>;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isGroceryFamilyItemType = isGroceryFamilyItemType;
|
|
4
4
|
exports.getProductDietariesByItemType = getProductDietariesByItemType;
|
|
5
5
|
const enum_1 = require("../enum");
|
|
6
|
-
const GROCERY_FAMILY_ITEM_TYPES = [enum_1.ItemType.GROCERY, enum_1.ItemType.PET];
|
|
6
|
+
const GROCERY_FAMILY_ITEM_TYPES = [enum_1.ItemType.GROCERY, enum_1.ItemType.PET, enum_1.ItemType.WELLNESS, enum_1.ItemType.ELECTRONICS, enum_1.ItemType.BEAUTY];
|
|
7
7
|
function isGroceryFamilyItemType(itemType) {
|
|
8
8
|
return GROCERY_FAMILY_ITEM_TYPES.includes(itemType);
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-methods.js","sourceRoot":"/","sources":["utilities/shared/common-methods.ts"],"names":[],"mappings":";;AAIA,0DAEC;AAED,sEAmBC;AA3BD,kCAAuD;AAEvD,MAAM,yBAAyB,GAAe,CAAC,eAAQ,CAAC,OAAO,EAAE,eAAQ,CAAC,GAAG,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"common-methods.js","sourceRoot":"/","sources":["utilities/shared/common-methods.ts"],"names":[],"mappings":";;AAIA,0DAEC;AAED,sEAmBC;AA3BD,kCAAuD;AAEvD,MAAM,yBAAyB,GAAe,CAAC,eAAQ,CAAC,OAAO,EAAE,eAAQ,CAAC,GAAG,EAAE,eAAQ,CAAC,QAAQ,EAAE,eAAQ,CAAC,WAAW,EAAE,eAAQ,CAAC,MAAM,CAAU,CAAC;AAElJ,SAAgB,uBAAuB,CAAC,QAAkB;IACtD,OAAO,yBAAyB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACxD,CAAC;AAED,SAAgB,6BAA6B,CAAC,QAAkB;IA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EAAE;SACrK,CAAC;IACN,CAAC;AACL,CAAC","sourcesContent":["import { ItemType, ProductDietaryType } from \"../enum\";\n\nconst GROCERY_FAMILY_ITEM_TYPES: ItemType[] = [ItemType.GROCERY, ItemType.PET, ItemType.WELLNESS, ItemType.ELECTRONICS, ItemType.BEAUTY] as const;\n\nexport function isGroceryFamilyItemType(itemType: ItemType): boolean {\n return GROCERY_FAMILY_ITEM_TYPES.includes(itemType);\n}\n\nexport function getProductDietariesByItemType(itemType: ItemType): { icon: string, label: string, productDietaryType: ProductDietaryType }[] {\n if (isGroceryFamilyItemType(itemType)) {\n return [\n { icon: '', label: 'Gluten Free', productDietaryType: ProductDietaryType.GLUTEN_FREE },\n { icon: '', label: 'Lactose Free', productDietaryType: ProductDietaryType.LACTOSE_FREE },\n { icon: '', label: 'Low Cal', productDietaryType: ProductDietaryType.LOW_CAL },\n { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/vegetarian.png', label: 'Vegetarian', productDietaryType: ProductDietaryType.VEGETARIAN },\n { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/vegan.png', label: 'Vegan', productDietaryType: ProductDietaryType.VEGAN },\n { icon: '', label: 'Keto', productDietaryType: ProductDietaryType.KETO },\n { icon: '', label: 'High Protein', productDietaryType: ProductDietaryType.HIGH_PROTEIN }\n ];\n } else {\n return [\n { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/vegetarian.png', label: 'Vegeterian', productDietaryType: ProductDietaryType.VEGETARIAN },\n { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/vegan.png', label: 'Vegan', productDietaryType: ProductDietaryType.VEGAN },\n { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/glutenFree.png', label: 'Gluten Free', productDietaryType: ProductDietaryType.GLUTEN_FREE },\n { icon: 'https://storage.googleapis.com/lyxa-global/product-dietary-icons/allergyFriendly.png', label: 'Low Cal', productDietaryType: ProductDietaryType.LOW_CAL }\n ];\n }\n}"]}
|