@lyxa.ai/core 1.0.212 → 1.0.213
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.
|
@@ -14,11 +14,13 @@ const typegoose_1 = require("@typegoose/typegoose");
|
|
|
14
14
|
const vendor_model_1 = require("./vendor.model");
|
|
15
15
|
const service_package_model_1 = require("./service-package.model");
|
|
16
16
|
const enum_1 = require("../../../utilities/enum");
|
|
17
|
+
const password_1 = require("../../../utilities/common/password");
|
|
17
18
|
let Professional = class Professional {
|
|
18
19
|
name;
|
|
19
20
|
image;
|
|
20
21
|
phoneNumber;
|
|
21
22
|
email;
|
|
23
|
+
password;
|
|
22
24
|
nationality;
|
|
23
25
|
vendor;
|
|
24
26
|
worksOn;
|
|
@@ -42,6 +44,10 @@ __decorate([
|
|
|
42
44
|
(0, typegoose_1.prop)({ required: true, unique: true }),
|
|
43
45
|
__metadata("design:type", String)
|
|
44
46
|
], Professional.prototype, "email", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typegoose_1.prop)({ type: String }),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], Professional.prototype, "password", void 0);
|
|
45
51
|
__decorate([
|
|
46
52
|
(0, typegoose_1.prop)(),
|
|
47
53
|
__metadata("design:type", String)
|
|
@@ -63,6 +69,12 @@ __decorate([
|
|
|
63
69
|
__metadata("design:type", String)
|
|
64
70
|
], Professional.prototype, "status", void 0);
|
|
65
71
|
exports.Professional = Professional = __decorate([
|
|
72
|
+
(0, typegoose_1.pre)('save', async function (next) {
|
|
73
|
+
if (this.isModified('password')) {
|
|
74
|
+
this.password = await (0, password_1.hashPassword)(this.password);
|
|
75
|
+
}
|
|
76
|
+
next();
|
|
77
|
+
}),
|
|
66
78
|
(0, typegoose_1.modelOptions)({ schemaOptions: { collection: 'professionals', timestamps: true } })
|
|
67
79
|
], Professional);
|
|
68
80
|
//# sourceMappingURL=professional.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"professional.model.js","sourceRoot":"/","sources":["libraries/mongo/models/professional.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"professional.model.js","sourceRoot":"/","sources":["libraries/mongo/models/professional.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoE;AACpE,iDAAwC;AACxC,mEAAyD;AACzD,kDAAqE;AACrE,iEAAkE;AAW3D,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEhB,IAAI,CAAU;IAGd,KAAK,CAAU;IAGf,WAAW,CAAU;IAGrB,KAAK,CAAU;IAGf,QAAQ,CAAU;IAGlB,WAAW,CAAU;IAGrB,MAAM,CAAe;IAGrB,OAAO,CAAyB;IAGhC,aAAa,CAAU;IAGvB,MAAM,CAAU;CACxB,CAAA;AA9BY,oCAAY;AAEhB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;0CAChB;AAGd;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACH;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;iDACX;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;2CACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CACE;AAGlB;IADN,IAAA,gBAAI,GAAE;;iDACqB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,qBAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CAChB;AAGrB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,sCAAc,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;6CACV;AAGhC;IADN,IAAA,gBAAI,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;mDACS;AAGvB;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAM,EAAE,OAAO,EAAE,aAAM,CAAC,MAAM,EAAE,CAAC;;4CACtD;uBA7BZ,YAAY;IARxB,IAAA,eAAG,EAAe,MAAM,EAAE,KAAK,WAAW,IAAI;QAC7C,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAChC,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAA,uBAAY,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACnD,CAAC;QACD,IAAI,EAAE,CAAA;IACR,CAAC,CAAC;IAED,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;GACtE,YAAY,CA8BxB","sourcesContent":["import { prop, Ref, modelOptions, pre } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { ServicePackage } from './service-package.model';\nimport { ProfessionalStatus, Status } from '../../../utilities/enum';\nimport { hashPassword } from '../../../utilities/common/password';\n\n\n@pre<Professional>('save', async function (next) {\n if (this.isModified('password')) {\n this.password = await hashPassword(this.password)\n }\n next()\n})\n\n@modelOptions({ schemaOptions: { collection: 'professionals', timestamps: true } })\nexport class Professional {\n @prop({ required: true, trim: true })\n public name!: string;\n\n @prop({ required: true })\n public image!: string;\n\n @prop({ required: true, unique: true })\n public phoneNumber!: string;\n\n @prop({ required: true, unique: true })\n public email!: string;\n\n @prop({ type: String })\n public password!: string;\n\n @prop()\n public nationality?: string;\n\n @prop({ ref: () => Vendor, required: true })\n public vendor!: Ref<Vendor>;\n\n @prop({ ref: () => ServicePackage, default: [] })\n public worksOn!: Ref<ServicePackage>[];\n\n @prop({ default: 0 })\n public averageRating?: number;\n\n @prop({ required: true, type: String, enum: Status, default: Status.ACTIVE })\n public status!: Status;\n}\n"]}
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED