@lyxa.ai/core 1.1.70 → 1.1.72

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.
Files changed (26) hide show
  1. package/dist/libraries/mongo/models/base/base-coupon.model.d.ts +4 -0
  2. package/dist/libraries/mongo/models/base/base-coupon.model.js +20 -0
  3. package/dist/libraries/mongo/models/base/base-coupon.model.js.map +1 -1
  4. package/dist/libraries/mongo/models/coupon.model.d.ts +1 -0
  5. package/dist/libraries/mongo/models/coupon.model.js +5 -0
  6. package/dist/libraries/mongo/models/coupon.model.js.map +1 -1
  7. package/dist/libraries/mongo/models/providers/buy1-get1-marketing.model.d.ts +1 -0
  8. package/dist/libraries/mongo/models/providers/buy1-get1-marketing.model.js +5 -0
  9. package/dist/libraries/mongo/models/providers/buy1-get1-marketing.model.js.map +1 -1
  10. package/dist/libraries/mongo/models/providers/discount-marketing.model.d.ts +2 -0
  11. package/dist/libraries/mongo/models/providers/discount-marketing.model.js +10 -0
  12. package/dist/libraries/mongo/models/providers/discount-marketing.model.js.map +1 -1
  13. package/dist/libraries/mongo/models/providers/free-delivery-marketing.model.d.ts +1 -0
  14. package/dist/libraries/mongo/models/providers/free-delivery-marketing.model.js +5 -0
  15. package/dist/libraries/mongo/models/providers/free-delivery-marketing.model.js.map +1 -1
  16. package/dist/libraries/mongo/models/user.model.d.ts +1 -1
  17. package/dist/types/README.md +1 -1
  18. package/dist/types/package.json +1 -1
  19. package/dist/types/utilities/validation/common-validation.d.ts +2 -78
  20. package/dist/types/utilities/validation/global-validation.d.ts +14 -38
  21. package/dist/utilities/time.d.ts +4 -0
  22. package/dist/utilities/time.js +76 -0
  23. package/dist/utilities/time.js.map +1 -1
  24. package/dist/utilities/validation/common-validation.d.ts +2 -78
  25. package/dist/utilities/validation/global-validation.d.ts +14 -38
  26. package/package.json +1 -1
@@ -5,10 +5,14 @@ export declare class BaseCoupon extends Coupon {
5
5
  valueType: ValueType;
6
6
  value: number;
7
7
  maxDiscountLimit?: number | null;
8
+ isMaxDiscountLimitEnabled?: boolean;
8
9
  duration: Duration;
9
10
  spendLimit?: number | null;
11
+ isSpendLimitEnabled?: boolean;
10
12
  totalOrderLimit?: number | null;
13
+ isTotalOrderLimitEnabled?: boolean;
11
14
  minOrderValue?: number | null;
15
+ isMinOrderValueEnabled?: boolean;
12
16
  forNewUserOnly?: boolean;
13
17
  status?: Status;
14
18
  expirationReason?: CouponExpirationReason;
@@ -18,10 +18,14 @@ class BaseCoupon extends coupon_model_1.Coupon {
18
18
  valueType;
19
19
  value;
20
20
  maxDiscountLimit;
21
+ isMaxDiscountLimitEnabled;
21
22
  duration;
22
23
  spendLimit;
24
+ isSpendLimitEnabled;
23
25
  totalOrderLimit;
26
+ isTotalOrderLimitEnabled;
24
27
  minOrderValue;
28
+ isMinOrderValueEnabled;
25
29
  forNewUserOnly;
26
30
  status;
27
31
  expirationReason;
@@ -39,6 +43,10 @@ __decorate([
39
43
  (0, typegoose_1.prop)({ type: Number, default: null }),
40
44
  __metadata("design:type", Object)
41
45
  ], BaseCoupon.prototype, "maxDiscountLimit", void 0);
46
+ __decorate([
47
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
48
+ __metadata("design:type", Boolean)
49
+ ], BaseCoupon.prototype, "isMaxDiscountLimitEnabled", void 0);
42
50
  __decorate([
43
51
  (0, typegoose_1.prop)({ required: true, type: duration_model_1.Duration }),
44
52
  __metadata("design:type", duration_model_1.Duration)
@@ -47,14 +55,26 @@ __decorate([
47
55
  (0, typegoose_1.prop)({ type: Number, default: null }),
48
56
  __metadata("design:type", Object)
49
57
  ], BaseCoupon.prototype, "spendLimit", void 0);
58
+ __decorate([
59
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
60
+ __metadata("design:type", Boolean)
61
+ ], BaseCoupon.prototype, "isSpendLimitEnabled", void 0);
50
62
  __decorate([
51
63
  (0, typegoose_1.prop)({ type: Number, default: null }),
52
64
  __metadata("design:type", Object)
53
65
  ], BaseCoupon.prototype, "totalOrderLimit", void 0);
66
+ __decorate([
67
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
68
+ __metadata("design:type", Boolean)
69
+ ], BaseCoupon.prototype, "isTotalOrderLimitEnabled", void 0);
54
70
  __decorate([
55
71
  (0, typegoose_1.prop)({ type: Number, default: null }),
56
72
  __metadata("design:type", Object)
57
73
  ], BaseCoupon.prototype, "minOrderValue", void 0);
74
+ __decorate([
75
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
76
+ __metadata("design:type", Boolean)
77
+ ], BaseCoupon.prototype, "isMinOrderValueEnabled", void 0);
58
78
  __decorate([
59
79
  (0, typegoose_1.prop)({ type: Boolean, default: false }),
60
80
  __metadata("design:type", Boolean)
@@ -1 +1 @@
1
- {"version":3,"file":"base-coupon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/base/base-coupon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,qDAAuF;AACvF,6DAAoD;AACpD,kDAAyC;AAEzC,MAAa,UAAW,SAAQ,qBAAM;IAE9B,SAAS,CAAa;IAGtB,KAAK,CAAU;IAGf,gBAAgB,CAAiB;IAGjC,QAAQ,CAAY;IAGpB,UAAU,CAAiB;IAG3B,eAAe,CAAiB;IAGhC,aAAa,CAAiB;IAG9B,cAAc,CAAW;IAGzB,MAAM,CAAU;IAGhB,gBAAgB,CAA0B;CACjD;AA9BD,gCA8BC;AA5BO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,CAAC;;6CAC3B;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;oDACE;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,yBAAQ,EAAE,CAAC;8BACvB,yBAAQ;4CAAC;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;8CACJ;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;mDACC;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACD;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;kDACR;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;0CACtC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,6BAAsB,EAAE,CAAC;;oDACJ","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { CouponExpirationReason, Status, ValueType } from '../../../../utilities/enum';\nimport { Duration } from '../shared/duration.model';\nimport { Coupon } from '../coupon.model';\n\nexport class BaseCoupon extends Coupon {\n\t@prop({ required: true, type: String, enum: ValueType })\n\tpublic valueType!: ValueType;\n\n\t@prop({ required: true, type: Number })\n\tpublic value!: number;\n\n\t@prop({ type: Number, default: null }) // applicable when valueType percentage\n\tpublic maxDiscountLimit?: number | null;\n\n\t@prop({ required: true, type: Duration })\n\tpublic duration!: Duration;\n\n\t@prop({ type: Number, default: null })\n\tpublic spendLimit?: number | null;\n\n\t@prop({ type: Number, default: null })\n\tpublic totalOrderLimit?: number | null;\n\n\t@prop({ type: Number, default: null })\n\tpublic minOrderValue?: number | null;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic forNewUserOnly?: boolean;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: String, enum: CouponExpirationReason })\n\tpublic expirationReason?: CouponExpirationReason;\n}\n"]}
1
+ {"version":3,"file":"base-coupon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/base/base-coupon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,qDAAuF;AACvF,6DAAoD;AACpD,kDAAyC;AAEzC,MAAa,UAAW,SAAQ,qBAAM;IAE9B,SAAS,CAAa;IAGtB,KAAK,CAAU;IAGf,gBAAgB,CAAiB;IAGjC,yBAAyB,CAAW;IAGpC,QAAQ,CAAY;IAGpB,UAAU,CAAiB;IAG3B,mBAAmB,CAAW;IAG9B,eAAe,CAAiB;IAGhC,wBAAwB,CAAW;IAGnC,aAAa,CAAiB;IAG9B,sBAAsB,CAAW;IAGjC,cAAc,CAAW;IAGzB,MAAM,CAAU;IAGhB,gBAAgB,CAA0B;CACjD;AA1CD,gCA0CC;AAxCO;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,CAAC;;6CAC3B;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;oDACE;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;6DACG;AAGpC;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,yBAAQ,EAAE,CAAC;8BACvB,yBAAQ;4CAAC;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;8CACJ;AAG3B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;uDACH;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;mDACC;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;4DACE;AAGnC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACD;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;0DACA;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;kDACR;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;0CACtC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,6BAAsB,EAAE,CAAC;;oDACJ","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { CouponExpirationReason, Status, ValueType } from '../../../../utilities/enum';\nimport { Duration } from '../shared/duration.model';\nimport { Coupon } from '../coupon.model';\n\nexport class BaseCoupon extends Coupon {\n\t@prop({ required: true, type: String, enum: ValueType })\n\tpublic valueType!: ValueType;\n\n\t@prop({ required: true, type: Number })\n\tpublic value!: number;\n\n\t@prop({ type: Number, default: null }) // applicable when valueType percentage\n\tpublic maxDiscountLimit?: number | null;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isMaxDiscountLimitEnabled?: boolean;\n\n\t@prop({ required: true, type: Duration })\n\tpublic duration!: Duration;\n\n\t@prop({ type: Number, default: null })\n\tpublic spendLimit?: number | null;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isSpendLimitEnabled?: boolean;\n\n\t@prop({ type: Number, default: null })\n\tpublic totalOrderLimit?: number | null;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isTotalOrderLimitEnabled?: boolean;\n\n\t@prop({ type: Number, default: null })\n\tpublic minOrderValue?: number | null;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isMinOrderValueEnabled?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic forNewUserOnly?: boolean;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ type: String, enum: CouponExpirationReason })\n\tpublic expirationReason?: CouponExpirationReason;\n}\n"]}
@@ -6,6 +6,7 @@ export declare class Coupon extends TimeStamps {
6
6
  code: string;
7
7
  couponType: CouponType;
8
8
  orderLimitPerUser?: number | null;
9
+ isOrderLimitPerUserEnabled?: boolean;
9
10
  previousVersions?: Ref<Coupon>[];
10
11
  updatedVersion?: Ref<Coupon>;
11
12
  createdBy?: Ref<Admin>;
@@ -18,6 +18,7 @@ let Coupon = class Coupon extends defaultClasses_1.TimeStamps {
18
18
  code;
19
19
  couponType;
20
20
  orderLimitPerUser;
21
+ isOrderLimitPerUserEnabled;
21
22
  previousVersions;
22
23
  updatedVersion;
23
24
  createdBy;
@@ -35,6 +36,10 @@ __decorate([
35
36
  (0, typegoose_1.prop)({ type: Number, default: null }),
36
37
  __metadata("design:type", Object)
37
38
  ], Coupon.prototype, "orderLimitPerUser", void 0);
39
+ __decorate([
40
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
41
+ __metadata("design:type", Boolean)
42
+ ], Coupon.prototype, "isOrderLimitPerUserEnabled", void 0);
38
43
  __decorate([
39
44
  (0, typegoose_1.prop)({ ref: () => Coupon }),
40
45
  __metadata("design:type", Array)
@@ -1 +1 @@
1
- {"version":3,"file":"coupon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/coupon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,kDAAqD;AACrD,+CAAsC;AAK/B,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,2BAAU;IAE9B,IAAI,CAAU;IAGd,UAAU,CAAc;IAGxB,iBAAiB,CAAiB;IAGlC,gBAAgB,CAAiB;IAGjC,cAAc,CAAe;IAG7B,SAAS,CAAc;CAE9B,CAAA;AAnBY,wBAAM;AAEX;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oCAC/C;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAU,EAAE,CAAC;;0CAC1B;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACG;AAGlC;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;;gDACY;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;;8CACQ;AAG7B;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;yCACG;iBAjBlB,MAAM;IAHlB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE;KACxE,CAAC;GACW,MAAM,CAmBlB","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CouponType } from '../../../utilities/enum';\nimport { Admin } from './admin.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'coupons', discriminatorKey: 'couponType' },\n})\nexport class Coupon extends TimeStamps {\n\t@prop({ required: true, uppercase: true, trim: true, type: String })\n\tpublic code!: string;\n\n\t@prop({ required: true, type: String, enum: CouponType })\n\tpublic couponType!: CouponType;\n\n\t@prop({ type: Number, default: null })\n\tpublic orderLimitPerUser?: number | null;\n\n\t@prop({ ref: () => Coupon })\n\tpublic previousVersions?: Ref<Coupon>[];\n\n\t@prop({ ref: () => Coupon })\n\tpublic updatedVersion?: Ref<Coupon>;\n\n\t@prop({ ref: () => Admin })\n\tpublic createdBy?: Ref<Admin>;\n\t\n}\n"]}
1
+ {"version":3,"file":"coupon.model.js","sourceRoot":"/","sources":["libraries/mongo/models/coupon.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA+D;AAC/D,4EAAqE;AACrE,kDAAqD;AACrD,+CAAsC;AAK/B,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,2BAAU;IAE9B,IAAI,CAAU;IAGd,UAAU,CAAc;IAGxB,iBAAiB,CAAiB;IAGlC,0BAA0B,CAAW;IAGrC,gBAAgB,CAAiB;IAGjC,cAAc,CAAe;IAG7B,SAAS,CAAc;CAE9B,CAAA;AAtBY,wBAAM;AAEX;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oCAC/C;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAU,EAAE,CAAC;;0CAC1B;AAGxB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDACG;AAGlC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;0DACI;AAGrC;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;;gDACY;AAGjC;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;;8CACQ;AAG7B;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,mBAAK,EAAE,CAAC;;yCACG;iBApBlB,MAAM;IAHlB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE;KACxE,CAAC;GACW,MAAM,CAsBlB","sourcesContent":["import { modelOptions, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CouponType } from '../../../utilities/enum';\nimport { Admin } from './admin.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'coupons', discriminatorKey: 'couponType' },\n})\nexport class Coupon extends TimeStamps {\n\t@prop({ required: true, uppercase: true, trim: true, type: String })\n\tpublic code!: string;\n\n\t@prop({ required: true, type: String, enum: CouponType })\n\tpublic couponType!: CouponType;\n\n\t@prop({ type: Number, default: null })\n\tpublic orderLimitPerUser?: number | null;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isOrderLimitPerUserEnabled?: boolean;\n\n\t@prop({ ref: () => Coupon })\n\tpublic previousVersions?: Ref<Coupon>[];\n\n\t@prop({ ref: () => Coupon })\n\tpublic updatedVersion?: Ref<Coupon>;\n\n\t@prop({ ref: () => Admin })\n\tpublic createdBy?: Ref<Admin>;\n\t\n}\n"]}
@@ -8,6 +8,7 @@ export declare class Buy1Get1Marketing extends Marketing {
8
8
  isEntireMenu?: boolean;
9
9
  products: Ref<ProductMarketing>;
10
10
  spendLimit?: number;
11
+ isSpendLimitEnabled?: boolean;
11
12
  isOnlyForSubscriber?: boolean;
12
13
  categories: Ref<ShopCategory>[];
13
14
  }
@@ -20,6 +20,7 @@ class Buy1Get1Marketing extends marketing_model_1.Marketing {
20
20
  isEntireMenu;
21
21
  products;
22
22
  spendLimit;
23
+ isSpendLimitEnabled;
23
24
  isOnlyForSubscriber;
24
25
  categories;
25
26
  }
@@ -40,6 +41,10 @@ __decorate([
40
41
  (0, typegoose_1.prop)({ type: Number, default: 0 }),
41
42
  __metadata("design:type", Number)
42
43
  ], Buy1Get1Marketing.prototype, "spendLimit", void 0);
44
+ __decorate([
45
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
46
+ __metadata("design:type", Boolean)
47
+ ], Buy1Get1Marketing.prototype, "isSpendLimitEnabled", void 0);
43
48
  __decorate([
44
49
  (0, typegoose_1.prop)({ type: Boolean, default: false }),
45
50
  __metadata("design:type", Boolean)
@@ -1 +1 @@
1
- {"version":3,"file":"buy1-get1-marketing.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/buy1-get1-marketing.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAA2D;AAC3D,wDAA+C;AAC/C,wEAA8D;AAC9D,gEAAsD;AAEtD,MAAa,iBAAkB,SAAQ,2BAAS;IACxC,aAAa,GAAG,oBAAa,CAAC,QAAiB,CAAC;IAGhD,YAAY,CAAW;IAOvB,QAAQ,CAAwB;IAGhC,UAAU,CAAU;IAGpB,mBAAmB,CAAW;IAG9B,UAAU,CAAsB;CACvC;AArBD,8CAqBC;AAjBO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;uDACV;AAOvB;IALN,IAAA,gBAAI,EAAC;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,0CAAgB;QAC3B,YAAY,EAAE,WAAW;QACzB,UAAU,EAAE,KAAK;KACjB,CAAC;;mDACqC;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;qDACR;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;8DACH;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;;qDACK","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { MarketingType } from '../../../../utilities/enum';\nimport { Marketing } from '../marketing.model';\nimport { ProductMarketing } from '../product-marketing.model';\nimport { ShopCategory } from '../shop-category.model';\n\nexport class Buy1Get1Marketing extends Marketing {\n\tpublic marketingType = MarketingType.BUY1GET1 as const;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isEntireMenu?: boolean;\n\n\t@prop({\n\t\tref: () => ProductMarketing,\n\t\tforeignField: 'marketing',\n\t\tlocalField: '_id',\n\t})\n\tpublic products: Ref<ProductMarketing>;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic spendLimit?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isOnlyForSubscriber?: boolean;\n\n\t@prop({ ref: () => ShopCategory })\n\tpublic categories: Ref<ShopCategory>[];\n}\n"]}
1
+ {"version":3,"file":"buy1-get1-marketing.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/buy1-get1-marketing.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAA2D;AAC3D,wDAA+C;AAC/C,wEAA8D;AAC9D,gEAAsD;AAEtD,MAAa,iBAAkB,SAAQ,2BAAS;IACxC,aAAa,GAAG,oBAAa,CAAC,QAAiB,CAAC;IAGhD,YAAY,CAAW;IAOvB,QAAQ,CAAwB;IAGhC,UAAU,CAAU;IAGpB,mBAAmB,CAAW;IAG9B,mBAAmB,CAAW;IAG9B,UAAU,CAAsB;CACvC;AAxBD,8CAwBC;AApBO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;uDACV;AAOvB;IALN,IAAA,gBAAI,EAAC;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,0CAAgB;QAC3B,YAAY,EAAE,WAAW;QACzB,UAAU,EAAE,KAAK;KACjB,CAAC;;mDACqC;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;qDACR;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;8DACH;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;8DACH;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;;qDACK","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { MarketingType } from '../../../../utilities/enum';\nimport { Marketing } from '../marketing.model';\nimport { ProductMarketing } from '../product-marketing.model';\nimport { ShopCategory } from '../shop-category.model';\n\nexport class Buy1Get1Marketing extends Marketing {\n\tpublic marketingType = MarketingType.BUY1GET1 as const;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isEntireMenu?: boolean;\n\n\t@prop({\n\t\tref: () => ProductMarketing,\n\t\tforeignField: 'marketing',\n\t\tlocalField: '_id',\n\t})\n\tpublic products: Ref<ProductMarketing>;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic spendLimit?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isSpendLimitEnabled?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isOnlyForSubscriber?: boolean;\n\n\t@prop({ ref: () => ShopCategory })\n\tpublic categories: Ref<ShopCategory>[];\n}\n"]}
@@ -10,7 +10,9 @@ export declare class DiscountMarketing extends Marketing {
10
10
  value?: number;
11
11
  products: Ref<ProductMarketing>;
12
12
  maxDiscountPerOrder?: number;
13
+ isMaxDiscountPerOrderEnabled?: boolean;
13
14
  spendLimit?: number;
15
+ isSpendLimitEnabled?: boolean;
14
16
  isOnlyForSubscriber?: boolean;
15
17
  categoryValue?: number;
16
18
  categoryValueType?: ValueType;
@@ -22,7 +22,9 @@ class DiscountMarketing extends marketing_model_1.Marketing {
22
22
  value;
23
23
  products;
24
24
  maxDiscountPerOrder;
25
+ isMaxDiscountPerOrderEnabled;
25
26
  spendLimit;
27
+ isSpendLimitEnabled;
26
28
  isOnlyForSubscriber;
27
29
  categoryValue;
28
30
  categoryValueType;
@@ -53,10 +55,18 @@ __decorate([
53
55
  (0, typegoose_1.prop)({ type: Number, default: 0 }),
54
56
  __metadata("design:type", Number)
55
57
  ], DiscountMarketing.prototype, "maxDiscountPerOrder", void 0);
58
+ __decorate([
59
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
60
+ __metadata("design:type", Boolean)
61
+ ], DiscountMarketing.prototype, "isMaxDiscountPerOrderEnabled", void 0);
56
62
  __decorate([
57
63
  (0, typegoose_1.prop)({ type: Number, default: 0 }),
58
64
  __metadata("design:type", Number)
59
65
  ], DiscountMarketing.prototype, "spendLimit", void 0);
66
+ __decorate([
67
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
68
+ __metadata("design:type", Boolean)
69
+ ], DiscountMarketing.prototype, "isSpendLimitEnabled", void 0);
60
70
  __decorate([
61
71
  (0, typegoose_1.prop)({ type: Boolean, default: false }),
62
72
  __metadata("design:type", Boolean)
@@ -1 +1 @@
1
- {"version":3,"file":"discount-marketing.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/discount-marketing.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAsE;AACtE,wDAA+C;AAC/C,wEAA8D;AAC9D,g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,UAAU,EAAE,CAAC;;4DAClC;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;;qDACK","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { MarketingType, ValueType } from '../../../../utilities/enum';\nimport { Marketing } from '../marketing.model';\nimport { ProductMarketing } from '../product-marketing.model';\nimport { ShopCategory } from '../shop-category.model';\n\nexport class DiscountMarketing extends Marketing {\n\tpublic marketingType = MarketingType.DISCOUNT as const;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isEntireMenu?: boolean;\n\n\t@prop({ type: String, enum: ValueType })\n\tpublic valueType?: ValueType;\n\n\t@prop({ type: Number })\n\tpublic value?: number;\n\n\t@prop({\n\t\tref: () => ProductMarketing,\n\t\tforeignField: 'marketing',\n\t\tlocalField: '_id',\n\t})\n\tpublic products: Ref<ProductMarketing>;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic maxDiscountPerOrder?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic spendLimit?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isOnlyForSubscriber?: boolean;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic categoryValue?: number;\n\n\t@prop({ type: String, enum: ValueType, default: ValueType.PERCENTAGE })\n\tpublic categoryValueType?: ValueType;\n\n\t@prop({ ref: () => ShopCategory })\n\tpublic categories: Ref<ShopCategory>[];\n}"]}
1
+ {"version":3,"file":"discount-marketing.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/discount-marketing.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAsE;AACtE,wDAA+C;AAC/C,wEAA8D;AAC9D,gEAAsD;AAEtD,MAAa,iBAAkB,SAAQ,2BAAS;IACxC,aAAa,GAAG,oBAAa,CAAC,QAAiB,CAAC;IAGhD,YAAY,CAAW;IAGvB,SAAS,CAAa;IAGtB,KAAK,CAAU;IAOf,QAAQ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AAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,OAAO,EAAE,gBAAS,CAAC,UAAU,EAAE,CAAC;;4DAClC;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,kCAAY,EAAE,CAAC;;qDACK","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { MarketingType, ValueType } from '../../../../utilities/enum';\nimport { Marketing } from '../marketing.model';\nimport { ProductMarketing } from '../product-marketing.model';\nimport { ShopCategory } from '../shop-category.model';\n\nexport class DiscountMarketing extends Marketing {\n\tpublic marketingType = MarketingType.DISCOUNT as const;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isEntireMenu?: boolean;\n\n\t@prop({ type: String, enum: ValueType })\n\tpublic valueType?: ValueType;\n\n\t@prop({ type: Number })\n\tpublic value?: number;\n\n\t@prop({\n\t\tref: () => ProductMarketing,\n\t\tforeignField: 'marketing',\n\t\tlocalField: '_id',\n\t})\n\tpublic products: Ref<ProductMarketing>;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic maxDiscountPerOrder?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isMaxDiscountPerOrderEnabled?: boolean;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic spendLimit?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isSpendLimitEnabled?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isOnlyForSubscriber?: boolean;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic categoryValue?: number;\n\n\t@prop({ type: String, enum: ValueType, default: ValueType.PERCENTAGE })\n\tpublic categoryValueType?: ValueType;\n\n\t@prop({ ref: () => ShopCategory })\n\tpublic categories: Ref<ShopCategory>[];\n}"]}
@@ -3,4 +3,5 @@ import { Marketing } from '../marketing.model';
3
3
  export declare class FreeDeliveryMarketing extends Marketing {
4
4
  marketingType: MarketingType.FREE_DELIVERY;
5
5
  spendLimit?: number;
6
+ isSpendLimitEnabled?: boolean;
6
7
  }
@@ -16,10 +16,15 @@ const marketing_model_1 = require("../marketing.model");
16
16
  class FreeDeliveryMarketing extends marketing_model_1.Marketing {
17
17
  marketingType = enum_1.MarketingType.FREE_DELIVERY;
18
18
  spendLimit;
19
+ isSpendLimitEnabled;
19
20
  }
20
21
  exports.FreeDeliveryMarketing = FreeDeliveryMarketing;
21
22
  __decorate([
22
23
  (0, typegoose_1.prop)({ type: Number, default: 0 }),
23
24
  __metadata("design:type", Number)
24
25
  ], FreeDeliveryMarketing.prototype, "spendLimit", void 0);
26
+ __decorate([
27
+ (0, typegoose_1.prop)({ type: Boolean, default: false }),
28
+ __metadata("design:type", Boolean)
29
+ ], FreeDeliveryMarketing.prototype, "isSpendLimitEnabled", void 0);
25
30
  //# sourceMappingURL=free-delivery-marketing.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"free-delivery-marketing.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/free-delivery-marketing.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,qDAA2D;AAC3D,wDAA+C;AAE/C,MAAa,qBAAsB,SAAQ,2BAAS;IAC5C,aAAa,GAAG,oBAAa,CAAC,aAAsB,CAAC;IAGrD,UAAU,CAAU;CAC3B;AALD,sDAKC;AADO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;yDACR","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { MarketingType } from '../../../../utilities/enum';\nimport { Marketing } from '../marketing.model';\n\nexport class FreeDeliveryMarketing extends Marketing {\n\tpublic marketingType = MarketingType.FREE_DELIVERY as const;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic spendLimit?: number;\n}\n"]}
1
+ {"version":3,"file":"free-delivery-marketing.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/free-delivery-marketing.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,qDAA2D;AAC3D,wDAA+C;AAE/C,MAAa,qBAAsB,SAAQ,2BAAS;IAC5C,aAAa,GAAG,oBAAa,CAAC,aAAsB,CAAC;IAGrD,UAAU,CAAU;IAGpB,mBAAmB,CAAW;CACrC;AARD,sDAQC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;yDACR;AAGpB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;kEACH","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { MarketingType } from '../../../../utilities/enum';\nimport { Marketing } from '../marketing.model';\n\nexport class FreeDeliveryMarketing extends Marketing {\n\tpublic marketingType = MarketingType.FREE_DELIVERY as const;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic spendLimit?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isSpendLimitEnabled?: boolean;\n}\n"]}
@@ -32,7 +32,7 @@ export declare class User extends TimeStamps {
32
32
  isPhoneVerified?: boolean;
33
33
  onlineStatus?: OnlineStatus;
34
34
  fcmTokens?: string[];
35
- static updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject> & Omit<User & {
35
+ static updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject, {}> & Omit<User & {
36
36
  _id: import("mongoose").Types.ObjectId;
37
37
  } & {
38
38
  __v: number;
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.1.70
25
+ Version: 1.1.72
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.1.70",
3
+ "version": "1.1.72",
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",
@@ -646,7 +646,7 @@ export declare const createResponseSchema: <T>(schema: z.ZodSchema<T>) => z.ZodO
646
646
  totalPages: number;
647
647
  } | undefined;
648
648
  }>, z.ZodType<T, z.ZodTypeDef, T>]>>;
649
- }>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
649
+ }>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
650
650
  success: z.ZodBoolean;
651
651
  message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
652
652
  data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
@@ -684,83 +684,7 @@ export declare const createResponseSchema: <T>(schema: z.ZodSchema<T>) => z.ZodO
684
684
  totalPages: number;
685
685
  } | undefined;
686
686
  }>, z.ZodType<T, z.ZodTypeDef, T>]>>;
687
- }>, any>[k]; } : never, z.baseObjectInputType<{
688
- success: z.ZodBoolean;
689
- message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
690
- data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
691
- metadata: z.ZodOptional<z.ZodObject<{
692
- page: z.ZodNumber;
693
- size: z.ZodNumber;
694
- totalElements: z.ZodNumber;
695
- totalPages: z.ZodNumber;
696
- }, "strip", z.ZodTypeAny, {
697
- size: number;
698
- page: number;
699
- totalElements: number;
700
- totalPages: number;
701
- }, {
702
- size: number;
703
- page: number;
704
- totalElements: number;
705
- totalPages: number;
706
- }>>;
707
- documents: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
708
- }, "strip", z.ZodTypeAny, {
709
- documents: T[];
710
- metadata?: {
711
- size: number;
712
- page: number;
713
- totalElements: number;
714
- totalPages: number;
715
- } | undefined;
716
- }, {
717
- documents: T[];
718
- metadata?: {
719
- size: number;
720
- page: number;
721
- totalElements: number;
722
- totalPages: number;
723
- } | undefined;
724
- }>, z.ZodType<T, z.ZodTypeDef, T>]>>;
725
- }> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
726
- success: z.ZodBoolean;
727
- message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
728
- data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
729
- metadata: z.ZodOptional<z.ZodObject<{
730
- page: z.ZodNumber;
731
- size: z.ZodNumber;
732
- totalElements: z.ZodNumber;
733
- totalPages: z.ZodNumber;
734
- }, "strip", z.ZodTypeAny, {
735
- size: number;
736
- page: number;
737
- totalElements: number;
738
- totalPages: number;
739
- }, {
740
- size: number;
741
- page: number;
742
- totalElements: number;
743
- totalPages: number;
744
- }>>;
745
- documents: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
746
- }, "strip", z.ZodTypeAny, {
747
- documents: T[];
748
- metadata?: {
749
- size: number;
750
- page: number;
751
- totalElements: number;
752
- totalPages: number;
753
- } | undefined;
754
- }, {
755
- documents: T[];
756
- metadata?: {
757
- size: number;
758
- page: number;
759
- totalElements: number;
760
- totalPages: number;
761
- } | undefined;
762
- }>, z.ZodType<T, z.ZodTypeDef, T>]>>;
763
- }>[k_1]; } : never>;
687
+ }> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
764
688
  export type PaginatedDTO<T> = {
765
689
  metadata: DTO<typeof metadataSchema>;
766
690
  documents: T[];
@@ -76,34 +76,22 @@ export declare class SchemaBuilder<T extends z.ZodRawShape> {
76
76
  private baseSchema;
77
77
  constructor(baseFields: T, includeTimestamps?: boolean, includeTracking?: boolean);
78
78
  private createBaseSchema;
79
- getBaseSchema(): z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any>[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<T>[k_1]; } : never>;
79
+ getBaseSchema(): z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
80
80
  getEntitySchema(): z.ZodObject<z.objectUtil.extendShape<T, {
81
81
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
82
- }> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<z.objectUtil.extendShape<T, {
82
+ }> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<T_1[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
83
83
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
84
- }>[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
84
+ }> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<T_2[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
85
85
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
86
- }> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<z.objectUtil.extendShape<T, {
87
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
88
- }>[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
89
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
90
- }> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
91
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
92
- }>[k]>; } : never, z.ZodTypeAny, "passthrough">>;
86
+ }> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<T_3[k]>; } : never, z.ZodTypeAny, "passthrough">>;
93
87
  getIdSchema(): z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
94
88
  getUpdateSchema(excludeFields?: ExcludeFromUpdate): z.ZodObject<z.objectUtil.extendShape<T, {
95
89
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
96
- }> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<z.objectUtil.extendShape<T, {
97
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
98
- }>[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
99
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
100
- }> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<z.objectUtil.extendShape<T, {
101
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
102
- }>[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
90
+ }> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<T_1[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
103
91
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
104
- }> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
92
+ }> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<T_2[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
105
93
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
106
- }>[k]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
94
+ }> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<T_3[k]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
107
95
  [x: string]: z.ZodOptional<z.ZodTypeAny>;
108
96
  }, "strict", z.ZodTypeAny, {
109
97
  [x: string]: any;
@@ -126,34 +114,22 @@ export declare class SchemaBuilder<T extends z.ZodRawShape> {
126
114
  [x: string]: any;
127
115
  }>;
128
116
  getAllSchemas(excludeFromUpdate?: ExcludeFromUpdate): {
129
- BaseSchema: z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any>[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<T>[k_1]; } : never>;
117
+ BaseSchema: z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
130
118
  EntitySchema: z.ZodObject<z.objectUtil.extendShape<T, {
131
119
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
132
- }> extends infer T_3 extends z.ZodRawShape ? { [k_2 in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
120
+ }> extends infer T_3 extends z.ZodRawShape ? { [k_2 in keyof T_3]: z.ZodOptional<T_3[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
133
121
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
134
- }>[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
122
+ }> extends infer T_4 extends z.ZodRawShape ? { [k_2 in keyof T_4]: z.ZodOptional<T_4[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
135
123
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
136
- }> extends infer T_4 extends z.ZodRawShape ? { [k_2 in keyof T_4]: z.ZodOptional<z.objectUtil.extendShape<T, {
137
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
138
- }>[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
139
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
140
- }> extends infer T_5 extends z.ZodRawShape ? { [k_2 in keyof T_5]: z.ZodOptional<z.objectUtil.extendShape<T, {
141
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
142
- }>[k_2]>; } : never, z.ZodTypeAny, "passthrough">>;
124
+ }> extends infer T_5 extends z.ZodRawShape ? { [k_2 in keyof T_5]: z.ZodOptional<T_5[k_2]>; } : never, z.ZodTypeAny, "passthrough">>;
143
125
  IdSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
144
126
  UpdateSchema: z.ZodObject<z.objectUtil.extendShape<T, {
145
127
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
146
- }> extends infer T_6 extends z.ZodRawShape ? { [k_2 in keyof T_6]: z.ZodOptional<z.objectUtil.extendShape<T, {
147
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
148
- }>[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
149
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
150
- }> extends infer T_7 extends z.ZodRawShape ? { [k_2 in keyof T_7]: z.ZodOptional<z.objectUtil.extendShape<T, {
151
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
152
- }>[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
128
+ }> extends infer T_6 extends z.ZodRawShape ? { [k_2 in keyof T_6]: z.ZodOptional<T_6[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
153
129
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
154
- }> extends infer T_8 extends z.ZodRawShape ? { [k_2 in keyof T_8]: z.ZodOptional<z.objectUtil.extendShape<T, {
130
+ }> extends infer T_7 extends z.ZodRawShape ? { [k_2 in keyof T_7]: z.ZodOptional<T_7[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
155
131
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
156
- }>[k_2]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
132
+ }> extends infer T_8 extends z.ZodRawShape ? { [k_2 in keyof T_8]: z.ZodOptional<T_8[k_2]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
157
133
  [x: string]: z.ZodOptional<z.ZodTypeAny>;
158
134
  }, "strict", z.ZodTypeAny, {
159
135
  [x: string]: any;
@@ -1,3 +1,7 @@
1
1
  export declare const LyxaTimezone = "Asia/Dhaka";
2
2
  export declare const convertTimeToUTC: (timeStr: string, zone?: string) => string;
3
3
  export declare const convertTimeFromUTC: (utcTimeStr: string, zone?: string) => string;
4
+ export declare function normalizeWorkingHourTimeFormat(data: any): any;
5
+ export declare function deNormalizeWorkingHourTimeFormat(data: any): any;
6
+ export declare function parseTime(time: string): number;
7
+ export declare function formatTimeString(time: string): string;
@@ -4,9 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.convertTimeFromUTC = exports.convertTimeToUTC = exports.LyxaTimezone = void 0;
7
+ exports.normalizeWorkingHourTimeFormat = normalizeWorkingHourTimeFormat;
8
+ exports.deNormalizeWorkingHourTimeFormat = deNormalizeWorkingHourTimeFormat;
9
+ exports.parseTime = parseTime;
10
+ exports.formatTimeString = formatTimeString;
7
11
  const dayjs_1 = __importDefault(require("dayjs"));
8
12
  const utc_1 = __importDefault(require("dayjs/plugin/utc"));
9
13
  const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
14
+ const error_common_1 = require("./error-common");
10
15
  dayjs_1.default.extend(utc_1.default);
11
16
  dayjs_1.default.extend(timezone_1.default);
12
17
  exports.LyxaTimezone = 'Asia/Dhaka';
@@ -36,4 +41,75 @@ const convertTimeFromUTC = (utcTimeStr, zone = 'Asia/Beirut') => {
36
41
  .format('HHmm');
37
42
  };
38
43
  exports.convertTimeFromUTC = convertTimeFromUTC;
44
+ function normalizeWorkingHourTimeFormat(data) {
45
+ const timeRegex = /^(\d{1,2}):(\d{1,2})$/;
46
+ const convert = (timeStr) => {
47
+ const match = timeStr.match(timeRegex);
48
+ if (!match)
49
+ return timeStr;
50
+ const hours = match[1].padStart(2, '0');
51
+ const minutes = match[2].padStart(2, '0');
52
+ return `${hours}${minutes}`;
53
+ };
54
+ const transform = (obj) => {
55
+ if (Array.isArray(obj)) {
56
+ return obj.map(transform);
57
+ }
58
+ else if (typeof obj === 'object' && obj !== null) {
59
+ for (const key in obj) {
60
+ if (typeof obj[key] === 'string' && timeRegex.test(obj[key])) {
61
+ obj[key] = convert(obj[key]);
62
+ }
63
+ else if (typeof obj[key] === 'object') {
64
+ obj[key] = transform(obj[key]);
65
+ }
66
+ }
67
+ }
68
+ return obj;
69
+ };
70
+ return transform(JSON.parse(JSON.stringify(data)));
71
+ }
72
+ function deNormalizeWorkingHourTimeFormat(data) {
73
+ const timeRegex = /^(\d{2})(\d{2})$/;
74
+ const convert = (timeStr) => {
75
+ const match = timeStr.match(timeRegex);
76
+ if (!match)
77
+ return timeStr;
78
+ const hours = String(Number(match[1]));
79
+ const minutes = String(Number(match[2])).padStart(2, '0');
80
+ return `${hours}:${minutes}`;
81
+ };
82
+ const transform = (obj) => {
83
+ if (Array.isArray(obj)) {
84
+ return obj.map(transform);
85
+ }
86
+ else if (typeof obj === 'object' && obj !== null) {
87
+ for (const key in obj) {
88
+ if (typeof obj[key] === 'string' && timeRegex.test(obj[key])) {
89
+ obj[key] = convert(obj[key]);
90
+ }
91
+ else if (typeof obj[key] === 'object') {
92
+ obj[key] = transform(obj[key]);
93
+ }
94
+ }
95
+ }
96
+ return obj;
97
+ };
98
+ return transform(JSON.parse(JSON.stringify(data)));
99
+ }
100
+ function parseTime(time) {
101
+ const [hh, mm] = formatTimeString(time).split(":").map(Number);
102
+ if (isNaN(hh) || isNaN(mm) ||
103
+ hh < 0 || hh > 23 ||
104
+ mm < 0 || mm > 59) {
105
+ (0, error_common_1.badRequestError)(`Invalid time format: ${formatTimeString(time)}`);
106
+ }
107
+ return hh * 60 + mm;
108
+ }
109
+ function formatTimeString(time) {
110
+ if (!/^\d{4}$/.test(time)) {
111
+ (0, error_common_1.badRequestError)(`Invalid time format: ${time}`);
112
+ }
113
+ return time.slice(0, 2) + ":" + time.slice(2);
114
+ }
39
115
  //# sourceMappingURL=time.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"time.js","sourceRoot":"/","sources":["utilities/time.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,2DAAmC;AACnC,qEAA6C;AAE7C,eAAK,CAAC,MAAM,CAAC,aAAG,CAAC,CAAC;AAClB,eAAK,CAAC,MAAM,CAAC,kBAAQ,CAAC,CAAC;AAEV,QAAA,YAAY,GAAG,YAAY,CAAC;AAIlC,MAAM,gBAAgB,GAAG,CAAC,OAAe,EAAE,IAAI,GAAG,aAAa,EAAE,EAAE;IACtE,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,OAAO,IAAA,eAAK,GAAE;SACT,EAAE,CAAC,IAAI,CAAC;SACR,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;SACjB,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC;SACrB,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;SAChB,GAAG,CAAC,aAAa,EAAE,CAAC,CAAC;SACrB,GAAG,EAAE;SACL,MAAM,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC,CAAC;AAXW,QAAA,gBAAgB,oBAW3B;AAIK,MAAM,kBAAkB,GAAG,CAAC,UAAkB,EAAE,IAAI,GAAG,aAAa,EAAE,EAAE;IAC3E,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,OAAO,IAAA,eAAK,GAAE;SACT,GAAG,EAAE;SACL,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;SACjB,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC;SACrB,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;SAChB,GAAG,CAAC,aAAa,EAAE,CAAC,CAAC;SACrB,EAAE,CAAC,IAAI,CAAC;SACR,MAAM,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC,CAAC;AAXW,QAAA,kBAAkB,sBAW7B","sourcesContent":["import dayjs from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\nimport timezone from 'dayjs/plugin/timezone';\n\ndayjs.extend(utc);\ndayjs.extend(timezone);\n\nexport const LyxaTimezone = 'Asia/Dhaka';\n\n// input: timeStr: 1500\n// output: 1200\nexport const convertTimeToUTC = (timeStr: string, zone = 'Asia/Beirut') => {\n const hour = Number(timeStr.slice(0, 2));\n const minute = Number(timeStr.slice(2));\n return dayjs()\n .tz(zone)\n .set('hour', hour)\n .set('minute', minute)\n .set('second', 0)\n .set('millisecond', 0)\n .utc()\n .format('HHmm');\n};\n\n// input: timeStr: 1200\n// output: 1500\nexport const convertTimeFromUTC = (utcTimeStr: string, zone = 'Asia/Beirut') => {\n const hour = Number(utcTimeStr.slice(0, 2));\n const minute = Number(utcTimeStr.slice(2));\n return dayjs()\n .utc()\n .set('hour', hour)\n .set('minute', minute)\n .set('second', 0)\n .set('millisecond', 0)\n .tz(zone)\n .format('HHmm');\n};\n"]}
1
+ {"version":3,"file":"time.js","sourceRoot":"/","sources":["utilities/time.ts"],"names":[],"mappings":";;;;;;AAyCA,wEA4BC;AAED,4EA2BC;AAED,8BAWC;AAGD,4CAKC;AAvHD,kDAA0B;AAC1B,2DAAmC;AACnC,qEAA6C;AAC7C,iDAAiD;AAEjD,eAAK,CAAC,MAAM,CAAC,aAAG,CAAC,CAAC;AAClB,eAAK,CAAC,MAAM,CAAC,kBAAQ,CAAC,CAAC;AAEV,QAAA,YAAY,GAAG,YAAY,CAAC;AAIlC,MAAM,gBAAgB,GAAG,CAAC,OAAe,EAAE,IAAI,GAAG,aAAa,EAAE,EAAE;IACtE,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,OAAO,IAAA,eAAK,GAAE;SACT,EAAE,CAAC,IAAI,CAAC;SACR,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;SACjB,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC;SACrB,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;SAChB,GAAG,CAAC,aAAa,EAAE,CAAC,CAAC;SACrB,GAAG,EAAE;SACL,MAAM,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC,CAAC;AAXW,QAAA,gBAAgB,oBAW3B;AAIK,MAAM,kBAAkB,GAAG,CAAC,UAAkB,EAAE,IAAI,GAAG,aAAa,EAAE,EAAE;IAC3E,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5C,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B,CAAC,IAAY;IAC3C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,IAAA,8BAAe,EAAC,wBAAwB,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC","sourcesContent":["import dayjs from 'dayjs';\nimport utc from 'dayjs/plugin/utc';\nimport timezone from 'dayjs/plugin/timezone';\nimport { badRequestError } from './error-common';\n\ndayjs.extend(utc);\ndayjs.extend(timezone);\n\nexport const LyxaTimezone = 'Asia/Dhaka';\n\n// input: timeStr: 1500\n// output: 1200\nexport const convertTimeToUTC = (timeStr: string, zone = 'Asia/Beirut') => {\n const hour = Number(timeStr.slice(0, 2));\n const minute = Number(timeStr.slice(2));\n return dayjs()\n .tz(zone)\n .set('hour', hour)\n .set('minute', minute)\n .set('second', 0)\n .set('millisecond', 0)\n .utc()\n .format('HHmm');\n};\n\n// input: timeStr: 1200\n// output: 1500\nexport const convertTimeFromUTC = (utcTimeStr: string, zone = 'Asia/Beirut') => {\n const hour = Number(utcTimeStr.slice(0, 2));\n const minute = Number(utcTimeStr.slice(2));\n return dayjs()\n .utc()\n .set('hour', hour)\n .set('minute', minute)\n .set('second', 0)\n .set('millisecond', 0)\n .tz(zone)\n .format('HHmm');\n};\n\n\nexport function normalizeWorkingHourTimeFormat(data: any) {\n\tconst timeRegex = /^(\\d{1,2}):(\\d{1,2})$/;\n\n\tconst convert = (timeStr: string) => {\n\t\tconst match = timeStr.match(timeRegex);\n\t\tif (!match) return timeStr;\n\t\tconst hours = match[1].padStart(2, '0');\n\t\tconst minutes = match[2].padStart(2, '0');\n\t\treturn `${hours}${minutes}`;\n\t};\n\n\tconst transform: any = (obj: any) => {\n\t\t\n\t\tif (Array.isArray(obj)) {\n\t\t\treturn obj.map(transform);\n\t\t} else if (typeof obj === 'object' && obj !== null) {\n\t\t\tfor (const key in obj) {\n\t\t\t\tif (typeof obj[key] === 'string' && timeRegex.test(obj[key])) {\n\t\t\t\t\tobj[key] = convert(obj[key]);\n\t\t\t\t} else if (typeof obj[key] === 'object') {\n\t\t\t\t\tobj[key] = transform(obj[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn obj;\n\t};\n\n\treturn transform(JSON.parse(JSON.stringify(data))); // deep copy to avoid mutation\n}\n\nexport function deNormalizeWorkingHourTimeFormat(data: any) {\n\tconst timeRegex = /^(\\d{2})(\\d{2})$/;\n\n\tconst convert = (timeStr: string) => {\n\t\tconst match = timeStr.match(timeRegex);\n\t\tif (!match) return timeStr;\n\t\tconst hours = String(Number(match[1])); // remove leading zero\n\t\tconst minutes = String(Number(match[2])).padStart(2, '0');\n\t\treturn `${hours}:${minutes}`;\n\t};\n\n\tconst transform: any = (obj: any) => {\n\t\tif (Array.isArray(obj)) {\n\t\t\treturn obj.map(transform);\n\t\t} else if (typeof obj === 'object' && obj !== null) {\n\t\t\tfor (const key in obj) {\n\t\t\t\tif (typeof obj[key] === 'string' && timeRegex.test(obj[key])) {\n\t\t\t\t\tobj[key] = convert(obj[key]);\n\t\t\t\t} else if (typeof obj[key] === 'object') {\n\t\t\t\t\tobj[key] = transform(obj[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn obj;\n\t};\n\t// return transform(JSON.parse((data)));\n\treturn transform(JSON.parse(JSON.stringify(data)));\n}\n\nexport function parseTime(time: string): number {\n const [hh, mm] = formatTimeString(time).split(\":\").map(Number);\n if (\n isNaN(hh) || isNaN(mm) ||\n hh < 0 || hh > 23 ||\n mm < 0 || mm > 59\n ) {\n badRequestError(`Invalid time format: ${formatTimeString(time)}`);\n }\n\n return hh * 60 + mm;\n}\n\n// i/p: 0600, o/p: 06:00 \nexport function formatTimeString(time: string): string {\n if (!/^\\d{4}$/.test(time)) {\n badRequestError(`Invalid time format: ${time}`);\n }\n return time.slice(0, 2) + \":\" + time.slice(2);\n}\n\n"]}
@@ -646,7 +646,7 @@ export declare const createResponseSchema: <T>(schema: z.ZodSchema<T>) => z.ZodO
646
646
  totalPages: number;
647
647
  } | undefined;
648
648
  }>, z.ZodType<T, z.ZodTypeDef, T>]>>;
649
- }>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
649
+ }>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
650
650
  success: z.ZodBoolean;
651
651
  message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
652
652
  data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
@@ -684,83 +684,7 @@ export declare const createResponseSchema: <T>(schema: z.ZodSchema<T>) => z.ZodO
684
684
  totalPages: number;
685
685
  } | undefined;
686
686
  }>, z.ZodType<T, z.ZodTypeDef, T>]>>;
687
- }>, any>[k]; } : never, z.baseObjectInputType<{
688
- success: z.ZodBoolean;
689
- message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
690
- data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
691
- metadata: z.ZodOptional<z.ZodObject<{
692
- page: z.ZodNumber;
693
- size: z.ZodNumber;
694
- totalElements: z.ZodNumber;
695
- totalPages: z.ZodNumber;
696
- }, "strip", z.ZodTypeAny, {
697
- page: number;
698
- size: number;
699
- totalElements: number;
700
- totalPages: number;
701
- }, {
702
- page: number;
703
- size: number;
704
- totalElements: number;
705
- totalPages: number;
706
- }>>;
707
- documents: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
708
- }, "strip", z.ZodTypeAny, {
709
- documents: T[];
710
- metadata?: {
711
- page: number;
712
- size: number;
713
- totalElements: number;
714
- totalPages: number;
715
- } | undefined;
716
- }, {
717
- documents: T[];
718
- metadata?: {
719
- page: number;
720
- size: number;
721
- totalElements: number;
722
- totalPages: number;
723
- } | undefined;
724
- }>, z.ZodType<T, z.ZodTypeDef, T>]>>;
725
- }> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
726
- success: z.ZodBoolean;
727
- message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
728
- data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
729
- metadata: z.ZodOptional<z.ZodObject<{
730
- page: z.ZodNumber;
731
- size: z.ZodNumber;
732
- totalElements: z.ZodNumber;
733
- totalPages: z.ZodNumber;
734
- }, "strip", z.ZodTypeAny, {
735
- page: number;
736
- size: number;
737
- totalElements: number;
738
- totalPages: number;
739
- }, {
740
- page: number;
741
- size: number;
742
- totalElements: number;
743
- totalPages: number;
744
- }>>;
745
- documents: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
746
- }, "strip", z.ZodTypeAny, {
747
- documents: T[];
748
- metadata?: {
749
- page: number;
750
- size: number;
751
- totalElements: number;
752
- totalPages: number;
753
- } | undefined;
754
- }, {
755
- documents: T[];
756
- metadata?: {
757
- page: number;
758
- size: number;
759
- totalElements: number;
760
- totalPages: number;
761
- } | undefined;
762
- }>, z.ZodType<T, z.ZodTypeDef, T>]>>;
763
- }>[k_1]; } : never>;
687
+ }> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
764
688
  export type PaginatedDTO<T> = {
765
689
  metadata: DTO<typeof metadataSchema>;
766
690
  documents: T[];
@@ -76,34 +76,22 @@ export declare class SchemaBuilder<T extends z.ZodRawShape> {
76
76
  private baseSchema;
77
77
  constructor(baseFields: T, includeTimestamps?: boolean, includeTracking?: boolean);
78
78
  private createBaseSchema;
79
- getBaseSchema(): z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any>[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<T>[k_1]; } : never>;
79
+ getBaseSchema(): z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
80
80
  getEntitySchema(): z.ZodObject<z.objectUtil.extendShape<T, {
81
81
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
82
- }> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<z.objectUtil.extendShape<T, {
82
+ }> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<T_1[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
83
83
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
84
- }>[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
84
+ }> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<T_2[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
85
85
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
86
- }> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<z.objectUtil.extendShape<T, {
87
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
88
- }>[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
89
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
90
- }> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
91
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
92
- }>[k]>; } : never, z.ZodTypeAny, "passthrough">>;
86
+ }> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<T_3[k]>; } : never, z.ZodTypeAny, "passthrough">>;
93
87
  getIdSchema(): z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
