@lyxa.ai/core 1.3.24 → 1.3.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/libraries/mongo/models/embedded/product-snap.model.d.ts +1 -0
- package/dist/libraries/mongo/models/embedded/product-snap.model.js +5 -0
- package/dist/libraries/mongo/models/embedded/product-snap.model.js.map +1 -1
- package/dist/libraries/mongo/models/shop-access-control.model.d.ts +2 -0
- package/dist/libraries/mongo/models/shop-access-control.model.js +6 -0
- package/dist/libraries/mongo/models/shop-access-control.model.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/package.json +1 -1
|
@@ -26,6 +26,7 @@ class ProductSnap {
|
|
|
26
26
|
isDrinkIncluded;
|
|
27
27
|
isStockEnabled;
|
|
28
28
|
stockQuantity;
|
|
29
|
+
orderQuantityLimit;
|
|
29
30
|
productMarketing;
|
|
30
31
|
}
|
|
31
32
|
exports.ProductSnap = ProductSnap;
|
|
@@ -73,6 +74,10 @@ __decorate([
|
|
|
73
74
|
(0, typegoose_1.prop)({ type: Number }),
|
|
74
75
|
__metadata("design:type", Number)
|
|
75
76
|
], ProductSnap.prototype, "stockQuantity", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, typegoose_1.prop)({ type: Number, min: 0, max: 999999999 }),
|
|
79
|
+
__metadata("design:type", Number)
|
|
80
|
+
], ProductSnap.prototype, "orderQuantityLimit", void 0);
|
|
76
81
|
__decorate([
|
|
77
82
|
(0, typegoose_1.prop)({ ref: () => product_marketing_model_1.ProductMarketing }),
|
|
78
83
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-snap.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/product-snap.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AACjD,qDAAsE;AACtE,wEAA8D;AAC9D,mEAAyD;AAEzD,MAAa,WAAW;IAEhB,IAA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AAE,CAAC;;gDACT;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,CAAC,sCAAc,CAAC,EAAE,CAAC;;oDACS;AAGnC;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDACK;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;oDACP;AAG1B;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;mDACR;AAGzB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDACO;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC;;uDACZ;AAG5B;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,0CAAgB,EAAE,CAAC;;qDACU","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\nimport { PriceOption, ProductType } from '../../../../utilities/enum';\nimport { ProductMarketing } from '../product-marketing.model';\nimport { PriceBreakdown } from './price-breakdown.model';\n\nexport class ProductSnap {\n\t@prop({ required: true, type: String })\n\tpublic name!: string;\n\n\t@prop({ type: String })\n\tpublic barcode?: string;\n\n\t@prop({ type: String, enum: ProductType })\n\tpublic productType?: ProductType;\n\n\t@prop({ type: String })\n\tpublic logo?: string;\n\n\t@prop({ type: [String], default: [] })\n\tpublic images?: string[];\n\n\t@prop({ type: String, enum: PriceOption })\n\tpublic priceOption?: PriceOption;\n\n\t@prop({ type: [PriceBreakdown] })\n\tpublic priceBreakdowns?: PriceBreakdown[];\n\n\t@prop({ type: String })\n\tpublic description?: string;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isDrinkIncluded?: boolean;\n\n\t@prop({ type: Boolean, default: false })\n\tpublic isStockEnabled?: boolean;\n\n\t@prop({ type: Number })\n\tpublic stockQuantity?: number;\n\n\t@prop({ type: Number, min: 0, max: 999999999 })\n\tpublic orderQuantityLimit?: number;\n\n\t@prop({ ref: () => ProductMarketing })\n\tpublic productMarketing?: Ref<ProductMarketing>;\n}\n"]}
|
|
@@ -3,6 +3,7 @@ import { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
|
3
3
|
import { ShopRole } from '../../../utilities/enum';
|
|
4
4
|
import { Parent } from './parent.model';
|
|
5
5
|
import { Shop } from './shop.model';
|
|
6
|
+
import { ResetPasswordFields } from './embedded/rest-password.model';
|
|
6
7
|
export declare class ShopAccessControl extends TimeStamps {
|
|
7
8
|
name: string;
|
|
8
9
|
email: string;
|
|
@@ -11,4 +12,5 @@ export declare class ShopAccessControl extends TimeStamps {
|
|
|
11
12
|
shops?: Ref<Shop>[];
|
|
12
13
|
role: ShopRole;
|
|
13
14
|
status?: string;
|
|
15
|
+
resetPassword?: ResetPasswordFields;
|
|
14
16
|
}
|
|
@@ -16,6 +16,7 @@ const enum_1 = require("../../../utilities/enum");
|
|
|
16
16
|
const parent_model_1 = require("./parent.model");
|
|
17
17
|
const shop_model_1 = require("./shop.model");
|
|
18
18
|
const password_1 = require("../../../utilities/password");
|
|
19
|
+
const rest_password_model_1 = require("./embedded/rest-password.model");
|
|
19
20
|
let ShopAccessControl = class ShopAccessControl extends defaultClasses_1.TimeStamps {
|
|
20
21
|
name;
|
|
21
22
|
email;
|
|
@@ -24,6 +25,7 @@ let ShopAccessControl = class ShopAccessControl extends defaultClasses_1.TimeSta
|
|
|
24
25
|
shops;
|
|
25
26
|
role;
|
|
26
27
|
status;
|
|
28
|
+
resetPassword;
|
|
27
29
|
};
|
|
28
30
|
exports.ShopAccessControl = ShopAccessControl;
|
|
29
31
|
__decorate([
|
|
@@ -54,6 +56,10 @@ __decorate([
|
|
|
54
56
|
(0, typegoose_1.prop)({ type: String, enum: enum_1.Status, default: enum_1.Status.ACTIVE }),
|
|
55
57
|
__metadata("design:type", String)
|
|
56
58
|
], ShopAccessControl.prototype, "status", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typegoose_1.prop)({ type: rest_password_model_1.ResetPasswordFields }),
|
|
61
|
+
__metadata("design:type", rest_password_model_1.ResetPasswordFields)
|
|
62
|
+
], ShopAccessControl.prototype, "resetPassword", void 0);
|
|
57
63
|
exports.ShopAccessControl = ShopAccessControl = __decorate([
|
|
58
64
|
(0, typegoose_1.pre)('save', async function (next) {
|
|
59
65
|
if (this.isModified('password')) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shop-access-control.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shop-access-control.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AAErE,kDAA2D;AAC3D,iDAAwC;AACxC,6CAAoC;AACpC,0DAA2D;
|
|
1
|
+
{"version":3,"file":"shop-access-control.model.js","sourceRoot":"/","sources":["libraries/mongo/models/shop-access-control.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAA2E;AAC3E,4EAAqE;AAErE,kDAA2D;AAC3D,iDAAwC;AACxC,6CAAoC;AACpC,0DAA2D;AAC3D,wEAAqE;AAkB9D,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,2BAAU;IAEzC,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,QAAQ,CAAU;IAGlB,MAAM,CAAe;IAGrB,KAAK,CAAe;IAGpB,IAAI,CAAY;IAGhB,MAAM,CAAU;IAGhB,aAAa,CAAuB;CAC3C,CAAA;AAxBY,8CAAiB;AAEtB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;;+CACjC;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAA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AC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACtD,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,iBAAK,EAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;IACnF,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,oBAAoB,EAAE,EAAE,CAAC;GACzD,iBAAiB,CAwB7B","sourcesContent":["import { index, modelOptions, pre, prop, Ref } from '@typegoose/typegoose';\nimport { TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';\nimport { Query } from 'mongoose';\nimport { ShopRole, Status } from '../../../utilities/enum';\nimport { Parent } from './parent.model';\nimport { Shop } from './shop.model';\nimport { hashPassword } from '../../../utilities/password';\nimport { ResetPasswordFields } from './embedded/rest-password.model';\n\n@pre<ShopAccessControl>('save', async function (next) {\n\tif (this.isModified('password')) {\n\t\tthis.password = await hashPassword(this.password);\n\t}\n\tnext();\n})\n@pre<Query<any, ShopAccessControl>>('findOneAndUpdate', async function (next) {\n\tconst update = this.getUpdate() as Record<string, any>;\n\tif (update?.password) {\n\t\tupdate.password = await hashPassword(update.password);\n\t\tthis.setUpdate(update);\n\t}\n\tnext();\n})\n@index({ email: 1 }, { unique: true, partialFilterExpression: { deletedAt: null } })\n@modelOptions({ schemaOptions: { collection: 'shopAccessControls' } })\nexport class ShopAccessControl extends TimeStamps {\n\t@prop({ required: true, type: String, maxlength: 50 })\n\tpublic name!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: true, type: String, minlength: 8 })\n\tpublic password!: string;\n\n\t@prop({ required: true, ref: () => Parent })\n\tpublic parent?: Ref<Parent>;\n\n\t@prop({ ref: () => Shop, default: [] })\n\tpublic shops?: Ref<Shop>[];\n\n\t@prop({ required: true, type: String, enum: ShopRole })\n\tpublic role!: ShopRole;\n\n\t@prop({ type: String, enum: Status, default: Status.ACTIVE })\n\tpublic status?: string;\n\n\t@prop({ type: ResetPasswordFields })\n\tpublic resetPassword?: ResetPasswordFields;\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED