@lyxa.ai/core 1.1.70 → 1.1.73
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/base/base-coupon.model.d.ts +4 -0
- package/dist/libraries/mongo/models/base/base-coupon.model.js +20 -0
- package/dist/libraries/mongo/models/base/base-coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/coupon.model.d.ts +1 -0
- package/dist/libraries/mongo/models/coupon.model.js +5 -0
- package/dist/libraries/mongo/models/coupon.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/order-finance.model.js +1 -1
- package/dist/libraries/mongo/models/embedded/order-finance.model.js.map +1 -1
- package/dist/libraries/mongo/models/embedded/{best-seller-category.model.js → shop-default-category.model.js} +1 -1
- package/dist/libraries/mongo/models/embedded/shop-default-category.model.js.map +1 -0
- package/dist/libraries/mongo/models/providers/buy1-get1-marketing.model.d.ts +1 -0
- package/dist/libraries/mongo/models/providers/buy1-get1-marketing.model.js +5 -0
- package/dist/libraries/mongo/models/providers/buy1-get1-marketing.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/discount-marketing.model.d.ts +2 -0
- package/dist/libraries/mongo/models/providers/discount-marketing.model.js +10 -0
- package/dist/libraries/mongo/models/providers/discount-marketing.model.js.map +1 -1
- package/dist/libraries/mongo/models/providers/free-delivery-marketing.model.d.ts +1 -0
- package/dist/libraries/mongo/models/providers/free-delivery-marketing.model.js +5 -0
- package/dist/libraries/mongo/models/providers/free-delivery-marketing.model.js.map +1 -1
- package/dist/libraries/mongo/models/shop.model.d.ts +1 -1
- package/dist/libraries/mongo/models/shop.model.js +5 -5
- package/dist/libraries/mongo/models/shop.model.js.map +1 -1
- package/dist/libraries/mongo/models/user.model.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 +2 -78
- package/dist/types/utilities/validation/global-validation.d.ts +14 -38
- package/dist/utilities/time.d.ts +4 -0
- package/dist/utilities/time.js +76 -0
- package/dist/utilities/time.js.map +1 -1
- package/dist/utilities/validation/common-validation.d.ts +2 -78
- package/dist/utilities/validation/global-validation.d.ts +14 -38
- package/package.json +1 -1
- package/dist/libraries/mongo/models/embedded/best-seller-category.model.js.map +0 -1
- /package/dist/libraries/mongo/models/embedded/{best-seller-category.model.d.ts → shop-default-category.model.d.ts} +0 -0
|
@@ -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;
|
|
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,IAA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../../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"]}
|
|
@@ -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;
|
|
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"]}
|
|
@@ -25,7 +25,7 @@ class OrderFinance extends defaultClasses_1.TimeStamps {
|
|
|
25
25
|
}
|
|
26
26
|
exports.OrderFinance = OrderFinance;
|
|
27
27
|
__decorate([
|
|
28
|
-
(0, typegoose_1.prop)({ type: Number, default:
|
|
28
|
+
(0, typegoose_1.prop)({ type: Number, default: 0 }),
|
|
29
29
|
__metadata("design:type", Number)
|
|
30
30
|
], OrderFinance.prototype, "exchangeRate", void 0);
|
|
31
31
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-finance.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/order-finance.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,4EAAqE;AACrE,2EAAiE;AACjE,qDAA2D;AAC3D,iDAA6C;AAC7C,mEAAyD;AAEzD,MAAa,YAAa,SAAQ,2BAAU;IAEpC,YAAY,CAAU;IAGtB,aAAa,CAAiB;IAG9B,kBAAkB,CAAsB;IAGxC,WAAW,CAAe;IAG1B,cAAc,CAAkB;CACvC;AAfD,oCAeC;AAbO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;kDACN;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAa,EAAE,OAAO,EAAE,oBAAa,CAAC,IAAI,EAAE,CAAC;;mDACpC;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,8CAAkB,EAAE,CAAC;8BACb,8CAAkB;wDAAC;AAGxC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,0BAAW,EAAE,CAAC;8BACb,0BAAW;iDAAC;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,sCAAc,EAAE,CAAC;8BACb,sCAAc;oDAAC","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { PaymentInformation } from './payment-infromation.model';\nimport { PaymentMethod } from '../../../../utilities/enum';\nimport { RiderProfit } from './profit.model';\nimport { CashSettlement } from './cash-settlement.model';\n\nexport class OrderFinance extends TimeStamps {\n\t@prop({ type: Number, default:
|
|
1
|
+
{"version":3,"file":"order-finance.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/order-finance.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA4C;AAC5C,4EAAqE;AACrE,2EAAiE;AACjE,qDAA2D;AAC3D,iDAA6C;AAC7C,mEAAyD;AAEzD,MAAa,YAAa,SAAQ,2BAAU;IAEpC,YAAY,CAAU;IAGtB,aAAa,CAAiB;IAG9B,kBAAkB,CAAsB;IAGxC,WAAW,CAAe;IAG1B,cAAc,CAAkB;CACvC;AAfD,oCAeC;AAbO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;kDACN;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAa,EAAE,OAAO,EAAE,oBAAa,CAAC,IAAI,EAAE,CAAC;;mDACpC;AAG9B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,8CAAkB,EAAE,CAAC;8BACb,8CAAkB;wDAAC;AAGxC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,0BAAW,EAAE,CAAC;8BACb,0BAAW;iDAAC;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,sCAAc,EAAE,CAAC;8BACb,sCAAc;oDAAC","sourcesContent":["import { prop } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { PaymentInformation } from './payment-infromation.model';\nimport { PaymentMethod } from '../../../../utilities/enum';\nimport { RiderProfit } from './profit.model';\nimport { CashSettlement } from './cash-settlement.model';\n\nexport class OrderFinance extends TimeStamps {\n\t@prop({ type: Number, default: 0 })\n\tpublic exchangeRate?: number;\n\n\t@prop({ type: String, enum: PaymentMethod, default: PaymentMethod.CASH })\n\tpublic paymentMethod?: PaymentMethod;\n\n\t@prop({ type: () => PaymentInformation })\n\tpublic paymentInformation?: PaymentInformation;\n\n\t@prop({ type: () => RiderProfit })\n\tpublic riderProfit?: RiderProfit;\n\n\t@prop({ type: () => CashSettlement })\n\tpublic cashSettlement?: CashSettlement;\n}\n"]}
|
|
@@ -44,4 +44,4 @@ __decorate([
|
|
|
44
44
|
(0, typegoose_1.prop)({ ref: () => product_model_1.Product, default: [] }),
|
|
45
45
|
__metadata("design:type", Array)
|
|
46
46
|
], FavouritesCategory.prototype, "products", void 0);
|
|
47
|
-
//# sourceMappingURL=
|
|
47
|
+
//# sourceMappingURL=shop-default-category.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shop-default-category.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/shop-default-category.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAoD;AACpD,oDAA2C;AAE3C,MAAa,kBAAkB;IAEvB,KAAK,CAAU;IAGf,MAAM,CAAU;CACvB;AAND,gDAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;;iDACzB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,QAAQ,EAAE,CAAC;;kDACxC;AAGxB,MAAa,kBAAkB;IAEvB,KAAK,CAAU;IAGf,MAAM,CAAU;IAGhB,QAAQ,CAAkB;CACjC;AATD,gDASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;;iDACxB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,QAAQ,EAAE,CAAC;;kDACxC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,uBAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;oDACT","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { Status } from '../../../../utilities/enum';\nimport { Product } from '../product.model';\n\nexport class BestSellerCategory {\n\t@prop({ type: String, default: 'Best Seller' })\n\tpublic title?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.INACTIVE })\n\tpublic status?: Status;\n}\n\nexport class FavouritesCategory {\n\t@prop({ type: String, default: 'Favourites' })\n\tpublic title?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.INACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ ref: () => Product, default: [] })\n\tpublic products?: Ref<Product>[];\n}\n"]}
|
|
@@ -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;
|
|
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,gEAAsD;AAEtD,MAAa,iBAAkB,SAAQ,2BAAS;IACxC,aAAa,GAAG,oBAAa,CAAC,QAAiB,CAAC;IAGhD,YAAY,CAAW;IAGvB,SAAS,CAAa;IAGtB,KAAK,CAAU;IAOf,QAAQ,CAAwB;IAGhC,mBAAmB,CAAU;IAG7B,UAAU,CAAU;IAGpB,mBAAmB,CAAW;IAG9B,aAAa,CAAU;IAGvB,iBAAiB,CAAa;IAG9B,UAAU,CAAsB;CACvC;
|
|
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,CAAwB;IAGhC,mBAAmB,CAAU;IAG7B,4BAA4B,CAAW;IAGvC,UAAU,CAAU;IAGpB,mBAAmB,CAAW;IAG9B,mBAAmB,CAAW;IAG9B,aAAa,CAAU;IAGvB,iBAAiB,CAAa;IAG9B,UAAU,CAAsB;CACvC;AA1CD,8CA0CC;AAtCO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;uDACV;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAS,EAAE,CAAC;;oDACX;AAGtB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDACD;AAOf;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;;8DACC;AAG7B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;uEACM;AAGvC;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,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;wDACL;AAGvB;IADN,IAAA,gBAAI,EAAC,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}"]}
|
|
@@ -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;
|
|
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"]}
|
|
@@ -9,7 +9,7 @@ import { StartEndTime, WorkHourSetting } from './shared/work-hour.model';
|
|
|
9
9
|
import { Tag } from './tag.model';
|
|
10
10
|
import { DeliveryInfo } from './embedded/delivery-info.model';
|
|
11
11
|
import { ShopSearchFields } from './embedded/shop-search-fields.model';
|
|
12
|
-
import { BestSellerCategory, FavouritesCategory } from './embedded/
|
|
12
|
+
import { BestSellerCategory, FavouritesCategory } from './embedded/shop-default-category.model';
|
|
13
13
|
export declare class Shop extends TimeStamps {
|
|
14
14
|
shopId: string;
|
|
15
15
|
name: string;
|
|
@@ -24,7 +24,7 @@ const shop_hooks_1 = require("../utilities/shop.hooks");
|
|
|
24
24
|
const shop_search_fields_model_1 = require("./embedded/shop-search-fields.model");
|
|
25
25
|
const id_generator_1 = require("../../../utilities/id-generator");
|
|
26
26
|
const _1 = require(".");
|
|
27
|
-
const
|
|
27
|
+
const shop_default_category_model_1 = require("./embedded/shop-default-category.model");
|
|
28
28
|
let Shop = class Shop extends defaultClasses_1.TimeStamps {
|
|
29
29
|
shopId;
|
|
30
30
|
name;
|
|
@@ -226,12 +226,12 @@ __decorate([
|
|
|
226
226
|
__metadata("design:type", Number)
|
|
227
227
|
], Shop.prototype, "exchangeRate", void 0);
|
|
228
228
|
__decorate([
|
|
229
|
-
(0, typegoose_1.prop)({ type:
|
|
230
|
-
__metadata("design:type",
|
|
229
|
+
(0, typegoose_1.prop)({ type: shop_default_category_model_1.BestSellerCategory }),
|
|
230
|
+
__metadata("design:type", shop_default_category_model_1.BestSellerCategory)
|
|
231
231
|
], Shop.prototype, "bestSellerCategory", void 0);
|
|
232
232
|
__decorate([
|
|
233
|
-
(0, typegoose_1.prop)({ type:
|
|
234
|
-
__metadata("design:type",
|
|
233
|
+
(0, typegoose_1.prop)({ type: shop_default_category_model_1.FavouritesCategory }),
|
|
234
|
+
__metadata("design:type", shop_default_category_model_1.FavouritesCategory)
|
|
235
235
|
], Shop.prototype, "favouritesCategory", void 0);
|
|
236
236
|
__decorate([
|
|
237
237
|
(0, typegoose_1.prop)({ default: 0, type: () => Number }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shop.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shop.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAqF;AACrF,4EAAqE;AACrE,kDAA0F;AAC1F,+CAAsC;AACtC,wEAA8D;AAC9D,iDAAwC;AACxC,0DAAiD;AACjD,8DAAyE;AACzE,2CAAkC;AAClC,wEAA8D;AAC9D,wDAA4D;AAC5D,kFAAuE;AACvE,kEAA6D;AAC7D,wBAAiC;AACjC,sFAA+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AAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACrG,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACrF,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK,WAAW,IAAI;QACtC,MAAM,8BAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnC,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK;QACvB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,IAAI,CAAC,CAAC;QAChE,CAAC;IACF,CAAC,CAAC;GACW,IAAI,CA8IhB","sourcesContent":["import { modelOptions, prop, Ref, Severity, index, pre } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CounterType, ItemType, ShopOnlineStatus, Status } from '../../../utilities/enum';\nimport { Brand } from './brand.model';\nimport { ShopDocument } from './embedded/shop-document.model';\nimport { Parent } from './parent.model';\nimport { Address } from './shared/address.model';\nimport { StartEndTime, WorkHourSetting } from './shared/work-hour.model';\nimport { Tag } from './tag.model';\nimport { DeliveryInfo } from './embedded/delivery-info.model';\nimport { handleShopPreSave } from '../utilities/shop.hooks';\nimport { ShopSearchFields } from './embedded/shop-search-fields.model';\nimport { generateId } from '../../../utilities/id-generator';\nimport { CounterModel } from '.';\nimport { BestSellerCategory, FavouritesCategory } from './embedded/best-seller-category.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'shops' },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@index({ name: 1, itemType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@index({ parent: 1, status: 1, isVisibleToUser: 1 }, { partialFilterExpression: { deletedAt: null } })\n@index({ status: 1, createdAt: -1 }, { partialFilterExpression: { deletedAt: null } })\n@pre<Shop>('save', async function (next) {\n\tawait handleShopPreSave.call(this);\n\n\tnext();\n})\n@pre<Shop>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.shopId = await generateId(CounterModel, CounterType.SHOP);\n\t}\n})\nexport class Shop extends TimeStamps {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic shopId: string;\n\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic ownerName!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: true, ref: () => Parent })\n\tpublic parent: Ref<Parent>;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ required: true, ref: () => Brand })\n\tpublic brand: Ref<Brand>;\n\n\t@prop({ type: Number, default: 1, min: 1, max: 4 })\n\tpublic priceRange?: number;\n\n\t@prop({ required: true, type: String })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic userPhoneNumber!: string;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic additionalPhoneNumbers?: string[];\n\n\t@prop({ type: String, maxlength: 100 })\n\tpublic bobContactName?: string;\n\n\t@prop({ type: String, maxlength: 15 })\n\tpublic bobContactPhoneNumber?: string;\n\n\t@prop({ required: true, type: Address })\n\tpublic address!: Address;\n\n\t@prop({ type: String })\n\tpublic logo?: string;\n\n\t@prop({ type: String })\n\tpublic banner?: string;\n\n\t@prop({ type: ShopDocument })\n\tpublic document?: ShopDocument;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: ShopOnlineStatus,\n\t\tdefault: ShopOnlineStatus.OFFLINE,\n\t})\n\tpublic onlineStatus?: ShopOnlineStatus;\n\n\t@prop({ type: WorkHourSetting })\n\tpublic workHourSetting?: WorkHourSetting;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic dietaries?: string[];\n\n\t@prop({ ref: () => Tag, default: [] })\n\tpublic tags?: Ref<Tag>[];\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isBeirutAuthentic!: boolean;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isVisibleToUser!: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isShopDelivery?: boolean;\n\n\t@prop({ type: Number })\n\tpublic deliveryFee?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic minimumOrderAmount?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic orderCapacityEnabled?: boolean;\n\n\t@prop({ type: Number })\n\tpublic orderCapacity?: number;\n\n\t@prop({ type: () => [StartEndTime], default: [] })\n\tpublic shopActiveTimingsOfCurrentDate?: StartEndTime[];\n\n\t@prop({ type: DeliveryInfo })\n\tpublic deliveryInfo?: DeliveryInfo;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t// Setting\n\t@prop({ type: Boolean, default: false })\n\tpublic allowSpecialInstructions?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRiderNoteVisible?: boolean;\n\n\t@prop({ type: String })\n\tpublic riderNote?: string;\n\n\t@prop({ type: Number, default: 10 })\n\tpublic defaultPreparationTime?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic exchangeRate?: number;\n\n\t// Best seller category\n\t@prop({ type: BestSellerCategory, default: new BestSellerCategory() })\n\tpublic bestSellerCategory?: BestSellerCategory;\n\n\t// Favourites category\n\t@prop({ type: FavouritesCategory, default: new FavouritesCategory() })\n\tpublic favouritesCategory?: FavouritesCategory;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic ordersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic customersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic vat_reg_number?: number;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic fcmTokens?: string[];\n\n\t@prop({ type: ShopSearchFields })\n\tpublic searchFields?: ShopSearchFields;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"shop.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shop.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAqF;AACrF,4EAAqE;AACrE,kDAA0F;AAC1F,+CAAsC;AACtC,wEAA8D;AAC9D,iDAAwC;AACxC,0DAAiD;AACjD,8DAAyE;AACzE,2CAAkC;AAClC,wEAA8D;AAC9D,wDAA4D;AAC5D,kFAAuE;AACvE,kEAA6D;AAC7D,wBAAiC;AACjC,wFAAgG;AAmBzF,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,2BAAU;IAE5B,MAAM,CAAS;IAGf,IAAI,CAAU;IAGd,SAAS,CAAU;IAGnB,KAAK,CAAU;IAGf,MAAM,CAAc;IAGpB,QAAQ,CAAY;IAGpB,MAAM,CAAU;IAGhB,KAAK,CAAa;IAGlB,UAAU,CAAU;IAGpB,WAAW,CAAU;IAGrB,eAAe,CAAU;IAGzB,sBAAsB,CAAY;IAGlC,cAAc,CAAU;IAGxB,qBAAqB,CAAU;IAG/B,OAAO,CAAW;IAGlB,IAAI,CAAU;IAGd,MAAM,CAAU;IAGhB,QAAQ,CAAgB;IAOxB,YAAY,CAAoB;IAGhC,eAAe,CAAmB;IAGlC,SAAS,CAAY;IAGrB,IAAI,CAAc;IAGlB,iBAAiB,CAAW;IAG5B,eAAe,CAAW;IAG1B,cAAc,CAAW;IAGzB,WAAW,CAAU;IAGrB,kBAAkB,CAAU;IAG5B,oBAAoB,CAAW;IAG/B,aAAa,CAAU;IAGvB,8BAA8B,CAAkB;IAGhD,YAAY,CAAgB;IAG5B,YAAY,CAAU;IAItB,wBAA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,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,2CAAgB,EAAE,CAAC;8BACX,2CAAgB;0CAAC;eA7I3B,IAAI;IAjBhB,IAAA,wBAAY,EAAC;QACb,aAAa,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE;QACtC,OAAO,EAAE,EAAE,UAAU,EAAE,oBAAQ,CAAC,KAAK,EAAE;KACvC,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IAC/F,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACrG,IAAA,iBAAK,EAAC,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACrF,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK,WAAW,IAAI;QACtC,MAAM,8BAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnC,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,eAAG,EAAO,MAAM,EAAE,KAAK;QACvB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,GAAG,MAAM,IAAA,yBAAU,EAAC,eAAY,EAAE,kBAAW,CAAC,IAAI,CAAC,CAAC;QAChE,CAAC;IACF,CAAC,CAAC;GACW,IAAI,CA8IhB","sourcesContent":["import { modelOptions, prop, Ref, Severity, index, pre } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { CounterType, ItemType, ShopOnlineStatus, Status } from '../../../utilities/enum';\nimport { Brand } from './brand.model';\nimport { ShopDocument } from './embedded/shop-document.model';\nimport { Parent } from './parent.model';\nimport { Address } from './shared/address.model';\nimport { StartEndTime, WorkHourSetting } from './shared/work-hour.model';\nimport { Tag } from './tag.model';\nimport { DeliveryInfo } from './embedded/delivery-info.model';\nimport { handleShopPreSave } from '../utilities/shop.hooks';\nimport { ShopSearchFields } from './embedded/shop-search-fields.model';\nimport { generateId } from '../../../utilities/id-generator';\nimport { CounterModel } from '.';\nimport { BestSellerCategory, FavouritesCategory } from './embedded/shop-default-category.model';\n\n@modelOptions({\n\tschemaOptions: { collection: 'shops' },\n\toptions: { allowMixed: Severity.ALLOW },\n})\n@index({ name: 1, itemType: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@index({ parent: 1, status: 1, isVisibleToUser: 1 }, { partialFilterExpression: { deletedAt: null } })\n@index({ status: 1, createdAt: -1 }, { partialFilterExpression: { deletedAt: null } })\n@pre<Shop>('save', async function (next) {\n\tawait handleShopPreSave.call(this);\n\n\tnext();\n})\n@pre<Shop>('save', async function () {\n\tif (this.isNew) {\n\t\tthis.shopId = await generateId(CounterModel, CounterType.SHOP);\n\t}\n})\nexport class Shop extends TimeStamps {\n\t@prop({ type: String, unique: true, index: true })\n\tpublic shopId: string;\n\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic ownerName!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: true, ref: () => Parent })\n\tpublic parent: Ref<Parent>;\n\n\t@prop({ required: true, type: String, enum: ItemType })\n\tpublic itemType!: ItemType;\n\n\t@prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status!: Status;\n\n\t@prop({ required: true, ref: () => Brand })\n\tpublic brand: Ref<Brand>;\n\n\t@prop({ type: Number, default: 1, min: 1, max: 4 })\n\tpublic priceRange?: number;\n\n\t@prop({ required: true, type: String })\n\tpublic phoneNumber!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic userPhoneNumber!: string;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic additionalPhoneNumbers?: string[];\n\n\t@prop({ type: String, maxlength: 100 })\n\tpublic bobContactName?: string;\n\n\t@prop({ type: String, maxlength: 15 })\n\tpublic bobContactPhoneNumber?: string;\n\n\t@prop({ required: true, type: Address })\n\tpublic address!: Address;\n\n\t@prop({ type: String })\n\tpublic logo?: string;\n\n\t@prop({ type: String })\n\tpublic banner?: string;\n\n\t@prop({ type: ShopDocument })\n\tpublic document?: ShopDocument;\n\n\t@prop({\n\t\ttype: String,\n\t\tenum: ShopOnlineStatus,\n\t\tdefault: ShopOnlineStatus.OFFLINE,\n\t})\n\tpublic onlineStatus?: ShopOnlineStatus;\n\n\t@prop({ type: WorkHourSetting })\n\tpublic workHourSetting?: WorkHourSetting;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic dietaries?: string[];\n\n\t@prop({ ref: () => Tag, default: [] })\n\tpublic tags?: Ref<Tag>[];\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isBeirutAuthentic!: boolean;\n\n\t@prop({ required: true, type: Boolean })\n\tpublic isVisibleToUser!: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isShopDelivery?: boolean;\n\n\t@prop({ type: Number })\n\tpublic deliveryFee?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic minimumOrderAmount?: number;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic orderCapacityEnabled?: boolean;\n\n\t@prop({ type: Number })\n\tpublic orderCapacity?: number;\n\n\t@prop({ type: () => [StartEndTime], default: [] })\n\tpublic shopActiveTimingsOfCurrentDate?: StartEndTime[];\n\n\t@prop({ type: DeliveryInfo })\n\tpublic deliveryInfo?: DeliveryInfo;\n\n\t@prop({ type: Number })\n\tpublic sortingOrder?: number;\n\n\t// Setting\n\t@prop({ type: Boolean, default: false })\n\tpublic allowSpecialInstructions?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isRiderNoteVisible?: boolean;\n\n\t@prop({ type: String })\n\tpublic riderNote?: string;\n\n\t@prop({ type: Number, default: 10 })\n\tpublic defaultPreparationTime?: number;\n\n\t@prop({ type: Number, default: 0 })\n\tpublic exchangeRate?: number;\n\n\t// Best seller category\n\t@prop({ type: BestSellerCategory })\n\tpublic bestSellerCategory?: BestSellerCategory;\n\n\t// Favourites category\n\t@prop({ type: FavouritesCategory })\n\tpublic favouritesCategory?: FavouritesCategory;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic avgRating?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic ordersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic customersCount?: number;\n\n\t@prop({ default: 0, type: () => Number })\n\tpublic vat_reg_number?: number;\n\n\t@prop({ type: () => [String], default: [] })\n\tpublic fcmTokens?: string[];\n\n\t@prop({ type: ShopSearchFields })\n\tpublic searchFields?: ShopSearchFields;\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;
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -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.
|
|
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
|
-
}
|
|
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]:
|
|
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,
|
|
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
|
|
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
|
|
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]:
|
|
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,
|
|
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
|
|
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
|
|
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/dist/utilities/time.d.ts
CHANGED
|
@@ -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;
|
package/dist/utilities/time.js
CHANGED
|
@@ -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":";;;;;;
|
|
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,OA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SAAS,CAAC,IAAY;IACpC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/D,IACE,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QACtB,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE;QACjB,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,EACjB,CAAC;QACD,IAAA,8BAAe,EAAC,wBAAwB,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACtB,CAAC;AAGD,SAAgB,gBAAgB,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.
|
|
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
|
-
}
|
|
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]:
|
|
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,
|
|
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
|
|
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
|
|
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]:
|
|
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,
|
|
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
|
|
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
|
|
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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"best-seller-category.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/best-seller-category.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAoD;AACpD,oDAA2C;AAE3C,MAAa,kBAAkB;IAEvB,KAAK,CAAU;IAGf,MAAM,CAAU;CACvB;AAND,gDAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;;iDACzB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,QAAQ,EAAE,CAAC;;kDACxC;AAGxB,MAAa,kBAAkB;IAEvB,KAAK,CAAU;IAGf,MAAM,CAAU;IAGhB,QAAQ,CAAkB;CACjC;AATD,gDASC;AAPO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;;iDACxB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,QAAQ,EAAE,CAAC;;kDACxC;AAGhB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,uBAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;oDACT","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { Status } from '../../../../utilities/enum';\nimport { Product } from '../product.model';\n\nexport class BestSellerCategory {\n\t@prop({ type: String, default: 'Best Seller' })\n\tpublic title?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.INACTIVE })\n\tpublic status?: Status;\n}\n\nexport class FavouritesCategory {\n\t@prop({ type: String, default: 'Favourites' })\n\tpublic title?: string;\n\n\t@prop({ type: String, enum: Status, default: Status.INACTIVE })\n\tpublic status?: Status;\n\n\t@prop({ ref: () => Product, default: [] })\n\tpublic products?: Ref<Product>[];\n}\n"]}
|
|
File without changes
|