@likewatt/models 1.57.6 → 1.58.0

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.
@@ -677,7 +677,11 @@ __decorate([
677
677
  __metadata("design:type", Boolean)
678
678
  ], ScenarioType.prototype, "isLeads", void 0);
679
679
  exports.ScenarioType = ScenarioType = __decorate([
680
- (0, mongoose_1.Schema)()
680
+ (0, mongoose_1.Schema)({
681
+ timestamps: true,
682
+ toJSON: { virtuals: true, versionKey: false },
683
+ toObject: { virtuals: true, versionKey: false },
684
+ })
681
685
  ], ScenarioType);
682
686
  exports.ScenarioTypeSchema = mongoose_1.SchemaFactory.createForClass(ScenarioType);
683
687
  // Hook pre-save pour générer automatiquement un UUID si _id n'est pas fourni
@@ -21,6 +21,7 @@ export declare const SiteTagSchema: import("mongoose").Schema<SiteTag, import("m
21
21
  export declare class Rights {
22
22
  deleteSite: boolean;
23
23
  deleteSites: boolean;
24
+ viewLeads: boolean;
24
25
  }
25
26
  export declare const RightsSchema: import("mongoose").Schema<Rights, import("mongoose").Model<Rights, any, any, any, Document<unknown, any, Rights, any, {}> & Rights & {
26
27
  _id: import("mongoose").Types.ObjectId;
package/dist/core/User.js CHANGED
@@ -66,6 +66,15 @@ __decorate([
66
66
  (0, class_validator_1.IsBoolean)(),
67
67
  __metadata("design:type", Boolean)
68
68
  ], Rights.prototype, "deleteSites", void 0);
69
+ __decorate([
70
+ (0, swagger_1.ApiProperty)({
71
+ description: "Indique si l'utilisateur peut voir les projets et scénarios Leads",
72
+ example: true,
73
+ }),
74
+ (0, mongoose_1.Prop)({ type: Boolean, required: true, default: false }),
75
+ (0, class_validator_1.IsBoolean)(),
76
+ __metadata("design:type", Boolean)
77
+ ], Rights.prototype, "viewLeads", void 0);
69
78
  exports.Rights = Rights = __decorate([
70
79
  (0, mongoose_1.Schema)({ _id: false })
71
80
  ], Rights);
@@ -608,7 +617,7 @@ __decorate([
608
617
  (0, mongoose_1.Prop)({
609
618
  type: exports.RightsSchema,
610
619
  _id: false,
611
- default: { deleteSite: false, deleteSites: false },
620
+ default: { deleteSite: false, deleteSites: false, viewLeads: false },
612
621
  }),
613
622
  __metadata("design:type", Rights)
614
623
  ], User.prototype, "rights", void 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likewatt/models",
3
- "version": "1.57.6",
3
+ "version": "1.58.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {