@likewatt/models 1.76.0 → 1.78.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.
@@ -1,5 +1,4 @@
1
- import { Document, Types } from 'mongoose';
2
- import { User } from './User';
1
+ import { Document } from 'mongoose';
3
2
  /**
4
3
  * Représente un utilisateur dans le système.
5
4
  * - @Schema/timestamps : gère createdAt et updatedAt automatiques
@@ -8,11 +7,11 @@ import { User } from './User';
8
7
  * - class-validator rules : validation runtime
9
8
  */
10
9
  export declare class Consent {
11
- _id: Types.ObjectId;
10
+ readonly _id: string;
12
11
  companyName: string;
13
12
  contractConsent: boolean;
14
13
  courbeConsent: boolean;
15
- user: User;
14
+ userId: string;
16
15
  date?: Date;
17
16
  email: string;
18
17
  enedisNumber: string;
@@ -25,11 +24,11 @@ export declare class Consent {
25
24
  }
26
25
  export type ConsentDocument = Consent & Document;
27
26
  export declare const ConsentSchema: import("mongoose").Schema<Consent, import("mongoose").Model<Consent, any, any, any, Document<unknown, any, Consent, any, {}> & Consent & Required<{
28
- _id: Types.ObjectId;
27
+ _id: string;
29
28
  }> & {
30
29
  __v: number;
31
30
  }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Consent, Document<unknown, {}, import("mongoose").FlatRecord<Consent>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Consent> & Required<{
32
- _id: Types.ObjectId;
31
+ _id: string;
33
32
  }> & {
34
33
  __v: number;
35
34
  }>;
@@ -10,11 +10,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ConsentSchema = exports.Consent = void 0;
13
- const mongoose_1 = require("mongoose");
14
13
  const swagger_1 = require("@nestjs/swagger");
15
- const mongoose_2 = require("@nestjs/mongoose");
14
+ const mongoose_1 = require("@nestjs/mongoose");
16
15
  const class_validator_1 = require("class-validator");
17
- const User_1 = require("./User");
18
16
  /**
19
17
  * Représente un utilisateur dans le système.
20
18
  * - @Schema/timestamps : gère createdAt et updatedAt automatiques
@@ -27,19 +25,20 @@ let Consent = class Consent {
27
25
  exports.Consent = Consent;
28
26
  __decorate([
29
27
  (0, swagger_1.ApiProperty)({
30
- description: 'Identifiant unique MongoDB',
28
+ description: 'Identifiant unique (UUID ou custom string)',
31
29
  example: '2M61PGSm7lRpqXeaDacbAYOLTYG3',
32
- type: mongoose_1.Types.ObjectId,
30
+ type: String,
33
31
  readOnly: true,
34
32
  }),
35
- __metadata("design:type", mongoose_1.Types.ObjectId)
33
+ (0, mongoose_1.Prop)({ type: String }),
34
+ __metadata("design:type", String)
36
35
  ], Consent.prototype, "_id", void 0);
37
36
  __decorate([
38
37
  (0, swagger_1.ApiProperty)({
39
38
  description: 'Nom de l’entreprise',
40
39
  example: 'Example Company',
41
40
  }),
42
- (0, mongoose_2.Prop)({ type: String, required: true }),
41
+ (0, mongoose_1.Prop)({ type: String, required: true }),
43
42
  (0, class_validator_1.IsString)(),
44
43
  __metadata("design:type", String)
45
44
  ], Consent.prototype, "companyName", void 0);
@@ -48,7 +47,7 @@ __decorate([
48
47
  description: 'Consentement pour le contrat',
49
48
  example: true,
50
49
  }),
51
- (0, mongoose_2.Prop)({ type: Boolean, required: false, default: false }),
50
+ (0, mongoose_1.Prop)({ type: Boolean, required: false, default: false }),
52
51
  (0, class_validator_1.IsOptional)(),
53
52
  (0, class_validator_1.IsBoolean)(),
54
53
  __metadata("design:type", Boolean)
@@ -58,26 +57,26 @@ __decorate([
58
57
  description: 'Consentement pour la courbe de charge',
59
58
  example: true,
60
59
  }),
61
- (0, mongoose_2.Prop)({ type: Boolean, required: false, default: false }),
60
+ (0, mongoose_1.Prop)({ type: Boolean, required: false, default: false }),
62
61
  (0, class_validator_1.IsOptional)(),
63
62
  (0, class_validator_1.IsBoolean)(),
64
63
  __metadata("design:type", Boolean)
65
64
  ], Consent.prototype, "courbeConsent", void 0);
66
65
  __decorate([
67
66
  (0, swagger_1.ApiProperty)({
68
- description: 'Client associé au consentement',
69
- example: 'user@example.com',
67
+ description: 'Id du client associé au consentement',
68
+ example: 'xsv1Le1531vreUHGIUfrv',
70
69
  }),
71
- (0, mongoose_2.Prop)({ type: String, required: true }),
72
- (0, class_validator_1.IsObject)(),
73
- __metadata("design:type", User_1.User)
74
- ], Consent.prototype, "user", void 0);
70
+ (0, mongoose_1.Prop)({ type: String, required: true }),
71
+ (0, class_validator_1.IsString)(),
72
+ __metadata("design:type", String)
73
+ ], Consent.prototype, "userId", void 0);
75
74
  __decorate([
76
75
  (0, swagger_1.ApiProperty)({
77
76
  description: 'Date du consentement',
78
77
  example: '2023-01-01T00:00:00Z',
79
78
  }),
80
- (0, mongoose_2.Prop)({ type: Date, required: false }),
79
+ (0, mongoose_1.Prop)({ type: Date, required: false }),
81
80
  (0, class_validator_1.IsOptional)(),
82
81
  __metadata("design:type", Date)
83
82
  ], Consent.prototype, "date", void 0);
@@ -86,7 +85,7 @@ __decorate([
86
85
  description: 'Adresse e-mail de l’utilisateur',
87
86
  example: 'user@example.com',
88
87
  }),
89
- (0, mongoose_2.Prop)({ type: String, required: true }),
88
+ (0, mongoose_1.Prop)({ type: String, required: true }),
90
89
  (0, class_validator_1.IsString)(),
91
90
  __metadata("design:type", String)
92
91
  ], Consent.prototype, "email", void 0);
@@ -95,7 +94,7 @@ __decorate([
95
94
  description: 'Buffer Enedis',
96
95
  example: 'https://example.com/logo.png',
97
96
  }),
98
- (0, mongoose_2.Prop)({ type: String, required: true }),
97
+ (0, mongoose_1.Prop)({ type: String, required: true }),
99
98
  (0, class_validator_1.IsString)(),
100
99
  __metadata("design:type", String)
101
100
  ], Consent.prototype, "enedisNumber", void 0);
@@ -104,7 +103,7 @@ __decorate([
104
103
  description: 'Prénom de l’utilisateur',
105
104
  example: 'https://example.com/logo.png',
106
105
  }),
107
- (0, mongoose_2.Prop)({ type: String, required: true }),
106
+ (0, mongoose_1.Prop)({ type: String, required: true }),
108
107
  (0, class_validator_1.IsString)(),
109
108
  __metadata("design:type", String)
110
109
  ], Consent.prototype, "firstname", void 0);
@@ -113,7 +112,7 @@ __decorate([
113
112
  description: 'Consentement pour l’indexation',
114
113
  example: false,
115
114
  }),
116
- (0, mongoose_2.Prop)({ type: Boolean, required: false, default: false }),
115
+ (0, mongoose_1.Prop)({ type: Boolean, required: false, default: false }),
117
116
  (0, class_validator_1.IsOptional)(),
118
117
  (0, class_validator_1.IsBoolean)(),
119
118
  __metadata("design:type", Boolean)
@@ -123,7 +122,7 @@ __decorate([
123
122
  description: 'Nom de l’utilisateur',
124
123
  example: 'https://example.com/logo.png',
125
124
  }),
126
- (0, mongoose_2.Prop)({ type: String, required: true }),
125
+ (0, mongoose_1.Prop)({ type: String, required: true }),
127
126
  (0, class_validator_1.IsString)(),
128
127
  __metadata("design:type", String)
129
128
  ], Consent.prototype, "lastname", void 0);
@@ -132,7 +131,7 @@ __decorate([
132
131
  description: 'Logo utilisateur',
133
132
  example: 'https://example.com/logo.png',
134
133
  }),
135
- (0, mongoose_2.Prop)({ type: String, required: false }),
134
+ (0, mongoose_1.Prop)({ type: String, required: false }),
136
135
  (0, class_validator_1.IsOptional)(),
137
136
  (0, class_validator_1.IsString)(),
138
137
  __metadata("design:type", String)
@@ -142,7 +141,7 @@ __decorate([
142
141
  description: 'Consentement pour la mesure d’audience',
143
142
  example: true,
144
143
  }),
145
- (0, mongoose_2.Prop)({ type: Boolean, required: false, default: false }),
144
+ (0, mongoose_1.Prop)({ type: Boolean, required: false, default: false }),
146
145
  (0, class_validator_1.IsOptional)(),
147
146
  (0, class_validator_1.IsBoolean)(),
148
147
  __metadata("design:type", Boolean)
@@ -152,16 +151,16 @@ __decorate([
152
151
  description: 'Identifiant du site',
153
152
  example: 'site-12345',
154
153
  }),
155
- (0, mongoose_2.Prop)({ type: String, required: true }),
154
+ (0, mongoose_1.Prop)({ type: String, required: true }),
156
155
  (0, class_validator_1.IsString)(),
157
156
  __metadata("design:type", String)
158
157
  ], Consent.prototype, "siteId", void 0);
159
158
  exports.Consent = Consent = __decorate([
160
- (0, mongoose_2.Schema)({
159
+ (0, mongoose_1.Schema)({
161
160
  id: false,
162
161
  timestamps: true,
163
162
  toJSON: { virtuals: true, versionKey: false },
164
163
  toObject: { virtuals: true, versionKey: false },
165
164
  })
166
165
  ], Consent);
167
- exports.ConsentSchema = mongoose_2.SchemaFactory.createForClass(Consent);
166
+ exports.ConsentSchema = mongoose_1.SchemaFactory.createForClass(Consent);
@@ -682,7 +682,10 @@ __decorate([
682
682
  __metadata("design:type", Boolean)
683
683
  ], ScenarioType.prototype, "isLeads", void 0);
684
684
  __decorate([
685
- (0, swagger_1.ApiPropertyOptional)({ example: 0, description: 'Ordre du scénario leads (drag & drop)' }),
685
+ (0, swagger_1.ApiPropertyOptional)({
686
+ example: 0,
687
+ description: 'Ordre du scénario leads (drag & drop)',
688
+ }),
686
689
  (0, mongoose_1.Prop)({ type: Number, required: false }),
687
690
  (0, class_validator_1.IsOptional)(),
688
691
  (0, class_validator_1.IsNumber)(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likewatt/models",
3
- "version": "1.76.0",
3
+ "version": "1.78.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {