@likewatt/models 1.0.69 → 1.0.71
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/License.d.ts +30 -0
- package/dist/core/License.js +129 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { 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 License {
|
|
10
|
+
_id: Types.ObjectId;
|
|
11
|
+
license?: string;
|
|
12
|
+
domain?: boolean;
|
|
13
|
+
startDate: Date;
|
|
14
|
+
endDate: Date;
|
|
15
|
+
maxUsers?: number;
|
|
16
|
+
maxSite?: number;
|
|
17
|
+
trackerOkd: boolean;
|
|
18
|
+
acc?: boolean;
|
|
19
|
+
userId?: string;
|
|
20
|
+
}
|
|
21
|
+
export type LicenseDocument = License & Document;
|
|
22
|
+
export declare const LicenseSchema: import("mongoose").Schema<License, import("mongoose").Model<License, any, any, any, import("mongoose").Document<unknown, any, License, any, {}> & License & Required<{
|
|
23
|
+
_id: Types.ObjectId;
|
|
24
|
+
}> & {
|
|
25
|
+
__v: number;
|
|
26
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, License, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<License>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<License> & Required<{
|
|
27
|
+
_id: Types.ObjectId;
|
|
28
|
+
}> & {
|
|
29
|
+
__v: number;
|
|
30
|
+
}>;
|
|
@@ -0,0 +1,129 @@
|
|
|
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.LicenseSchema = exports.License = 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 License = class License {
|
|
25
|
+
};
|
|
26
|
+
exports.License = License;
|
|
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
|
+
], License.prototype, "_id", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, swagger_1.ApiProperty)({
|
|
38
|
+
description: 'Licence utilisateur',
|
|
39
|
+
example: 'Standard',
|
|
40
|
+
}),
|
|
41
|
+
(0, mongoose_2.Prop)({ type: String, required: false }),
|
|
42
|
+
(0, class_validator_1.IsOptional)(),
|
|
43
|
+
(0, class_validator_1.IsString)(),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], License.prototype, "license", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, swagger_1.ApiProperty)({
|
|
48
|
+
description: 'Domaine d’activité',
|
|
49
|
+
example: true,
|
|
50
|
+
}),
|
|
51
|
+
(0, mongoose_2.Prop)({ type: Boolean, required: true, default: false }),
|
|
52
|
+
(0, class_validator_1.IsOptional)(),
|
|
53
|
+
(0, class_validator_1.IsBoolean)(),
|
|
54
|
+
__metadata("design:type", Boolean)
|
|
55
|
+
], License.prototype, "domain", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, swagger_1.ApiProperty)({
|
|
58
|
+
description: 'Date de début de la licence',
|
|
59
|
+
example: '2023-01-01T00:00:00Z',
|
|
60
|
+
}),
|
|
61
|
+
(0, mongoose_2.Prop)({ type: Date, required: true }),
|
|
62
|
+
(0, class_validator_1.IsDate)(),
|
|
63
|
+
__metadata("design:type", Date)
|
|
64
|
+
], License.prototype, "startDate", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, swagger_1.ApiProperty)({
|
|
67
|
+
description: 'Date de fin de la licence',
|
|
68
|
+
example: '2023-12-31T23:59:59Z',
|
|
69
|
+
}),
|
|
70
|
+
(0, mongoose_2.Prop)({ type: Date, required: true }),
|
|
71
|
+
(0, class_validator_1.IsDate)(),
|
|
72
|
+
__metadata("design:type", Date)
|
|
73
|
+
], License.prototype, "endDate", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, swagger_1.ApiProperty)({
|
|
76
|
+
description: 'Nombre maximum d’utilisateurs',
|
|
77
|
+
example: 1,
|
|
78
|
+
}),
|
|
79
|
+
(0, mongoose_2.Prop)({ type: Number, required: false }),
|
|
80
|
+
(0, class_validator_1.IsOptional)(),
|
|
81
|
+
(0, class_validator_1.IsNumber)(),
|
|
82
|
+
__metadata("design:type", Number)
|
|
83
|
+
], License.prototype, "maxUsers", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, swagger_1.ApiProperty)({
|
|
86
|
+
description: 'Nombre maximum de sites',
|
|
87
|
+
example: 1,
|
|
88
|
+
}),
|
|
89
|
+
(0, mongoose_2.Prop)({ type: Number, required: false }),
|
|
90
|
+
(0, class_validator_1.IsOptional)(),
|
|
91
|
+
(0, class_validator_1.IsNumber)(),
|
|
92
|
+
__metadata("design:type", Number)
|
|
93
|
+
], License.prototype, "maxSite", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, swagger_1.ApiProperty)({
|
|
96
|
+
description: 'Suivi OKD activé',
|
|
97
|
+
example: false,
|
|
98
|
+
}),
|
|
99
|
+
(0, mongoose_2.Prop)({ type: Boolean, default: false }),
|
|
100
|
+
(0, class_validator_1.IsBoolean)(),
|
|
101
|
+
__metadata("design:type", Boolean)
|
|
102
|
+
], License.prototype, "trackerOkd", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
(0, swagger_1.ApiProperty)({
|
|
105
|
+
description: 'Type de l’utilisateur',
|
|
106
|
+
example: 'CONSUMER_PLUS',
|
|
107
|
+
}),
|
|
108
|
+
(0, mongoose_2.Prop)({ type: Boolean, required: false, default: false }),
|
|
109
|
+
(0, class_validator_1.IsOptional)(),
|
|
110
|
+
(0, class_validator_1.IsBoolean)(),
|
|
111
|
+
__metadata("design:type", Boolean)
|
|
112
|
+
], License.prototype, "acc", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, swagger_1.ApiProperty)({
|
|
115
|
+
description: 'Identifiant de l’utilisateur',
|
|
116
|
+
example: 'Standard',
|
|
117
|
+
}),
|
|
118
|
+
(0, mongoose_2.Prop)({ type: String, required: false }),
|
|
119
|
+
(0, class_validator_1.IsOptional)(),
|
|
120
|
+
(0, class_validator_1.IsString)(),
|
|
121
|
+
__metadata("design:type", String)
|
|
122
|
+
], License.prototype, "userId", void 0);
|
|
123
|
+
exports.License = License = __decorate([
|
|
124
|
+
(0, mongoose_2.Schema)({
|
|
125
|
+
id: false,
|
|
126
|
+
timestamps: true,
|
|
127
|
+
})
|
|
128
|
+
], License);
|
|
129
|
+
exports.LicenseSchema = mongoose_2.SchemaFactory.createForClass(License);
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './core/CollectiveSite';
|
|
|
2
2
|
export * from './core/Scenario';
|
|
3
3
|
export * from './core/Site';
|
|
4
4
|
export * from './core/User';
|
|
5
|
+
export * from './core/License';
|
|
5
6
|
export * from './core/ScenarioDefaultValue';
|
|
6
7
|
export * from './core/TypeORM/analysis';
|
|
7
8
|
export * from './core/TypeORM/OkwindHistory';
|
package/dist/index.js
CHANGED
|
@@ -42,6 +42,7 @@ __exportStar(require("./core/CollectiveSite"), exports);
|
|
|
42
42
|
__exportStar(require("./core/Scenario"), exports);
|
|
43
43
|
__exportStar(require("./core/Site"), exports);
|
|
44
44
|
__exportStar(require("./core/User"), exports);
|
|
45
|
+
__exportStar(require("./core/License"), exports);
|
|
45
46
|
__exportStar(require("./core/ScenarioDefaultValue"), exports);
|
|
46
47
|
// TypeORM entities
|
|
47
48
|
__exportStar(require("./core/TypeORM/analysis"), exports);
|