@likewatt/models 1.102.0 → 1.103.1

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.
@@ -8,20 +8,30 @@ import { Document } from 'mongoose';
8
8
  */
9
9
  export declare class Consent {
10
10
  readonly _id: string;
11
- companyName: string;
11
+ companyName?: string;
12
12
  contractConsent: boolean;
13
13
  courbeConsent: boolean;
14
14
  userId: string;
15
15
  workspaceId?: string;
16
- date?: Date;
17
- email: string;
18
- enedisNumber: string;
19
- firstname: string;
16
+ date?: Date | string;
17
+ email?: string;
18
+ enedisNumber?: string;
19
+ firstname?: string;
20
20
  indexConsent: boolean;
21
- lastname: string;
21
+ lastname?: string;
22
22
  logo?: string;
23
23
  mesureConsent: boolean;
24
24
  siteId: string;
25
+ pdls?: string[];
26
+ collectiveSiteId?: string;
27
+ fileKey?: string;
28
+ via?: 'email' | 'upload';
29
+ isValidateConsent?: boolean;
30
+ dateConsentCheck?: Date;
31
+ pdlNotCovered?: boolean;
32
+ identityMismatch?: boolean;
33
+ forged?: boolean;
34
+ flagReason?: string;
25
35
  }
26
36
  export type ConsentDocument = Consent & Document;
27
37
  export declare const ConsentSchema: import("mongoose").Schema<Consent, import("mongoose").Model<Consent, any, any, any, Document<unknown, any, Consent, any, {}> & Consent & Required<{
@@ -39,7 +39,8 @@ __decorate([
39
39
  description: 'Nom de l’entreprise',
40
40
  example: 'Example Company',
41
41
  }),
42
- (0, mongoose_1.Prop)({ type: String, required: true }),
42
+ (0, mongoose_1.Prop)({ type: String, required: false }),
43
+ (0, class_validator_1.IsOptional)(),
43
44
  (0, class_validator_1.IsString)(),
44
45
  __metadata("design:type", String)
45
46
  ], Consent.prototype, "companyName", void 0);
@@ -88,14 +89,15 @@ __decorate([
88
89
  }),
89
90
  (0, mongoose_1.Prop)({ type: Date, required: false }),
90
91
  (0, class_validator_1.IsOptional)(),
91
- __metadata("design:type", Date)
92
+ __metadata("design:type", Object)
92
93
  ], Consent.prototype, "date", void 0);
93
94
  __decorate([
94
95
  (0, swagger_1.ApiProperty)({
95
96
  description: 'Adresse e-mail de l’utilisateur',
96
97
  example: 'user@example.com',
97
98
  }),
98
- (0, mongoose_1.Prop)({ type: String, required: true }),
99
+ (0, mongoose_1.Prop)({ type: String, required: false }),
100
+ (0, class_validator_1.IsOptional)(),
99
101
  (0, class_validator_1.IsString)(),
100
102
  __metadata("design:type", String)
101
103
  ], Consent.prototype, "email", void 0);
@@ -104,7 +106,8 @@ __decorate([
104
106
  description: 'Buffer Enedis',
105
107
  example: 'https://example.com/logo.png',
106
108
  }),
107
- (0, mongoose_1.Prop)({ type: String, required: true }),
109
+ (0, mongoose_1.Prop)({ type: String, required: false }),
110
+ (0, class_validator_1.IsOptional)(),
108
111
  (0, class_validator_1.IsString)(),
109
112
  __metadata("design:type", String)
110
113
  ], Consent.prototype, "enedisNumber", void 0);
@@ -113,7 +116,8 @@ __decorate([
113
116
  description: 'Prénom de l’utilisateur',
114
117
  example: 'https://example.com/logo.png',
115
118
  }),
116
- (0, mongoose_1.Prop)({ type: String, required: true }),
119
+ (0, mongoose_1.Prop)({ type: String, required: false }),
120
+ (0, class_validator_1.IsOptional)(),
117
121
  (0, class_validator_1.IsString)(),
118
122
  __metadata("design:type", String)
119
123
  ], Consent.prototype, "firstname", void 0);
@@ -132,7 +136,8 @@ __decorate([
132
136
  description: 'Nom de l’utilisateur',
133
137
  example: 'https://example.com/logo.png',
134
138
  }),
135
- (0, mongoose_1.Prop)({ type: String, required: true }),
139
+ (0, mongoose_1.Prop)({ type: String, required: false }),
140
+ (0, class_validator_1.IsOptional)(),
136
141
  (0, class_validator_1.IsString)(),
137
142
  __metadata("design:type", String)
138
143
  ], Consent.prototype, "lastname", void 0);
@@ -165,6 +170,92 @@ __decorate([
165
170
  (0, class_validator_1.IsString)(),
166
171
  __metadata("design:type", String)
167
172
  ], Consent.prototype, "siteId", void 0);
173
+ __decorate([
174
+ (0, swagger_1.ApiPropertyOptional)({
175
+ description: 'PDL couverts par le document (ACI: 1, ACC: N)',
176
+ type: [String],
177
+ }),
178
+ (0, mongoose_1.Prop)({ type: [String], default: [] }),
179
+ (0, class_validator_1.IsOptional)(),
180
+ (0, class_validator_1.IsArray)(),
181
+ (0, class_validator_1.IsString)({ each: true }),
182
+ __metadata("design:type", Array)
183
+ ], Consent.prototype, "pdls", void 0);
184
+ __decorate([
185
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Projet collectif couvert (cas ACC)' }),
186
+ (0, mongoose_1.Prop)({ type: String, ref: 'CollectiveSite', required: false }),
187
+ (0, class_validator_1.IsOptional)(),
188
+ (0, class_validator_1.IsString)(),
189
+ __metadata("design:type", String)
190
+ ], Consent.prototype, "collectiveSiteId", void 0);
191
+ __decorate([
192
+ (0, swagger_1.ApiPropertyOptional)({
193
+ description: 'Clé du fichier de consentement (voie upload)',
194
+ }),
195
+ (0, mongoose_1.Prop)({ type: String, required: false }),
196
+ (0, class_validator_1.IsOptional)(),
197
+ (0, class_validator_1.IsString)(),
198
+ __metadata("design:type", String)
199
+ ], Consent.prototype, "fileKey", void 0);
200
+ __decorate([
201
+ (0, swagger_1.ApiPropertyOptional)({
202
+ description: "Voie d'obtention du consentement",
203
+ enum: ['email', 'upload'],
204
+ }),
205
+ (0, mongoose_1.Prop)({ type: String, enum: ['email', 'upload'], required: false }),
206
+ (0, class_validator_1.IsOptional)(),
207
+ (0, class_validator_1.IsString)(),
208
+ __metadata("design:type", String)
209
+ ], Consent.prototype, "via", void 0);
210
+ __decorate([
211
+ (0, swagger_1.ApiPropertyOptional)({
212
+ description: 'Statut de validation du consentement (révisable en admin)',
213
+ }),
214
+ (0, mongoose_1.Prop)({ type: Boolean, required: false }),
215
+ (0, class_validator_1.IsOptional)(),
216
+ (0, class_validator_1.IsBoolean)(),
217
+ __metadata("design:type", Boolean)
218
+ ], Consent.prototype, "isValidateConsent", void 0);
219
+ __decorate([
220
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Date du contrôle OCR/IA' }),
221
+ (0, mongoose_1.Prop)({ type: Date, required: false }),
222
+ (0, class_validator_1.IsOptional)(),
223
+ __metadata("design:type", Date)
224
+ ], Consent.prototype, "dateConsentCheck", void 0);
225
+ __decorate([
226
+ (0, swagger_1.ApiPropertyOptional)({
227
+ description: 'Signal : PDL du site absent du document',
228
+ }),
229
+ (0, mongoose_1.Prop)({ type: Boolean, default: false }),
230
+ (0, class_validator_1.IsOptional)(),
231
+ (0, class_validator_1.IsBoolean)(),
232
+ __metadata("design:type", Boolean)
233
+ ], Consent.prototype, "pdlNotCovered", void 0);
234
+ __decorate([
235
+ (0, swagger_1.ApiPropertyOptional)({
236
+ description: 'Signal : même PDL déjà consenti dans le groupe avec une identité différente',
237
+ }),
238
+ (0, mongoose_1.Prop)({ type: Boolean, default: false }),
239
+ (0, class_validator_1.IsOptional)(),
240
+ (0, class_validator_1.IsBoolean)(),
241
+ __metadata("design:type", Boolean)
242
+ ], Consent.prototype, "identityMismatch", void 0);
243
+ __decorate([
244
+ (0, swagger_1.ApiPropertyOptional)({
245
+ description: 'Signal : document suspecté falsifié (réservé v2)',
246
+ }),
247
+ (0, mongoose_1.Prop)({ type: Boolean, default: false }),
248
+ (0, class_validator_1.IsOptional)(),
249
+ (0, class_validator_1.IsBoolean)(),
250
+ __metadata("design:type", Boolean)
251
+ ], Consent.prototype, "forged", void 0);
252
+ __decorate([
253
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Motif lisible du flag (suivi admin)' }),
254
+ (0, mongoose_1.Prop)({ type: String, required: false }),
255
+ (0, class_validator_1.IsOptional)(),
256
+ (0, class_validator_1.IsString)(),
257
+ __metadata("design:type", String)
258
+ ], Consent.prototype, "flagReason", void 0);
168
259
  exports.Consent = Consent = __decorate([
169
260
  (0, mongoose_1.Schema)({
170
261
  id: false,
@@ -90,6 +90,7 @@ export declare class Site {
90
90
  co2rate?: number | null;
91
91
  connectingPower: number;
92
92
  consentFileUrl?: string;
93
+ consentId?: string;
93
94
  isValidateConsent?: boolean;
94
95
  dateConsentCheck?: Date | string;
95
96
  consumptionIndexes: number[][];
package/dist/core/Site.js CHANGED
@@ -399,6 +399,15 @@ __decorate([
399
399
  (0, class_validator_1.IsString)(),
400
400
  __metadata("design:type", String)
401
401
  ], Site.prototype, "consentFileUrl", void 0);
402
+ __decorate([
403
+ (0, swagger_1.ApiPropertyOptional)({
404
+ description: 'Consent couvrant ce site (registre doc-centric)',
405
+ }),
406
+ (0, mongoose_1.Prop)({ type: String, ref: 'Consent', required: false }),
407
+ (0, class_validator_1.IsOptional)(),
408
+ (0, class_validator_1.IsString)(),
409
+ __metadata("design:type", String)
410
+ ], Site.prototype, "consentId", void 0);
402
411
  __decorate([
403
412
  (0, swagger_1.ApiPropertyOptional)(),
404
413
  (0, mongoose_1.Prop)({ type: Boolean, required: false }),
@@ -106,6 +106,7 @@ export declare class User {
106
106
  addressCity?: string;
107
107
  addressZipCode?: string;
108
108
  isAdmin: boolean;
109
+ consentDomainCheckDisabled?: boolean;
109
110
  isRenewalEmailSent: boolean;
110
111
  active: boolean;
111
112
  demo: boolean;
package/dist/core/User.js CHANGED
@@ -378,6 +378,16 @@ __decorate([
378
378
  (0, class_validator_1.IsBoolean)(),
379
379
  __metadata("design:type", Boolean)
380
380
  ], User.prototype, "isAdmin", void 0);
381
+ __decorate([
382
+ (0, swagger_1.ApiProperty)({
383
+ description: 'Désactive le contrôle anti self-consent (même domaine email) pour cet utilisateur',
384
+ example: false,
385
+ }),
386
+ (0, mongoose_1.Prop)({ type: Boolean, default: false }),
387
+ (0, class_validator_1.IsOptional)(),
388
+ (0, class_validator_1.IsBoolean)(),
389
+ __metadata("design:type", Boolean)
390
+ ], User.prototype, "consentDomainCheckDisabled", void 0);
381
391
  __decorate([
382
392
  (0, swagger_1.ApiProperty)({
383
393
  description: 'E-mail de renouvellement envoyé',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likewatt/models",
3
- "version": "1.102.0",
3
+ "version": "1.103.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {