@likewatt/models 1.139.0 → 1.141.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.
@@ -77,6 +77,9 @@ export declare class Consent {
77
77
  fraudReviewNote?: string;
78
78
  fraudReviewedBy?: string;
79
79
  fraudReviewedAt?: Date;
80
+ confirmationTokenHash?: string;
81
+ confirmationTokenExpiresAt?: Date;
82
+ acceptedAt?: Date;
80
83
  }
81
84
  export type ConsentDocument = Consent & Document;
82
85
  export declare const ConsentSchema: import("mongoose").Schema<Consent, import("mongoose").Model<Consent, any, any, any, Document<unknown, any, Consent, any, {}> & Consent & Required<{
@@ -384,6 +384,33 @@ __decorate([
384
384
  (0, class_validator_1.IsDate)(),
385
385
  __metadata("design:type", Date)
386
386
  ], Consent.prototype, "fraudReviewedAt", void 0);
387
+ __decorate([
388
+ (0, swagger_1.ApiPropertyOptional)({
389
+ description: 'Haché SHA-256 du jeton du lien de confirmation (jamais le jeton)',
390
+ }),
391
+ (0, mongoose_1.Prop)({ type: String, required: false }),
392
+ (0, class_validator_1.IsOptional)(),
393
+ (0, class_validator_1.IsString)(),
394
+ __metadata("design:type", String)
395
+ ], Consent.prototype, "confirmationTokenHash", void 0);
396
+ __decorate([
397
+ (0, swagger_1.ApiPropertyOptional)({
398
+ description: "Date d'expiration du lien de confirmation",
399
+ }),
400
+ (0, mongoose_1.Prop)({ type: Date, required: false }),
401
+ (0, class_validator_1.IsOptional)(),
402
+ (0, class_validator_1.IsDate)(),
403
+ __metadata("design:type", Date)
404
+ ], Consent.prototype, "confirmationTokenExpiresAt", void 0);
405
+ __decorate([
406
+ (0, swagger_1.ApiPropertyOptional)({
407
+ description: "Date d'acceptation par le client via le lien ; absente tant que la demande est en attente",
408
+ }),
409
+ (0, mongoose_1.Prop)({ type: Date, required: false }),
410
+ (0, class_validator_1.IsOptional)(),
411
+ (0, class_validator_1.IsDate)(),
412
+ __metadata("design:type", Date)
413
+ ], Consent.prototype, "acceptedAt", void 0);
387
414
  exports.Consent = Consent = __decorate([
388
415
  (0, mongoose_1.Schema)({
389
416
  id: false,
@@ -397,6 +424,9 @@ exports.ConsentSchema = mongoose_1.SchemaFactory.createForClass(Consent);
397
424
  exports.ConsentSchema.index({ workspaceId: 1, pdls: 1 });
398
425
  // Index pour la console admin de suivi anti-fraude (statut + récence)
399
426
  exports.ConsentSchema.index({ fraudReviewStatus: 1, createdAt: -1 });
427
+ // Un jeton de confirmation désigne une seule fiche ; sparse car la plupart des
428
+ // consentements (voie upload, anciens) n'en ont pas
429
+ exports.ConsentSchema.index({ confirmationTokenHash: 1 }, { unique: true, sparse: true });
400
430
  // Hook pre-save pour générer automatiquement un UUID si _id n'est pas fourni
401
431
  exports.ConsentSchema.pre('save', function (next) {
402
432
  if (!this._id) {
@@ -130,6 +130,7 @@ export declare class User {
130
130
  trackerOkd: boolean;
131
131
  auroraEnabled: boolean;
132
132
  auroraPilot?: boolean;
133
+ auroraDisabled?: boolean;
133
134
  auroraPartnerId?: string | null;
134
135
  auroraUserId?: string | null;
135
136
  isSignUpEmailSent: boolean;
package/dist/core/User.js CHANGED
@@ -615,6 +615,16 @@ __decorate([
615
615
  (0, class_validator_1.IsBoolean)(),
616
616
  __metadata("design:type", Boolean)
617
617
  ], User.prototype, "auroraPilot", void 0);
618
+ __decorate([
619
+ (0, swagger_1.ApiPropertyOptional)({
620
+ description: 'Module Aurora coupé par un admin Likewatt (switch « Module activé » sur OFF) : le titulaire et ses membres ne voient plus rien d’Aurora, et l’activation au clic ne peut pas le rétablir.',
621
+ example: false,
622
+ }),
623
+ (0, mongoose_1.Prop)({ type: Boolean, default: false }),
624
+ (0, class_validator_1.IsOptional)(),
625
+ (0, class_validator_1.IsBoolean)(),
626
+ __metadata("design:type", Boolean)
627
+ ], User.prototype, "auroraDisabled", void 0);
618
628
  __decorate([
619
629
  (0, swagger_1.ApiPropertyOptional)({
620
630
  description: 'Identifiant du Partner Aurora Solar de l’organisation (1 Partner par compte principal, clé = principalId). Posé sur le compte principal, provisionné paresseusement au premier usage Aurora, puis réutilisé. Garant de l’isolation multi-comptes (les projets sont scopés à ce partner_id).',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likewatt/models",
3
- "version": "1.139.0",
3
+ "version": "1.141.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {