@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.
@@ -7,6 +7,7 @@ export declare class Professional {
7
7
  image: string;
8
8
  phoneNumber: string;
9
9
  email: string;
10
+ password: string;
10
11
  nationality?: string;
11
12
  vendor: Ref<Vendor>;
12
13
  worksOn: Ref<ServicePackage>[];
@@ -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,oDAA+D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E,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;GACtE,YAAY,CA4BxB","sourcesContent":["import { prop, Ref, modelOptions } from '@typegoose/typegoose';\nimport { Vendor } from './vendor.model';\nimport { ServicePackage } from './service-package.model';\nimport { ProfessionalStatus, Status } from '../../../utilities/enum';\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()\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}\n"]}
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,gBAA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';\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"]}
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.0.212
25
+ Version: 1.0.213
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.0.212",
3
+ "version": "1.0.213",
4
4
  "description": "Lyxa type definitions and validation schemas for both frontend and backend",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.0.212",
3
+ "version": "1.0.213",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",