@likewatt/models 1.133.0 → 1.135.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.
@@ -13,6 +13,16 @@ export declare class AssistantSettings {
13
13
  weakAnswerLimit: number;
14
14
  generationModel: AssistantGenerationModel;
15
15
  monthlyBudgetEur?: number | null;
16
+ escalationOpeningHour: number;
17
+ /**
18
+ * Doit être strictement après `escalationOpeningHour`. Ce contrôle est fait
19
+ * par api-v2, après fusion avec les valeurs enregistrées : le microservice
20
+ * Mongo écrit par `$set` partiel, un validateur de schéma ne verrait pas
21
+ * l'autre heure.
22
+ */
23
+ escalationClosingHour: number;
24
+ escalationDelayOpenText: string;
25
+ escalationDelayClosedText: string;
16
26
  updatedBy?: string | null;
17
27
  }
18
28
  export declare const AssistantSettingsSchema: import("mongoose").Schema<AssistantSettings, import("mongoose").Model<AssistantSettings, any, any, any, Document<unknown, any, AssistantSettings, any, {}> & AssistantSettings & Required<{
@@ -30,6 +30,10 @@ const nullableTwoDecimalsValidator = {
30
30
  validator: (value) => value === null || twoDecimalsValidator.validator(value),
31
31
  message: '{PATH} doit avoir au plus 2 décimales',
32
32
  };
33
+ /** Délai annoncé après une escalade, pendant les horaires du support. */
34
+ const DEFAULT_ESCALATION_DELAY_OPEN_TEXT = 'Un conseiller vous répondra sous 24 h ouvrées.';
35
+ /** Délai annoncé hors horaires ; il cite l'heure d'ouverture en clair. */
36
+ const DEFAULT_ESCALATION_DELAY_CLOSED_TEXT = 'Un conseiller traitera votre demande à partir de 9 h le prochain jour ouvré.';
33
37
  let AssistantSettings = class AssistantSettings {
34
38
  };
35
39
  exports.AssistantSettings = AssistantSettings;
@@ -172,6 +176,84 @@ __decorate([
172
176
  (0, class_validator_1.Max)(10000),
173
177
  __metadata("design:type", Object)
174
178
  ], AssistantSettings.prototype, "monthlyBudgetEur", void 0);
179
+ __decorate([
180
+ (0, swagger_1.ApiProperty)({
181
+ description: "Heure d'ouverture du support (heure de Paris), pour le délai annoncé après une escalade",
182
+ example: 9,
183
+ default: 9,
184
+ minimum: 0,
185
+ maximum: 23,
186
+ }),
187
+ (0, mongoose_1.Prop)({
188
+ type: Number,
189
+ default: 9,
190
+ min: 0,
191
+ max: 23,
192
+ validate: integerValidator,
193
+ }),
194
+ (0, class_validator_1.IsInt)(),
195
+ (0, class_validator_1.Min)(0),
196
+ (0, class_validator_1.Max)(23),
197
+ __metadata("design:type", Number)
198
+ ], AssistantSettings.prototype, "escalationOpeningHour", void 0);
199
+ __decorate([
200
+ (0, swagger_1.ApiProperty)({
201
+ description: "Heure de fermeture du support (heure de Paris, 24 = minuit), strictement après l'ouverture",
202
+ example: 18,
203
+ default: 18,
204
+ minimum: 1,
205
+ maximum: 24,
206
+ }),
207
+ (0, mongoose_1.Prop)({
208
+ type: Number,
209
+ default: 18,
210
+ min: 1,
211
+ max: 24,
212
+ validate: integerValidator,
213
+ }),
214
+ (0, class_validator_1.IsInt)(),
215
+ (0, class_validator_1.Min)(1),
216
+ (0, class_validator_1.Max)(24),
217
+ __metadata("design:type", Number)
218
+ ], AssistantSettings.prototype, "escalationClosingHour", void 0);
219
+ __decorate([
220
+ (0, swagger_1.ApiProperty)({
221
+ description: 'Délai annoncé après une escalade, pendant les horaires du support',
222
+ example: DEFAULT_ESCALATION_DELAY_OPEN_TEXT,
223
+ default: DEFAULT_ESCALATION_DELAY_OPEN_TEXT,
224
+ minLength: 1,
225
+ maxLength: 300,
226
+ }),
227
+ (0, mongoose_1.Prop)({
228
+ type: String,
229
+ default: DEFAULT_ESCALATION_DELAY_OPEN_TEXT,
230
+ trim: true,
231
+ minlength: 1,
232
+ maxlength: 300,
233
+ }),
234
+ (0, class_validator_1.IsString)(),
235
+ (0, class_validator_1.Length)(1, 300),
236
+ __metadata("design:type", String)
237
+ ], AssistantSettings.prototype, "escalationDelayOpenText", void 0);
238
+ __decorate([
239
+ (0, swagger_1.ApiProperty)({
240
+ description: "Délai annoncé après une escalade, hors horaires (pensez à y reporter l'heure d'ouverture)",
241
+ example: DEFAULT_ESCALATION_DELAY_CLOSED_TEXT,
242
+ default: DEFAULT_ESCALATION_DELAY_CLOSED_TEXT,
243
+ minLength: 1,
244
+ maxLength: 300,
245
+ }),
246
+ (0, mongoose_1.Prop)({
247
+ type: String,
248
+ default: DEFAULT_ESCALATION_DELAY_CLOSED_TEXT,
249
+ trim: true,
250
+ minlength: 1,
251
+ maxlength: 300,
252
+ }),
253
+ (0, class_validator_1.IsString)(),
254
+ (0, class_validator_1.Length)(1, 300),
255
+ __metadata("design:type", String)
256
+ ], AssistantSettings.prototype, "escalationDelayClosedText", void 0);
175
257
  __decorate([
176
258
  (0, swagger_1.ApiPropertyOptional)({
177
259
  description: "Id de l'admin auteur du dernier changement",
@@ -8,6 +8,8 @@ export declare class VSParams {
8
8
  vsMaxCapacity: number;
9
9
  vsTurpe: number;
10
10
  vsConnectingRate: number;
11
+ /** Coût par kWh déstocké (€ / kWh). Absent des valeurs par défaut antérieures : 0. */
12
+ vsDischargeCost?: number;
11
13
  }
12
14
  export declare const VSParamsSchema: import("mongoose").Schema<VSParams, import("mongoose").Model<VSParams, any, any, any, import("mongoose").Document<unknown, any, VSParams, any, {}> & VSParams & {
13
15
  _id: import("mongoose").Types.ObjectId;
@@ -60,6 +60,12 @@ __decorate([
60
60
  (0, class_validator_1.IsNumber)(),
61
61
  __metadata("design:type", Number)
62
62
  ], VSParams.prototype, "vsConnectingRate", void 0);
63
+ __decorate([
64
+ (0, mongoose_1.Prop)({ required: false }),
65
+ (0, class_validator_1.IsOptional)(),
66
+ (0, class_validator_1.IsNumber)(),
67
+ __metadata("design:type", Number)
68
+ ], VSParams.prototype, "vsDischargeCost", void 0);
63
69
  exports.VSParams = VSParams = __decorate([
64
70
  (0, mongoose_1.Schema)({ _id: false })
65
71
  ], VSParams);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likewatt/models",
3
- "version": "1.133.0",
3
+ "version": "1.135.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {