@lyxa.ai/core 1.3.173 → 1.3.175

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.
@@ -11,9 +11,11 @@ export declare class ServicePromotion {
11
11
  servicePackages?: Ref<ServicePackage>[];
12
12
  isEntireMenu?: boolean;
13
13
  slotRange?: SlotRange[];
14
+ isMaxDiscountPerOrderEnabled?: boolean;
15
+ maxDiscountPerOrder?: number;
16
+ isSpendLimitEnabled?: boolean;
14
17
  spendLimit?: number;
15
18
  spendAmount?: number;
16
- maxDiscountPerOrder?: number;
17
19
  valueType?: ValueType;
18
20
  value?: number;
19
21
  deactivationReason?: string;
@@ -23,9 +23,11 @@ let ServicePromotion = class ServicePromotion {
23
23
  servicePackages;
24
24
  isEntireMenu;
25
25
  slotRange;
26
+ isMaxDiscountPerOrderEnabled;
27
+ maxDiscountPerOrder;
28
+ isSpendLimitEnabled;
26
29
  spendLimit;
27
30
  spendAmount;
28
- maxDiscountPerOrder;
29
31
  valueType;
30
32
  value;
31
33
  deactivationReason;
@@ -61,6 +63,18 @@ __decorate([
61
63
  (0, typegoose_1.prop)({ type: promotion_duration_model_1.SlotRange }),
62
64
  __metadata("design:type", Array)
63
65
  ], ServicePromotion.prototype, "slotRange", void 0);
66
+ __decorate([
67
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
68
+ __metadata("design:type", Boolean)
69
+ ], ServicePromotion.prototype, "isMaxDiscountPerOrderEnabled", void 0);
70
+ __decorate([
71
+ (0, typegoose_1.prop)({ type: Number }),
72
+ __metadata("design:type", Number)
73
+ ], ServicePromotion.prototype, "maxDiscountPerOrder", void 0);
74
+ __decorate([
75
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
76
+ __metadata("design:type", Boolean)
77
+ ], ServicePromotion.prototype, "isSpendLimitEnabled", void 0);
64
78
  __decorate([
65
79
  (0, typegoose_1.prop)({ type: Number, min: 0 }),
66
80
  __metadata("design:type", Number)
@@ -69,10 +83,6 @@ __decorate([
69
83
  (0, typegoose_1.prop)({ type: Number, default: 0, min: 0 }),
70
84
  __metadata("design:type", Number)
71
85
  ], ServicePromotion.prototype, "spendAmount", void 0);
72
- __decorate([
73
- (0, typegoose_1.prop)({ type: Number }),
74
- __metadata("design:type", Number)
75
- ], ServicePromotion.prototype, "maxDiscountPerOrder", void 0);
76
86
  __decorate([
77
87
  (0, typegoose_1.prop)({ type: String, enum: enum_1.ValueType }),
78
88
  __metadata("design:type", String)
@@ -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,gFAAwE;AACxE,mEAAyD;AAGlD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAElB,MAAM,CAAe;IAGrB,aAAa,CAAiB;IAG9B,QAAQ,CAAW;IAGtB,kBAAkB,CAAW;IAG1B,eAAe,CAAwB;IAGvC,YAAY,CAAW;IAGvB,SAAS,CAAc;IAGvB,UAAU,CAAU;IAGpB,WAAW,CAAU;IAGrB,mBAAmB,CAAU;IAG7B,SAAS,CAAa;IAGtB,KAAK,CAAU;IAGf,kBAAkB,CAAU;IAG5B,WAAW,CAAU;IAOrB,MAAM,CAAkB;CAClC,CAAA;AAjDY,4CAAgB;AAElB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAChB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,oBAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACT;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,mCAAQ,EAAE,CAAC;8BACvB,mCAAQ;kDAAA;AAGtB;IADH,IAAA,gBAAI,EAAC,EAAE,QAA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AAE,CAAC;GACxD,gBAAgB,CAiD5B","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { MarketingStatus, PromotionType, ValueType } from '../../../utilities/enum';\nimport { Duration, SlotRange } from './shared/promotion-duration.model'; \nimport { ServicePackage } from './service-package.model';\n \n@modelOptions({ schemaOptions: { collection: 'servicePromotions' } })\nexport class ServicePromotion {\n @prop({ ref: () => Vendor, required: true })\n public vendor!: Ref<Vendor>;\n \n @prop({ enum: PromotionType, required: true })\n public promotionType!: PromotionType;\n\n @prop({ required: true, type: Duration })\n public duration!: Duration\n\n @prop({ required: true, type: Boolean })\n\tpublic isAppliedByCompany!: boolean;\n\n @prop({ ref: () => ServicePackage, required: true })\n public servicePackages?: Ref<ServicePackage>[]\n\n @prop({ type: Boolean })\n public isEntireMenu?: boolean;\n\n @prop({ type: SlotRange })\n public slotRange?: SlotRange[]\n\n @prop({ type: Number, min: 0 })\n public spendLimit?: number;\n\n @prop({ type: Number, default: 0, min: 0 })\n public spendAmount?: number;\n\n @prop({ type: Number })\n public maxDiscountPerOrder?: number;\n\n @prop({ type: String, enum: ValueType })\n public valueType?: ValueType;\n\n @prop({ type: Number })\n public value?: number;\n\n @prop({ type: String })\n public deactivationReason?: string;\n\n @prop({ type: String, trim: true, maxlength: 500 })\n public description?: string;\n\n @prop({\n type: String,\n enum: MarketingStatus,\n default: MarketingStatus.ACTIVE,\n })\n public status: MarketingStatus;\n}\n"]}
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,gFAAwE;AACxE,mEAAyD;AAGlD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAElB,MAAM,CAAe;IAGrB,aAAa,CAAiB;IAG9B,QAAQ,CAAW;IAGnB,kBAAkB,CAAW;IAG7B,eAAe,CAA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,EAAE,CAAC;;6DACH;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;oDACJ;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;;qDACf;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,CAAC;;mDACX;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CACD;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4DACY;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;;qDACvB;AAOrB;IALN,IAAA,gBAAI,EAAC;QACF,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,sBAAe;QACrB,OAAO,EAAE,sBAAe,CAAC,MAAM;KAClC,CAAC;;gDAC6B;2BAtDtB,gBAAgB;IAD5B,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE,EAAE,CAAC;GACxD,gBAAgB,CAuD5B","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { MarketingStatus, PromotionType, ValueType } from '../../../utilities/enum';\nimport { Duration, SlotRange } from './shared/promotion-duration.model';\nimport { ServicePackage } from './service-package.model';\n\n@modelOptions({ schemaOptions: { collection: 'servicePromotions' } })\nexport class ServicePromotion {\n @prop({ ref: () => Vendor, required: true })\n public vendor!: Ref<Vendor>;\n\n @prop({ enum: PromotionType, required: true })\n public promotionType!: PromotionType;\n\n @prop({ required: true, type: Duration })\n public duration!: Duration\n\n @prop({ required: true, type: Boolean })\n public isAppliedByCompany!: boolean;\n\n @prop({ ref: () => ServicePackage, required: true })\n public servicePackages?: Ref<ServicePackage>[]\n\n @prop({ type: Boolean })\n public isEntireMenu?: boolean;\n\n @prop({ type: SlotRange })\n public slotRange?: SlotRange[]\n\n @prop({ type: Boolean, default: false })\n public isMaxDiscountPerOrderEnabled?: boolean;\n\n @prop({ type: Number })\n public maxDiscountPerOrder?: number;\n\n @prop({ type: Boolean, default: false })\n public isSpendLimitEnabled?: boolean;\n \n @prop({ type: Number, min: 0 })\n public spendLimit?: number;\n\n @prop({ type: Number, default: 0, min: 0 })\n public spendAmount?: number;\n\n @prop({ type: String, enum: ValueType })\n public valueType?: ValueType;\n\n @prop({ type: Number })\n public value?: number;\n\n @prop({ type: String })\n public deactivationReason?: string;\n\n @prop({ type: String, trim: true, maxlength: 500 })\n public description?: string;\n\n @prop({\n type: String,\n enum: MarketingStatus,\n default: MarketingStatus.ACTIVE,\n })\n public status: MarketingStatus;\n}\n"]}
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.3.173
25
+ Version: 1.3.175
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.3.173",
3
+ "version": "1.3.175",
4
4
  "description": "Lyxa type definitions and validation schemas for both frontend and backend",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",
@@ -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>;
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.hashPassword = hashPassword;
7
7
  exports.verifyPassword = verifyPassword;
8
- const server_1 = require("@trpc/server");
9
8
  const bcryptjs_1 = __importDefault(require("bcryptjs"));
9
+ const error_common_1 = require("./error-common");
10
10
  async function hashPassword(password) {
11
11
  const salt = await bcryptjs_1.default.genSalt(10);
12
12
  return bcryptjs_1.default.hash(password, salt);
@@ -14,10 +14,7 @@ async function hashPassword(password) {
14
14
  async function verifyPassword(inputPassword, hashedPassword) {
15
15
  const isPasswordValid = await bcryptjs_1.default.compare(inputPassword, hashedPassword);
16
16
  if (!isPasswordValid) {
17
- throw new server_1.TRPCError({
18
- code: 'UNAUTHORIZED',
19
- message: 'Incorrect email or password.',
20
- });
17
+ (0, error_common_1.badRequestError)('Incorrect email or password');
21
18
  }
22
19
  }
23
20
  //# sourceMappingURL=password.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"password.js","sourceRoot":"/","sources":["utilities/password.ts"],"names":[],"mappings":";;;;;AAGA,oCAGC;AAED,wCAQC;AAhBD,yCAAyC;AACzC,wDAA8B;AAEvB,KAAK,UAAU,YAAY,CAAC,QAAgB;IAClD,MAAM,IAAI,GAAG,MAAM,kBAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACtC,OAAO,kBAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC;AAEM,KAAK,UAAU,cAAc,CAAC,aAAqB,EAAE,cAAsB;IACjF,MAAM,eAAe,GAAG,MAAM,kBAAM,CAAC,OAAO,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IAC5E,IAAI,CAAC,eAAe,EAAE,CAAC;QACtB,MAAM,IAAI,kBAAS,CAAC;YACnB,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,8BAA8B;SACvC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC","sourcesContent":["import { TRPCError } from '@trpc/server';\nimport bcrypt from 'bcryptjs';\n\nexport async function hashPassword(password: string): Promise<string> {\n\tconst salt = await bcrypt.genSalt(10);\n\treturn bcrypt.hash(password, salt);\n}\n\nexport async function verifyPassword(inputPassword: string, hashedPassword: string) {\n\tconst isPasswordValid = await bcrypt.compare(inputPassword, hashedPassword);\n\tif (!isPasswordValid) {\n\t\tthrow new TRPCError({\n\t\t\tcode: 'UNAUTHORIZED',\n\t\t\tmessage: 'Incorrect email or password.',\n\t\t});\n\t}\n}\n"]}
1
+ {"version":3,"file":"password.js","sourceRoot":"/","sources":["utilities/password.ts"],"names":[],"mappings":";;;;;AAIA,oCAGC;AAED,wCAKC;AAbD,wDAA8B;AAC9B,iDAAiD;AAE1C,KAAK,UAAU,YAAY,CAAC,QAAgB;IAClD,MAAM,IAAI,GAAG,MAAM,kBAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACtC,OAAO,kBAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC;AAEM,KAAK,UAAU,cAAc,CAAC,aAAqB,EAAE,cAAsB;IACjF,MAAM,eAAe,GAAG,MAAM,kBAAM,CAAC,OAAO,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IAC5E,IAAI,CAAC,eAAe,EAAE,CAAC;QACtB,IAAA,8BAAe,EAAC,6BAA6B,CAAC,CAAC;IAChD,CAAC;AACF,CAAC","sourcesContent":["import { TRPCError } from '@trpc/server';\nimport bcrypt from 'bcryptjs';\nimport { badRequestError } from './error-common';\n\nexport async function hashPassword(password: string): Promise<string> {\n\tconst salt = await bcrypt.genSalt(10);\n\treturn bcrypt.hash(password, salt);\n}\n\nexport async function verifyPassword(inputPassword: string, hashedPassword: string) {\n\tconst isPasswordValid = await bcrypt.compare(inputPassword, hashedPassword);\n\tif (!isPasswordValid) {\n\t\tbadRequestError('Incorrect email or password');\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.3.173",
3
+ "version": "1.3.175",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",