@lyxa.ai/core 1.3.266 → 1.3.267
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/service-promotion.model.d.ts +1 -2
- package/dist/libraries/mongo/models/service-promotion.model.js +6 -11
- package/dist/libraries/mongo/models/service-promotion.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
|
@@ -18,11 +18,10 @@ export declare class ServicePromotion {
|
|
|
18
18
|
maxDiscountPerOrder?: number;
|
|
19
19
|
isSpendLimitEnabled?: boolean;
|
|
20
20
|
spendLimit?: number;
|
|
21
|
-
spendAmount?: number;
|
|
22
21
|
valueType?: ValueType;
|
|
23
22
|
value?: number;
|
|
24
23
|
status: MarketingStatus;
|
|
25
|
-
deactivationReason?: string;
|
|
26
24
|
pausedAt?: Date | null;
|
|
27
25
|
createdBy?: Ref<Admin>;
|
|
26
|
+
amountSpent?: number;
|
|
28
27
|
}
|
|
@@ -30,13 +30,12 @@ let ServicePromotion = class ServicePromotion {
|
|
|
30
30
|
maxDiscountPerOrder;
|
|
31
31
|
isSpendLimitEnabled;
|
|
32
32
|
spendLimit;
|
|
33
|
-
spendAmount;
|
|
34
33
|
valueType;
|
|
35
34
|
value;
|
|
36
35
|
status;
|
|
37
|
-
deactivationReason;
|
|
38
36
|
pausedAt;
|
|
39
37
|
createdBy;
|
|
38
|
+
amountSpent;
|
|
40
39
|
};
|
|
41
40
|
exports.ServicePromotion = ServicePromotion;
|
|
42
41
|
__decorate([
|
|
@@ -88,11 +87,7 @@ __decorate([
|
|
|
88
87
|
__metadata("design:type", Number)
|
|
89
88
|
], ServicePromotion.prototype, "spendLimit", void 0);
|
|
90
89
|
__decorate([
|
|
91
|
-
(0, typegoose_1.prop)({ type:
|
|
92
|
-
__metadata("design:type", Number)
|
|
93
|
-
], ServicePromotion.prototype, "spendAmount", void 0);
|
|
94
|
-
__decorate([
|
|
95
|
-
(0, typegoose_1.prop)({ type: String, enum: enum_1.ValueType }),
|
|
90
|
+
(0, typegoose_1.prop)({ type: String, enum: enum_1.ValueType, default: enum_1.ValueType.PERCENTAGE }),
|
|
96
91
|
__metadata("design:type", String)
|
|
97
92
|
], ServicePromotion.prototype, "valueType", void 0);
|
|
98
93
|
__decorate([
|
|
@@ -107,10 +102,6 @@ __decorate([
|
|
|
107
102
|
}),
|
|
108
103
|
__metadata("design:type", String)
|
|
109
104
|
], ServicePromotion.prototype, "status", void 0);
|
|
110
|
-
__decorate([
|
|
111
|
-
(0, typegoose_1.prop)({ type: String }),
|
|
112
|
-
__metadata("design:type", String)
|
|
113
|
-
], ServicePromotion.prototype, "deactivationReason", void 0);
|
|
114
105
|
__decorate([
|
|
115
106
|
(0, typegoose_1.prop)({ type: Date, default: null }),
|
|
116
107
|
__metadata("design:type", Object)
|
|
@@ -119,6 +110,10 @@ __decorate([
|
|
|
119
110
|
(0, typegoose_1.prop)({ ref: () => admin_model_1.Admin }),
|
|
120
111
|
__metadata("design:type", Object)
|
|
121
112
|
], ServicePromotion.prototype, "createdBy", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, typegoose_1.prop)({ type: Number }),
|
|
115
|
+
__metadata("design:type", Number)
|
|
116
|
+
], ServicePromotion.prototype, "amountSpent", void 0);
|
|
122
117
|
exports.ServicePromotion = ServicePromotion = __decorate([
|
|
123
118
|
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'servicePromotions' } })
|
|
124
119
|
], ServicePromotion);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-promotion.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-promotion.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,iDAAwC;AACxC,kDAAoF;AACpF,mEAAyD;AACzD,+CAAsC;AACtC,4DAA8D;AAC9D,+DAAqD;AAG9C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAErB,MAAM,CAAe;IAGrB,aAAa,CAAiB;IAG9B,QAAQ,CAAY;IAGpB,kBAAkB,CAAW;IAG7B,eAAe,CAAyB;IAGxC,MAAM,CAAuB;IAG7B,YAAY,CAAW;IAGvB,UAAU,CAAe;IAGzB,4BAA4B,CAAW;IAGvC,mBAAmB,CAAU;IAG7B,mBAAmB,CAAW;IAG9B,UAAU,CAAU;IAGpB,
|
|
1
|
+
{"version":3,"file":"service-promotion.model.js","sourceRoot":"/","sources":["libraries/mongo/models/service-promotion.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,iDAAwC;AACxC,kDAAoF;AACpF,mEAAyD;AACzD,+CAAsC;AACtC,4DAA8D;AAC9D,+DAAqD;AAG9C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAErB,MAAM,CAAe;IAGrB,aAAa,CAAiB;IAG9B,QAAQ,CAAY;IAGpB,kBAAkB,CAAW;IAG7B,eAAe,CAAyB;IAGxC,MAAM,CAAuB;IAG7B,YAAY,CAAW;IAGvB,UAAU,CAAe;IAGzB,4BAA4B,CAAW;IAGvC,mBAAmB,CAAU;IAG7B,mBAAmB,CAAW;IAG9B,UAAU,CAAU;IAGpB,SAAS,CAAa;IAGtB,KAAK,CAAU;IAOf,MAAM,CAAkB;IAGxB,QAAQ,CAAe;IAGvB,SAAS,CAAc;IAGvB,WAAW,CAAU;CAC5B,CAAA;AA1DY,4CAAgB;AAErB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,CAAC;;gDAChB;AAGrB;IADN,IAA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AE,CAAC;;mDAC1C;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CACD;AAOf;IALN,IAAA,gBAAI,EAAC;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,sBAAe;QACrB,OAAO,EAAE,sBAAe,CAAC,MAAM;KAC/B,CAAC;;gDAC6B;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;kDACN;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;mDACG;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDACK;2BAzDhB,gBAAgB;IAD5B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,EAAE,CAAC;GACxD,gBAAgB,CA0D5B","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { MarketingStatus, PromotionType, ValueType } from '../../../utilities/enum';\nimport { ServicePackage } from './service-package.model';\nimport { Admin } from './admin.model';\nimport { Duration, SlotRange } from './shared/duration.model';\nimport { ServiceAddon } from './service-addon.model';\n\n@modelOptions({ schemaOptions: { collection: 'servicePromotions' } })\nexport class ServicePromotion {\n\t@prop({ required: true, ref: () => Vendor })\n\tpublic vendor!: Ref<Vendor>;\n\n\t@prop({ required: true, type: String, enum: PromotionType })\n\tpublic promotionType!: PromotionType;\n\n\t@prop({ required: true, type: Duration })\n\tpublic duration!: Duration;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isAppliedByCompany!: boolean;\n\n\t@prop({ ref: () => ServicePackage, default: [] })\n\tpublic servicePackages?: Ref<ServicePackage>[];\n\n\t@prop({ ref: () => ServiceAddon, default: [] })\n\tpublic addons?: Ref<ServiceAddon>[];\n\n\t@prop({ type: Boolean })\n\tpublic isEntireMenu?: boolean;\n\n\t@prop({ type: SlotRange, default: [] })\n\tpublic slotRanges?: SlotRange[];\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: Boolean, default: false })\n\tpublic isSpendLimitEnabled?: boolean;\n\n\t@prop({ type: Number, min: 0 })\n\tpublic spendLimit?: 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\t@prop({\n\t\ttype: String,\n\t\tenum: MarketingStatus,\n\t\tdefault: MarketingStatus.ACTIVE,\n\t})\n\tpublic status: MarketingStatus;\n\n\t@prop({ type: Date, default: null })\n\tpublic pausedAt?: Date | null;\n\n\t@prop({ ref: () => Admin })\n\tpublic createdBy?: Ref<Admin>;\n\n\t@prop({ type: Number })\n\tpublic amountSpent?: number;\n}\n"]}
|
|
@@ -5,10 +5,10 @@ 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;
|
|
11
10
|
entity: import("../context").EntityContext | undefined;
|
|
11
|
+
req: import("http").IncomingMessage;
|
|
12
12
|
requestId: string | undefined;
|
|
13
13
|
usedRefreshToken: boolean | undefined;
|
|
14
14
|
tokenRenewed: boolean | undefined;
|
|
@@ -4,10 +4,10 @@ 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;
|
|
10
9
|
entity: import("../context").EntityContext | undefined;
|
|
10
|
+
req: import("http").IncomingMessage;
|
|
11
11
|
requestId: string | undefined;
|
|
12
12
|
usedRefreshToken: boolean | undefined;
|
|
13
13
|
tokenRenewed: boolean | undefined;
|
|
@@ -3,10 +3,10 @@ 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;
|
|
9
8
|
entity: import("../context").EntityContext | undefined;
|
|
9
|
+
req: import("http").IncomingMessage;
|
|
10
10
|
requestId: string | undefined;
|
|
11
11
|
usedRefreshToken: boolean | undefined;
|
|
12
12
|
tokenRenewed: boolean | undefined;
|
|
@@ -5,10 +5,10 @@ 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;
|
|
11
10
|
entity: import("../context").EntityContext | undefined;
|
|
11
|
+
req: import("http").IncomingMessage;
|
|
12
12
|
requestId: string | undefined;
|
|
13
13
|
usedRefreshToken: boolean | undefined;
|
|
14
14
|
tokenRenewed: 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
|
}>>;
|
|
@@ -733,12 +733,12 @@ export declare const GetByIdInputSchema: z.ZodObject<{
|
|
|
733
733
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
734
734
|
}, "strip", z.ZodTypeAny, {
|
|
735
735
|
_id: import("mongoose").Types.ObjectId;
|
|
736
|
-
populate?: any;
|
|
737
736
|
select?: Record<string, 0 | 1> | undefined;
|
|
737
|
+
populate?: any;
|
|
738
738
|
}, {
|
|
739
739
|
_id: string | import("mongoose").Types.ObjectId;
|
|
740
|
-
populate?: any;
|
|
741
740
|
select?: Record<string, 0 | 1> | undefined;
|
|
741
|
+
populate?: any;
|
|
742
742
|
}>;
|
|
743
743
|
export type GetByIdInputDTO = DTO<typeof GetByIdInputSchema>;
|
|
744
744
|
export declare const GetProductByIdInputSchema: z.ZodObject<{
|
|
@@ -751,12 +751,12 @@ export declare const GetProductByIdInputSchema: z.ZodObject<{
|
|
|
751
751
|
_id: import("mongoose").Types.ObjectId;
|
|
752
752
|
withAttributeHiddenItems: boolean;
|
|
753
753
|
withAddonsHiddenItems: boolean;
|
|
754
|
-
populate?: any;
|
|
755
754
|
select?: Record<string, 0 | 1> | undefined;
|
|
755
|
+
populate?: any;
|
|
756
756
|
}, {
|
|
757
757
|
_id: string | import("mongoose").Types.ObjectId;
|
|
758
|
-
populate?: any;
|
|
759
758
|
select?: Record<string, 0 | 1> | undefined;
|
|
759
|
+
populate?: any;
|
|
760
760
|
withAttributeHiddenItems?: boolean | undefined;
|
|
761
761
|
withAddonsHiddenItems?: boolean | undefined;
|
|
762
762
|
}>;
|
|
@@ -768,13 +768,13 @@ export declare const GetOrderByIdInputSchema: z.ZodObject<{
|
|
|
768
768
|
userOrderCompletionScope: z.ZodOptional<z.ZodNativeEnum<typeof UserOrderCompletionScope>>;
|
|
769
769
|
}, "strip", z.ZodTypeAny, {
|
|
770
770
|
_id: import("mongoose").Types.ObjectId;
|
|
771
|
-
populate?: any;
|
|
772
771
|
select?: Record<string, 0 | 1> | undefined;
|
|
772
|
+
populate?: any;
|
|
773
773
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
774
774
|
}, {
|
|
775
775
|
_id: string | import("mongoose").Types.ObjectId;
|
|
776
|
-
populate?: any;
|
|
777
776
|
select?: Record<string, 0 | 1> | undefined;
|
|
777
|
+
populate?: any;
|
|
778
778
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
779
779
|
}>;
|
|
780
780
|
export type GetOrderByIdInputDTO = DTO<typeof GetOrderByIdInputSchema>;
|
|
@@ -782,11 +782,11 @@ export declare const GetByTokenInputSchema: z.ZodOptional<z.ZodObject<{
|
|
|
782
782
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
783
783
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
784
784
|
}, "strip", z.ZodTypeAny, {
|
|
785
|
-
populate?: any;
|
|
786
785
|
select?: Record<string, 0 | 1> | undefined;
|
|
787
|
-
}, {
|
|
788
786
|
populate?: any;
|
|
787
|
+
}, {
|
|
789
788
|
select?: Record<string, 0 | 1> | undefined;
|
|
789
|
+
populate?: any;
|
|
790
790
|
}>>;
|
|
791
791
|
export type GetByTokenInputDTO = DTO<typeof GetByTokenInputSchema>;
|
|
792
792
|
export declare const GetOneQuerySchema: z.ZodObject<{
|
|
@@ -794,12 +794,12 @@ export declare const GetOneQuerySchema: z.ZodObject<{
|
|
|
794
794
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
795
795
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
796
796
|
}, "strip", z.ZodTypeAny, {
|
|
797
|
-
populate?: any;
|
|
798
797
|
select?: Record<string, 0 | 1> | undefined;
|
|
798
|
+
populate?: any;
|
|
799
799
|
query?: Record<string, any> | undefined;
|
|
800
800
|
}, {
|
|
801
|
-
populate?: any;
|
|
802
801
|
select?: Record<string, 0 | 1> | undefined;
|
|
802
|
+
populate?: any;
|
|
803
803
|
query?: Record<string, any> | undefined;
|
|
804
804
|
}>;
|
|
805
805
|
export type GetOneQueryDTO = DTO<typeof GetOneQuerySchema>;
|