@likewatt/models 1.0.10
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/README.md +9 -0
- package/dist/core/CollectiveSite.d.ts +33 -0
- package/dist/core/CollectiveSite.js +140 -0
- package/dist/core/Scenario.d.ts +68 -0
- package/dist/core/Scenario.js +197 -0
- package/dist/core/Site.d.ts +55 -0
- package/dist/core/Site.js +250 -0
- package/dist/core/TypeORM/OkwindHistory.d.ts +8 -0
- package/dist/core/TypeORM/OkwindHistory.js +43 -0
- package/dist/core/TypeORM/Optimization.d.ts +13 -0
- package/dist/core/TypeORM/Optimization.js +63 -0
- package/dist/core/TypeORM/PvgisHistory.d.ts +8 -0
- package/dist/core/TypeORM/PvgisHistory.js +43 -0
- package/dist/core/TypeORM/TempoHistory.d.ts +7 -0
- package/dist/core/TypeORM/TempoHistory.js +39 -0
- package/dist/core/TypeORM/UsersFilters.d.ts +7 -0
- package/dist/core/TypeORM/UsersFilters.js +39 -0
- package/dist/core/TypeORM/WebhookOutput.d.ts +9 -0
- package/dist/core/TypeORM/WebhookOutput.js +51 -0
- package/dist/core/TypeORM/analysis.d.ts +12 -0
- package/dist/core/TypeORM/analysis.js +59 -0
- package/dist/core/User.d.ts +69 -0
- package/dist/core/User.js +388 -0
- package/dist/core/internal/customer-infos.model.d.ts +17 -0
- package/dist/core/internal/customer-infos.model.js +58 -0
- package/dist/core/internal/energy-price.model.d.ts +19 -0
- package/dist/core/internal/energy-price.model.js +70 -0
- package/dist/core/internal/enums.d.ts +15 -0
- package/dist/core/internal/enums.js +20 -0
- package/dist/core/internal/off-peak-hour.model.d.ts +14 -0
- package/dist/core/internal/off-peak-hour.model.js +40 -0
- package/dist/core/internal/peak-hour.model.d.ts +13 -0
- package/dist/core/internal/peak-hour.model.js +34 -0
- package/dist/core/internal/subscription-rate.model.d.ts +16 -0
- package/dist/core/internal/subscription-rate.model.js +52 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +37 -0
- package/package.json +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# @likewatt/models
|
|
2
|
+
|
|
3
|
+
This package is private and hosted on https://verdaccio.likewatt-infra.com, a private NPM repository.
|
|
4
|
+
It should not be shared to people outside of Likewatt.
|
|
5
|
+
|
|
6
|
+
# Release
|
|
7
|
+
|
|
8
|
+
This package uses CI/CD to deploy automatic new versions when a commit is pushed to the `main` branch.
|
|
9
|
+
The changelogs is also automatically generated.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Document } from 'mongoose';
|
|
2
|
+
import { SiteType } from './internal/enums';
|
|
3
|
+
export type CollectiveSiteDocument = CollectiveSite & Document;
|
|
4
|
+
export declare class CollectiveSite {
|
|
5
|
+
_createdAt: string;
|
|
6
|
+
_lastModified: string;
|
|
7
|
+
addressGeocode: number[];
|
|
8
|
+
addressCitySIREN: number;
|
|
9
|
+
type: SiteType;
|
|
10
|
+
description: string;
|
|
11
|
+
address: string;
|
|
12
|
+
initialOwner: string;
|
|
13
|
+
name: string;
|
|
14
|
+
addressDepartementNum: number;
|
|
15
|
+
id: string;
|
|
16
|
+
addressZipCode: string;
|
|
17
|
+
addressCity: string;
|
|
18
|
+
addressDepartement: string;
|
|
19
|
+
user: string;
|
|
20
|
+
country: string;
|
|
21
|
+
isVisible: boolean;
|
|
22
|
+
timezone: number;
|
|
23
|
+
sites: string[];
|
|
24
|
+
}
|
|
25
|
+
export declare const CollectiveSiteSchema: import("mongoose").Schema<CollectiveSite, import("mongoose").Model<CollectiveSite, any, any, any, Document<unknown, any, CollectiveSite, any> & CollectiveSite & {
|
|
26
|
+
_id: import("mongoose").Types.ObjectId;
|
|
27
|
+
} & {
|
|
28
|
+
__v: number;
|
|
29
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, CollectiveSite, Document<unknown, {}, import("mongoose").FlatRecord<CollectiveSite>, {}> & import("mongoose").FlatRecord<CollectiveSite> & {
|
|
30
|
+
_id: import("mongoose").Types.ObjectId;
|
|
31
|
+
} & {
|
|
32
|
+
__v: number;
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,140 @@
|
|
|
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.CollectiveSiteSchema = exports.CollectiveSite = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
const enums_1 = require("./internal/enums");
|
|
17
|
+
let CollectiveSite = class CollectiveSite {
|
|
18
|
+
};
|
|
19
|
+
exports.CollectiveSite = CollectiveSite;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, swagger_1.ApiProperty)(),
|
|
22
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], CollectiveSite.prototype, "_createdAt", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, swagger_1.ApiProperty)(),
|
|
28
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], CollectiveSite.prototype, "_lastModified", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, swagger_1.ApiProperty)(),
|
|
34
|
+
(0, mongoose_1.Prop)({ type: [Number], required: true }),
|
|
35
|
+
(0, class_validator_1.IsArray)(),
|
|
36
|
+
__metadata("design:type", Array)
|
|
37
|
+
], CollectiveSite.prototype, "addressGeocode", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, swagger_1.ApiProperty)(),
|
|
40
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
41
|
+
(0, class_validator_1.IsNumber)(),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], CollectiveSite.prototype, "addressCitySIREN", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, swagger_1.ApiProperty)({ enum: enums_1.SiteType }),
|
|
46
|
+
(0, mongoose_1.Prop)({ type: String, enum: enums_1.SiteType, required: true }),
|
|
47
|
+
(0, class_validator_1.IsEnum)(enums_1.SiteType),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], CollectiveSite.prototype, "type", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, swagger_1.ApiProperty)(),
|
|
52
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
53
|
+
(0, class_validator_1.IsString)(),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], CollectiveSite.prototype, "description", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, swagger_1.ApiProperty)(),
|
|
58
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
59
|
+
(0, class_validator_1.IsString)(),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], CollectiveSite.prototype, "address", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, swagger_1.ApiProperty)(),
|
|
64
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
65
|
+
(0, class_validator_1.IsString)(),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], CollectiveSite.prototype, "initialOwner", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, swagger_1.ApiProperty)(),
|
|
70
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
71
|
+
(0, class_validator_1.IsString)(),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], CollectiveSite.prototype, "name", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, swagger_1.ApiProperty)(),
|
|
76
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
77
|
+
(0, class_validator_1.IsNumber)(),
|
|
78
|
+
__metadata("design:type", Number)
|
|
79
|
+
], CollectiveSite.prototype, "addressDepartementNum", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, swagger_1.ApiProperty)(),
|
|
82
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
83
|
+
(0, class_validator_1.IsString)(),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], CollectiveSite.prototype, "id", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, swagger_1.ApiProperty)(),
|
|
88
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
89
|
+
(0, class_validator_1.IsString)(),
|
|
90
|
+
__metadata("design:type", String)
|
|
91
|
+
], CollectiveSite.prototype, "addressZipCode", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, swagger_1.ApiProperty)(),
|
|
94
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
95
|
+
(0, class_validator_1.IsString)(),
|
|
96
|
+
__metadata("design:type", String)
|
|
97
|
+
], CollectiveSite.prototype, "addressCity", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, swagger_1.ApiProperty)(),
|
|
100
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
101
|
+
(0, class_validator_1.IsString)(),
|
|
102
|
+
__metadata("design:type", String)
|
|
103
|
+
], CollectiveSite.prototype, "addressDepartement", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, swagger_1.ApiProperty)(),
|
|
106
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
107
|
+
(0, class_validator_1.IsString)(),
|
|
108
|
+
__metadata("design:type", String)
|
|
109
|
+
], CollectiveSite.prototype, "user", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, swagger_1.ApiProperty)(),
|
|
112
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
113
|
+
(0, class_validator_1.IsString)(),
|
|
114
|
+
__metadata("design:type", String)
|
|
115
|
+
], CollectiveSite.prototype, "country", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, swagger_1.ApiProperty)(),
|
|
118
|
+
(0, mongoose_1.Prop)({ default: true }),
|
|
119
|
+
(0, class_validator_1.IsBoolean)(),
|
|
120
|
+
__metadata("design:type", Boolean)
|
|
121
|
+
], CollectiveSite.prototype, "isVisible", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, swagger_1.ApiProperty)(),
|
|
124
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
125
|
+
(0, class_validator_1.IsNumber)(),
|
|
126
|
+
__metadata("design:type", Number)
|
|
127
|
+
], CollectiveSite.prototype, "timezone", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
(0, swagger_1.ApiProperty)(),
|
|
130
|
+
(0, mongoose_1.Prop)({ type: [String], required: true }),
|
|
131
|
+
(0, class_validator_1.IsArray)(),
|
|
132
|
+
__metadata("design:type", Array)
|
|
133
|
+
], CollectiveSite.prototype, "sites", void 0);
|
|
134
|
+
exports.CollectiveSite = CollectiveSite = __decorate([
|
|
135
|
+
(0, mongoose_1.Schema)({
|
|
136
|
+
toJSON: { virtuals: true, versionKey: false },
|
|
137
|
+
toObject: { virtuals: true, versionKey: false },
|
|
138
|
+
})
|
|
139
|
+
], CollectiveSite);
|
|
140
|
+
exports.CollectiveSiteSchema = mongoose_1.SchemaFactory.createForClass(CollectiveSite);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Document, Types, Schema as MSchema } from 'mongoose';
|
|
2
|
+
export declare class Objective {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
unit: string;
|
|
6
|
+
value: number;
|
|
7
|
+
unit2?: string;
|
|
8
|
+
value2?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const ObjectiveSchema: MSchema<Objective, import("mongoose").Model<Objective, any, any, any, Document<unknown, any, Objective, any> & Objective & {
|
|
11
|
+
_id: Types.ObjectId;
|
|
12
|
+
} & {
|
|
13
|
+
__v: number;
|
|
14
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Objective, Document<unknown, {}, import("mongoose").FlatRecord<Objective>, {}> & import("mongoose").FlatRecord<Objective> & {
|
|
15
|
+
_id: Types.ObjectId;
|
|
16
|
+
} & {
|
|
17
|
+
__v: number;
|
|
18
|
+
}>;
|
|
19
|
+
export declare class Technology {
|
|
20
|
+
id: string;
|
|
21
|
+
isDefault?: boolean;
|
|
22
|
+
index: number;
|
|
23
|
+
settings: Record<string, unknown>;
|
|
24
|
+
type?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare const TechnologySchema: MSchema<Technology, import("mongoose").Model<Technology, any, any, any, Document<unknown, any, Technology, any> & Technology & {
|
|
27
|
+
_id: Types.ObjectId;
|
|
28
|
+
} & {
|
|
29
|
+
__v: number;
|
|
30
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Technology, Document<unknown, {}, import("mongoose").FlatRecord<Technology>, {}> & import("mongoose").FlatRecord<Technology> & {
|
|
31
|
+
_id: Types.ObjectId;
|
|
32
|
+
} & {
|
|
33
|
+
__v: number;
|
|
34
|
+
}>;
|
|
35
|
+
export declare class ConfigSite {
|
|
36
|
+
incrementations: Record<string, unknown>[];
|
|
37
|
+
rateOfGrowth?: Record<string, number>;
|
|
38
|
+
}
|
|
39
|
+
export declare const ConfigSiteSchema: MSchema<ConfigSite, import("mongoose").Model<ConfigSite, any, any, any, Document<unknown, any, ConfigSite, any> & ConfigSite & {
|
|
40
|
+
_id: Types.ObjectId;
|
|
41
|
+
} & {
|
|
42
|
+
__v: number;
|
|
43
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ConfigSite, Document<unknown, {}, import("mongoose").FlatRecord<ConfigSite>, {}> & import("mongoose").FlatRecord<ConfigSite> & {
|
|
44
|
+
_id: Types.ObjectId;
|
|
45
|
+
} & {
|
|
46
|
+
__v: number;
|
|
47
|
+
}>;
|
|
48
|
+
export declare class Scenario {
|
|
49
|
+
_id: Types.ObjectId;
|
|
50
|
+
discountRate?: number;
|
|
51
|
+
objectives: Objective[];
|
|
52
|
+
name: string;
|
|
53
|
+
technologies: Technology[];
|
|
54
|
+
configSite: ConfigSite;
|
|
55
|
+
optimizationHorizon?: Record<string, string>;
|
|
56
|
+
siteId: string;
|
|
57
|
+
createdAt: Date;
|
|
58
|
+
}
|
|
59
|
+
export type ScenarioDocument = Scenario & Document;
|
|
60
|
+
export declare const ScenarioSchema: MSchema<Scenario, import("mongoose").Model<Scenario, any, any, any, Document<unknown, any, Scenario, any> & Scenario & Required<{
|
|
61
|
+
_id: Types.ObjectId;
|
|
62
|
+
}> & {
|
|
63
|
+
__v: number;
|
|
64
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Scenario, Document<unknown, {}, import("mongoose").FlatRecord<Scenario>, {}> & import("mongoose").FlatRecord<Scenario> & Required<{
|
|
65
|
+
_id: Types.ObjectId;
|
|
66
|
+
}> & {
|
|
67
|
+
__v: number;
|
|
68
|
+
}>;
|
|
@@ -0,0 +1,197 @@
|
|
|
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.ScenarioSchema = exports.Scenario = exports.ConfigSiteSchema = exports.ConfigSite = exports.TechnologySchema = exports.Technology = exports.ObjectiveSchema = exports.Objective = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
16
|
+
const class_validator_1 = require("class-validator");
|
|
17
|
+
let Objective = class Objective {
|
|
18
|
+
};
|
|
19
|
+
exports.Objective = Objective;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, swagger_1.ApiProperty)({ example: 1 }),
|
|
22
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
23
|
+
(0, class_validator_1.IsNumber)(),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], Objective.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, swagger_1.ApiProperty)({ example: 'CO2 Reduction' }),
|
|
28
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], Objective.prototype, "name", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, swagger_1.ApiProperty)({ example: 'tons' }),
|
|
34
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], Objective.prototype, "unit", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, swagger_1.ApiProperty)({ example: 1200 }),
|
|
40
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
41
|
+
(0, class_validator_1.IsNumber)(),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], Objective.prototype, "value", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, swagger_1.ApiPropertyOptional)({ example: 'kg' }),
|
|
46
|
+
(0, mongoose_1.Prop)(),
|
|
47
|
+
(0, class_validator_1.IsOptional)(),
|
|
48
|
+
(0, class_validator_1.IsString)(),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], Objective.prototype, "unit2", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, swagger_1.ApiPropertyOptional)({ example: 1200000 }),
|
|
53
|
+
(0, mongoose_1.Prop)(),
|
|
54
|
+
(0, class_validator_1.IsOptional)(),
|
|
55
|
+
(0, class_validator_1.IsNumber)(),
|
|
56
|
+
__metadata("design:type", Number)
|
|
57
|
+
], Objective.prototype, "value2", void 0);
|
|
58
|
+
exports.Objective = Objective = __decorate([
|
|
59
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
60
|
+
], Objective);
|
|
61
|
+
exports.ObjectiveSchema = mongoose_1.SchemaFactory.createForClass(Objective);
|
|
62
|
+
let Technology = class Technology {
|
|
63
|
+
};
|
|
64
|
+
exports.Technology = Technology;
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, swagger_1.ApiProperty)({ example: 'pv1' }),
|
|
67
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
68
|
+
(0, class_validator_1.IsString)(),
|
|
69
|
+
__metadata("design:type", String)
|
|
70
|
+
], Technology.prototype, "id", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, swagger_1.ApiPropertyOptional)({ example: true }),
|
|
73
|
+
(0, mongoose_1.Prop)(),
|
|
74
|
+
(0, class_validator_1.IsOptional)(),
|
|
75
|
+
(0, class_validator_1.IsBoolean)(),
|
|
76
|
+
__metadata("design:type", Boolean)
|
|
77
|
+
], Technology.prototype, "isDefault", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, swagger_1.ApiProperty)({ example: 0 }),
|
|
80
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
81
|
+
(0, class_validator_1.IsNumber)(),
|
|
82
|
+
__metadata("design:type", Number)
|
|
83
|
+
], Technology.prototype, "index", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, swagger_1.ApiProperty)({
|
|
86
|
+
example: { power: 100, orientation: 'south', tilt: 30 },
|
|
87
|
+
}),
|
|
88
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Mixed, required: true }),
|
|
89
|
+
(0, class_validator_1.IsObject)(),
|
|
90
|
+
__metadata("design:type", Object)
|
|
91
|
+
], Technology.prototype, "settings", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, swagger_1.ApiPropertyOptional)({ example: 1 }),
|
|
94
|
+
(0, mongoose_1.Prop)(),
|
|
95
|
+
(0, class_validator_1.IsOptional)(),
|
|
96
|
+
(0, class_validator_1.IsNumber)(),
|
|
97
|
+
__metadata("design:type", Number)
|
|
98
|
+
], Technology.prototype, "type", void 0);
|
|
99
|
+
exports.Technology = Technology = __decorate([
|
|
100
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
101
|
+
], Technology);
|
|
102
|
+
exports.TechnologySchema = mongoose_1.SchemaFactory.createForClass(Technology);
|
|
103
|
+
let ConfigSite = class ConfigSite {
|
|
104
|
+
};
|
|
105
|
+
exports.ConfigSite = ConfigSite;
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, swagger_1.ApiProperty)({
|
|
108
|
+
example: [
|
|
109
|
+
{ type: 'PV', step: 10, max: 100 },
|
|
110
|
+
{ type: 'Wind', step: 5, max: 50 },
|
|
111
|
+
],
|
|
112
|
+
}),
|
|
113
|
+
(0, mongoose_1.Prop)({ type: [mongoose_2.Schema.Types.Mixed], default: [] }),
|
|
114
|
+
(0, class_validator_1.IsArray)(),
|
|
115
|
+
__metadata("design:type", Array)
|
|
116
|
+
], ConfigSite.prototype, "incrementations", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
119
|
+
example: { year1: 1.02, year2: 1.03 },
|
|
120
|
+
}),
|
|
121
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Mixed }),
|
|
122
|
+
(0, class_validator_1.IsOptional)(),
|
|
123
|
+
(0, class_validator_1.IsObject)(),
|
|
124
|
+
__metadata("design:type", Object)
|
|
125
|
+
], ConfigSite.prototype, "rateOfGrowth", void 0);
|
|
126
|
+
exports.ConfigSite = ConfigSite = __decorate([
|
|
127
|
+
(0, mongoose_1.Schema)({ _id: false })
|
|
128
|
+
], ConfigSite);
|
|
129
|
+
exports.ConfigSiteSchema = mongoose_1.SchemaFactory.createForClass(ConfigSite);
|
|
130
|
+
let Scenario = class Scenario {
|
|
131
|
+
};
|
|
132
|
+
exports.Scenario = Scenario;
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, swagger_1.ApiProperty)({ example: '661fd9ef3a4ec63c4f0e5a21' }),
|
|
135
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.ObjectId, auto: true }),
|
|
136
|
+
__metadata("design:type", mongoose_2.Types.ObjectId)
|
|
137
|
+
], Scenario.prototype, "_id", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, swagger_1.ApiPropertyOptional)({ example: 0.05 }),
|
|
140
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Mixed }),
|
|
141
|
+
(0, class_validator_1.IsOptional)(),
|
|
142
|
+
__metadata("design:type", Number)
|
|
143
|
+
], Scenario.prototype, "discountRate", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, swagger_1.ApiProperty)({ type: [Objective] }),
|
|
146
|
+
(0, mongoose_1.Prop)({ type: [exports.ObjectiveSchema], required: true }),
|
|
147
|
+
(0, class_validator_1.IsArray)(),
|
|
148
|
+
__metadata("design:type", Array)
|
|
149
|
+
], Scenario.prototype, "objectives", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, swagger_1.ApiProperty)({ example: 'Scenario A - Hybrid PV/Wind' }),
|
|
152
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
153
|
+
(0, class_validator_1.IsString)(),
|
|
154
|
+
__metadata("design:type", String)
|
|
155
|
+
], Scenario.prototype, "name", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
(0, swagger_1.ApiProperty)({ type: [Technology] }),
|
|
158
|
+
(0, mongoose_1.Prop)({ type: [exports.TechnologySchema], required: true }),
|
|
159
|
+
(0, class_validator_1.IsArray)(),
|
|
160
|
+
__metadata("design:type", Array)
|
|
161
|
+
], Scenario.prototype, "technologies", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
(0, swagger_1.ApiProperty)({ type: ConfigSite }),
|
|
164
|
+
(0, mongoose_1.Prop)({ type: exports.ConfigSiteSchema, required: true }),
|
|
165
|
+
(0, class_validator_1.IsObject)(),
|
|
166
|
+
__metadata("design:type", ConfigSite)
|
|
167
|
+
], Scenario.prototype, "configSite", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
170
|
+
example: {
|
|
171
|
+
start: '2025-01-01',
|
|
172
|
+
end: '2030-12-31',
|
|
173
|
+
},
|
|
174
|
+
}),
|
|
175
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Schema.Types.Mixed }),
|
|
176
|
+
(0, class_validator_1.IsOptional)(),
|
|
177
|
+
(0, class_validator_1.IsObject)(),
|
|
178
|
+
__metadata("design:type", Object)
|
|
179
|
+
], Scenario.prototype, "optimizationHorizon", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
(0, swagger_1.ApiProperty)({ example: 'site_12345' }),
|
|
182
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
183
|
+
(0, class_validator_1.IsString)(),
|
|
184
|
+
__metadata("design:type", String)
|
|
185
|
+
], Scenario.prototype, "siteId", void 0);
|
|
186
|
+
__decorate([
|
|
187
|
+
(0, swagger_1.ApiProperty)({ example: '2025-04-24T14:05:00.000Z' }),
|
|
188
|
+
(0, mongoose_1.Prop)({ default: Date.now }),
|
|
189
|
+
__metadata("design:type", Date)
|
|
190
|
+
], Scenario.prototype, "createdAt", void 0);
|
|
191
|
+
exports.Scenario = Scenario = __decorate([
|
|
192
|
+
(0, mongoose_1.Schema)({
|
|
193
|
+
toJSON: { virtuals: true, versionKey: false },
|
|
194
|
+
toObject: { virtuals: true, versionKey: false },
|
|
195
|
+
})
|
|
196
|
+
], Scenario);
|
|
197
|
+
exports.ScenarioSchema = mongoose_1.SchemaFactory.createForClass(Scenario);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Types, Schema as MSchema, Document } from 'mongoose';
|
|
2
|
+
import { SiteType, Profiles } from './internal/enums';
|
|
3
|
+
import { EnergyPrice } from './internal/energy-price.model';
|
|
4
|
+
import { PeakHour } from './internal/peak-hour.model';
|
|
5
|
+
import { OffPeakHour } from './internal/off-peak-hour.model';
|
|
6
|
+
import { SubscriptionRate } from './internal/subscription-rate.model';
|
|
7
|
+
import { CustomerInfos } from './internal/customer-infos.model';
|
|
8
|
+
export declare class Site {
|
|
9
|
+
country: string;
|
|
10
|
+
energyPrices: EnergyPrice[];
|
|
11
|
+
addressCitySIREN: number;
|
|
12
|
+
purchaseAreaOfTension: string;
|
|
13
|
+
addressGeocode: number[];
|
|
14
|
+
peakHours: PeakHour[];
|
|
15
|
+
offPeakHours: OffPeakHour[];
|
|
16
|
+
type: SiteType;
|
|
17
|
+
purchaseMeterOwner: string;
|
|
18
|
+
purchaseContractType: string;
|
|
19
|
+
description: string;
|
|
20
|
+
subscriptionRates: SubscriptionRate[];
|
|
21
|
+
address: string;
|
|
22
|
+
ratesOption: string;
|
|
23
|
+
owner: string;
|
|
24
|
+
name: string;
|
|
25
|
+
isC_AND_I: boolean;
|
|
26
|
+
appUrl: string;
|
|
27
|
+
addressDepartementNum: number;
|
|
28
|
+
id: string;
|
|
29
|
+
addressZipCode: string;
|
|
30
|
+
subscribedPowers: EnergyPrice[];
|
|
31
|
+
addressCity: string;
|
|
32
|
+
addressDepartement: string;
|
|
33
|
+
reportURL: string;
|
|
34
|
+
enedisNumber: string;
|
|
35
|
+
startDate: Date;
|
|
36
|
+
endDate: Date;
|
|
37
|
+
automaticUpdateError?: string;
|
|
38
|
+
scenario?: Types.ObjectId;
|
|
39
|
+
user: string;
|
|
40
|
+
profile: Profiles;
|
|
41
|
+
collectiveSiteId?: string;
|
|
42
|
+
initialOwner: string;
|
|
43
|
+
isExtractingData?: boolean;
|
|
44
|
+
customerInfos?: CustomerInfos;
|
|
45
|
+
}
|
|
46
|
+
export type SiteDocument = Site & Document;
|
|
47
|
+
export declare const SiteSchema: MSchema<Site, import("mongoose").Model<Site, any, any, any, Document<unknown, any, Site, any> & Site & {
|
|
48
|
+
_id: Types.ObjectId;
|
|
49
|
+
} & {
|
|
50
|
+
__v: number;
|
|
51
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Site, Document<unknown, {}, import("mongoose").FlatRecord<Site>, {}> & import("mongoose").FlatRecord<Site> & {
|
|
52
|
+
_id: Types.ObjectId;
|
|
53
|
+
} & {
|
|
54
|
+
__v: number;
|
|
55
|
+
}>;
|