94
88
  getUpdateSchema(excludeFields?: ExcludeFromUpdate): z.ZodObject<z.objectUtil.extendShape<T, {
95
89
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
96
- }> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<z.objectUtil.extendShape<T, {
97
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
98
- }>[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
99
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
100
- }> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<z.objectUtil.extendShape<T, {
101
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
102
- }>[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
90
+ }> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<T_1[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
103
91
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
104
- }> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
92
+ }> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<T_2[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
105
93
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
106
- }>[k]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
94
+ }> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<T_3[k]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
107
95
  [x: string]: z.ZodOptional<z.ZodTypeAny>;
108
96
  }, "strict", z.ZodTypeAny, {
109
97
  [x: string]: any;
@@ -126,34 +114,22 @@ export declare class SchemaBuilder<T extends z.ZodRawShape> {
126
114
  [x: string]: any;
127
115
  }>;
128
116
  getAllSchemas(excludeFromUpdate?: ExcludeFromUpdate): {
129
- BaseSchema: z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any>[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<T>[k_1]; } : never>;
117
+ BaseSchema: z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
130
118
  EntitySchema: z.ZodObject<z.objectUtil.extendShape<T, {
131
119
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
132
- }> extends infer T_3 extends z.ZodRawShape ? { [k_2 in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
120
+ }> extends infer T_3 extends z.ZodRawShape ? { [k_2 in keyof T_3]: z.ZodOptional<T_3[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
133
121
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
134
- }>[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
122
+ }> extends infer T_4 extends z.ZodRawShape ? { [k_2 in keyof T_4]: z.ZodOptional<T_4[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
135
123
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
136
- }> extends infer T_4 extends z.ZodRawShape ? { [k_2 in keyof T_4]: z.ZodOptional<z.objectUtil.extendShape<T, {
137
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
138
- }>[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
139
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
140
- }> extends infer T_5 extends z.ZodRawShape ? { [k_2 in keyof T_5]: z.ZodOptional<z.objectUtil.extendShape<T, {
141
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
142
- }>[k_2]>; } : never, z.ZodTypeAny, "passthrough">>;
124
+ }> extends infer T_5 extends z.ZodRawShape ? { [k_2 in keyof T_5]: z.ZodOptional<T_5[k_2]>; } : never, z.ZodTypeAny, "passthrough">>;
143
125
  IdSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
144
126
  UpdateSchema: z.ZodObject<z.objectUtil.extendShape<T, {
145
127
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
146
- }> extends infer T_6 extends z.ZodRawShape ? { [k_2 in keyof T_6]: z.ZodOptional<z.objectUtil.extendShape<T, {
147
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
148
- }>[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
149
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
150
- }> extends infer T_7 extends z.ZodRawShape ? { [k_2 in keyof T_7]: z.ZodOptional<z.objectUtil.extendShape<T, {
151
- _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
152
- }>[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
128
+ }> extends infer T_6 extends z.ZodRawShape ? { [k_2 in keyof T_6]: z.ZodOptional<T_6[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
153
129
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
154
- }> extends infer T_8 extends z.ZodRawShape ? { [k_2 in keyof T_8]: z.ZodOptional<z.objectUtil.extendShape<T, {
130
+ }> extends infer T_7 extends z.ZodRawShape ? { [k_2 in keyof T_7]: z.ZodOptional<T_7[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
155
131
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
156
- }>[k_2]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
132
+ }> extends infer T_8 extends z.ZodRawShape ? { [k_2 in keyof T_8]: z.ZodOptional<T_8[k_2]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
157
133
  [x: string]: z.ZodOptional<z.ZodTypeAny>;
158
134
  }, "strict", z.ZodTypeAny, {
159
135
  [x: string]: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.1.70",
3
+ "version": "1.1.72",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",