@likewatt/models 1.1.16 → 1.1.17
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.
- package/dist/core/Consent.d.ts +35 -0
- package/dist/core/Consent.js +171 -0
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Document, Types } from 'mongoose';
|
|
2
|
+
/**
|
|
3
|
+
* Représente un utilisateur dans le système.
|
|
4
|
+
* - @Schema/timestamps : gère createdAt et updatedAt automatiques
|
|
5
|
+
* - @Prop : schéma Mongoose
|
|
6
|
+
* - @ApiProperty : documentation Swagger
|
|
7
|
+
* - class-validator rules : validation runtime
|
|
8
|
+
*/
|
|
9
|
+
export declare class Consent {
|
|
10
|
+
_id: Types.ObjectId;
|
|
11
|
+
_createdAt: Date;
|
|
12
|
+
companyName: string;
|
|
13
|
+
contractConsent: boolean;
|
|
14
|
+
courbeConsent: boolean;
|
|
15
|
+
customer?: string;
|
|
16
|
+
date?: Date;
|
|
17
|
+
email: string;
|
|
18
|
+
enedisNumber: string;
|
|
19
|
+
firstname: string;
|
|
20
|
+
indexConsent: boolean;
|
|
21
|
+
lastname: string;
|
|
22
|
+
logo?: string;
|
|
23
|
+
mesureConsent: boolean;
|
|
24
|
+
siteId: string;
|
|
25
|
+
}
|
|
26
|
+
export type ConsentDocument = Consent & Document;
|
|
27
|
+
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;
|
|
29
|
+
}> & {
|
|
30
|
+
__v: number;
|
|
31
|
+
}, 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;
|
|
33
|
+
}> & {
|
|
34
|
+
__v: number;
|
|
35
|
+
}>;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ConsentSchema = exports.Consent = void 0;
|
|
13
|
+
const mongoose_1 = require("mongoose");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const mongoose_2 = require("@nestjs/mongoose");
|
|
16
|
+
const class_validator_1 = require("class-validator");
|
|
17
|
+
/**
|
|
18
|
+
* Représente un utilisateur dans le système.
|
|
19
|
+
* - @Schema/timestamps : gère createdAt et updatedAt automatiques
|
|
20
|
+
* - @Prop : schéma Mongoose
|
|
21
|
+
* - @ApiProperty : documentation Swagger
|
|
22
|
+
* - class-validator rules : validation runtime
|
|
23
|
+
*/
|
|
24
|
+
let Consent = class Consent {
|
|
25
|
+
};
|
|
26
|
+
exports.Consent = Consent;
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, swagger_1.ApiProperty)({
|
|
29
|
+
description: 'Identifiant unique MongoDB',
|
|
30
|
+
example: '2M61PGSm7lRpqXeaDacbAYOLTYG3',
|
|
31
|
+
type: mongoose_1.Types.ObjectId,
|
|
32
|
+
readOnly: true,
|
|
33
|
+
}),
|
|
34
|
+
__metadata("design:type", mongoose_1.Types.ObjectId)
|
|
35
|
+
], Consent.prototype, "_id", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, swagger_1.ApiProperty)({
|
|
38
|
+
description: 'Date de début de la licence',
|
|
39
|
+
example: '2023-01-01T00:00:00Z',
|
|
40
|
+
}),
|
|
41
|
+
(0, mongoose_2.Prop)({ type: Date, required: true }),
|
|
42
|
+
(0, class_validator_1.IsDate)(),
|
|
43
|
+
__metadata("design:type", Date)
|
|
44
|
+
], Consent.prototype, "_createdAt", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, swagger_1.ApiProperty)({
|
|
47
|
+
description: 'Nom de l’entreprise',
|
|
48
|
+
example: 'Example Company',
|
|
49
|
+
}),
|
|
50
|
+
(0, mongoose_2.Prop)({ type: String, required: true }),
|
|
51
|
+
(0, class_validator_1.IsString)(),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], Consent.prototype, "companyName", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, swagger_1.ApiProperty)({
|
|
56
|
+
description: 'Consentement pour le contrat',
|
|
57
|
+
example: true,
|
|
58
|
+
}),
|
|
59
|
+
(0, mongoose_2.Prop)({ type: Boolean, required: true, default: false }),
|
|
60
|
+
(0, class_validator_1.IsBoolean)(),
|
|
61
|
+
__metadata("design:type", Boolean)
|
|
62
|
+
], Consent.prototype, "contractConsent", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, swagger_1.ApiProperty)({
|
|
65
|
+
description: 'Consentement pour la courbe de charge',
|
|
66
|
+
example: true,
|
|
67
|
+
}),
|
|
68
|
+
(0, mongoose_2.Prop)({ type: Boolean, required: true, default: false }),
|
|
69
|
+
(0, class_validator_1.IsBoolean)(),
|
|
70
|
+
__metadata("design:type", Boolean)
|
|
71
|
+
], Consent.prototype, "courbeConsent", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, swagger_1.ApiProperty)({
|
|
74
|
+
description: 'Client associé au consentement',
|
|
75
|
+
example: 'user@example.com',
|
|
76
|
+
}),
|
|
77
|
+
(0, mongoose_2.Prop)({ type: String, required: false }),
|
|
78
|
+
(0, class_validator_1.IsOptional)(),
|
|
79
|
+
(0, class_validator_1.IsString)(),
|
|
80
|
+
__metadata("design:type", String)
|
|
81
|
+
], Consent.prototype, "customer", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, swagger_1.ApiProperty)({
|
|
84
|
+
description: 'Date du consentement',
|
|
85
|
+
example: '2023-01-01T00:00:00Z',
|
|
86
|
+
}),
|
|
87
|
+
(0, mongoose_2.Prop)({ type: Date, required: false }),
|
|
88
|
+
(0, class_validator_1.IsOptional)(),
|
|
89
|
+
(0, class_validator_1.IsDate)(),
|
|
90
|
+
__metadata("design:type", Date)
|
|
91
|
+
], Consent.prototype, "date", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, swagger_1.ApiProperty)({
|
|
94
|
+
description: 'Adresse e-mail de l’utilisateur',
|
|
95
|
+
example: 'user@example.com',
|
|
96
|
+
}),
|
|
97
|
+
(0, mongoose_2.Prop)({ type: String, required: true }),
|
|
98
|
+
(0, class_validator_1.IsString)(),
|
|
99
|
+
__metadata("design:type", String)
|
|
100
|
+
], Consent.prototype, "email", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, swagger_1.ApiProperty)({
|
|
103
|
+
description: 'Buffer Enedis',
|
|
104
|
+
example: 'https://example.com/logo.png',
|
|
105
|
+
}),
|
|
106
|
+
(0, mongoose_2.Prop)({ type: String, required: true }),
|
|
107
|
+
(0, class_validator_1.IsString)(),
|
|
108
|
+
__metadata("design:type", String)
|
|
109
|
+
], Consent.prototype, "enedisNumber", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, swagger_1.ApiProperty)({
|
|
112
|
+
description: 'Prénom de l’utilisateur',
|
|
113
|
+
example: 'https://example.com/logo.png',
|
|
114
|
+
}),
|
|
115
|
+
(0, mongoose_2.Prop)({ type: String, required: true }),
|
|
116
|
+
(0, class_validator_1.IsString)(),
|
|
117
|
+
__metadata("design:type", String)
|
|
118
|
+
], Consent.prototype, "firstname", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
(0, swagger_1.ApiProperty)({
|
|
121
|
+
description: 'Consentement pour l’indexation',
|
|
122
|
+
example: false,
|
|
123
|
+
}),
|
|
124
|
+
(0, mongoose_2.Prop)({ type: Boolean, required: true, default: false }),
|
|
125
|
+
(0, class_validator_1.IsBoolean)(),
|
|
126
|
+
__metadata("design:type", Boolean)
|
|
127
|
+
], Consent.prototype, "indexConsent", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
(0, swagger_1.ApiProperty)({
|
|
130
|
+
description: 'Nom de l’utilisateur',
|
|
131
|
+
example: 'https://example.com/logo.png',
|
|
132
|
+
}),
|
|
133
|
+
(0, mongoose_2.Prop)({ type: String, required: true }),
|
|
134
|
+
(0, class_validator_1.IsString)(),
|
|
135
|
+
__metadata("design:type", String)
|
|
136
|
+
], Consent.prototype, "lastname", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, swagger_1.ApiProperty)({
|
|
139
|
+
description: 'Logo utilisateur',
|
|
140
|
+
example: 'https://example.com/logo.png',
|
|
141
|
+
}),
|
|
142
|
+
(0, mongoose_2.Prop)({ type: String, required: false }),
|
|
143
|
+
(0, class_validator_1.IsOptional)(),
|
|
144
|
+
(0, class_validator_1.IsString)(),
|
|
145
|
+
__metadata("design:type", String)
|
|
146
|
+
], Consent.prototype, "logo", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
(0, swagger_1.ApiProperty)({
|
|
149
|
+
description: 'Consentement pour la mesure d’audience',
|
|
150
|
+
example: true,
|
|
151
|
+
}),
|
|
152
|
+
(0, mongoose_2.Prop)({ type: Boolean, required: true, default: false }),
|
|
153
|
+
(0, class_validator_1.IsBoolean)(),
|
|
154
|
+
__metadata("design:type", Boolean)
|
|
155
|
+
], Consent.prototype, "mesureConsent", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
(0, swagger_1.ApiProperty)({
|
|
158
|
+
description: 'Identifiant du site',
|
|
159
|
+
example: 'site-12345',
|
|
160
|
+
}),
|
|
161
|
+
(0, mongoose_2.Prop)({ type: String, required: true }),
|
|
162
|
+
(0, class_validator_1.IsString)(),
|
|
163
|
+
__metadata("design:type", String)
|
|
164
|
+
], Consent.prototype, "siteId", void 0);
|
|
165
|
+
exports.Consent = Consent = __decorate([
|
|
166
|
+
(0, mongoose_2.Schema)({
|
|
167
|
+
id: false,
|
|
168
|
+
timestamps: true,
|
|
169
|
+
})
|
|
170
|
+
], Consent);
|
|
171
|
+
exports.ConsentSchema = mongoose_2.SchemaFactory.createForClass(Consent);
|