@roomwise/calc-engine 0.0.0-stage → 0.2.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.
- package/LICENSE +21 -0
- package/README.md +285 -2
- package/dist/index.cjs +1614 -0
- package/dist/index.d.cts +806 -0
- package/dist/index.d.ts +806 -0
- package/dist/index.js +1530 -0
- package/package.json +53 -4
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,806 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/schemas/common.d.ts
|
|
3
|
+
export declare const LocalizedTextSchema: z.ZodObject<{
|
|
4
|
+
en: z.ZodString;
|
|
5
|
+
uk: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export type LocalizedText = z.infer<typeof LocalizedTextSchema>;
|
|
8
|
+
export declare const FinishLevelSchema: z.ZodEnum<{
|
|
9
|
+
ROUGH: "ROUGH";
|
|
10
|
+
PRE_FINISH: "PRE_FINISH";
|
|
11
|
+
}>;
|
|
12
|
+
export type FinishLevel = z.infer<typeof FinishLevelSchema>;
|
|
13
|
+
export declare const RuleLevelSchema: z.ZodEnum<{
|
|
14
|
+
OBJECT: "OBJECT";
|
|
15
|
+
CATEGORY: "CATEGORY";
|
|
16
|
+
MATERIAL_TYPE: "MATERIAL_TYPE";
|
|
17
|
+
}>;
|
|
18
|
+
export type RuleLevel = z.infer<typeof RuleLevelSchema>;
|
|
19
|
+
export declare const RateSourceSchema: z.ZodEnum<{
|
|
20
|
+
NBU: "NBU";
|
|
21
|
+
MANUAL: "MANUAL";
|
|
22
|
+
}>;
|
|
23
|
+
export type RateSource = z.infer<typeof RateSourceSchema>;
|
|
24
|
+
export declare const SurfaceKindSchema: z.ZodEnum<{
|
|
25
|
+
NONE: "NONE";
|
|
26
|
+
FLOOR: "FLOOR";
|
|
27
|
+
WALLS: "WALLS";
|
|
28
|
+
CEILING: "CEILING";
|
|
29
|
+
}>;
|
|
30
|
+
export type SurfaceKind = z.infer<typeof SurfaceKindSchema>;
|
|
31
|
+
export declare const ProductUnitSchema: z.ZodEnum<{
|
|
32
|
+
SQM: "SQM";
|
|
33
|
+
LINEAR_M: "LINEAR_M";
|
|
34
|
+
PIECE: "PIECE";
|
|
35
|
+
}>;
|
|
36
|
+
export type ProductUnit = z.infer<typeof ProductUnitSchema>;
|
|
37
|
+
export declare const OptionUnitSchema: z.ZodEnum<{
|
|
38
|
+
PIECE: "PIECE";
|
|
39
|
+
ROOM_SQM: "ROOM_SQM";
|
|
40
|
+
ROOM: "ROOM";
|
|
41
|
+
PROJECT: "PROJECT";
|
|
42
|
+
}>;
|
|
43
|
+
export type OptionUnit = z.infer<typeof OptionUnitSchema>;
|
|
44
|
+
export declare const OptionKindSchema: z.ZodEnum<{
|
|
45
|
+
ENGINEERING: "ENGINEERING";
|
|
46
|
+
ADDITIONAL: "ADDITIONAL";
|
|
47
|
+
}>;
|
|
48
|
+
export type OptionKind = z.infer<typeof OptionKindSchema>;
|
|
49
|
+
export declare const OptionCodeSchema: z.ZodEnum<{
|
|
50
|
+
HEATED_FLOOR: "HEATED_FLOOR";
|
|
51
|
+
}>;
|
|
52
|
+
export type OptionCode = z.infer<typeof OptionCodeSchema>;
|
|
53
|
+
export declare const RoomTypeCodeSchema: z.ZodEnum<{
|
|
54
|
+
LIVING_ROOM: "LIVING_ROOM";
|
|
55
|
+
BEDROOM: "BEDROOM";
|
|
56
|
+
KITCHEN: "KITCHEN";
|
|
57
|
+
KITCHEN_LIVING: "KITCHEN_LIVING";
|
|
58
|
+
BATHROOM: "BATHROOM";
|
|
59
|
+
}>;
|
|
60
|
+
export type RoomTypeCode = z.infer<typeof RoomTypeCodeSchema>;
|
|
61
|
+
export declare const KitchenTypeSchema: z.ZodEnum<{
|
|
62
|
+
KITCHEN_LIVING: "KITCHEN_LIVING";
|
|
63
|
+
SEPARATE: "SEPARATE";
|
|
64
|
+
}>;
|
|
65
|
+
export type KitchenType = z.infer<typeof KitchenTypeSchema>;
|
|
66
|
+
export declare const CurrencySchema: z.ZodEnum<{
|
|
67
|
+
USD: "USD";
|
|
68
|
+
UAH: "UAH";
|
|
69
|
+
}>;
|
|
70
|
+
export type Currency = z.infer<typeof CurrencySchema>;
|
|
71
|
+
export declare const SectionSchema: z.ZodEnum<{
|
|
72
|
+
OBJECT: "OBJECT";
|
|
73
|
+
ENGINEERING: "ENGINEERING";
|
|
74
|
+
ADDITIONAL: "ADDITIONAL";
|
|
75
|
+
BASE: "BASE";
|
|
76
|
+
MATERIALS: "MATERIALS";
|
|
77
|
+
}>;
|
|
78
|
+
export type Section = z.infer<typeof SectionSchema>;
|
|
79
|
+
export declare const LineStatusSchema: z.ZodEnum<{
|
|
80
|
+
OK: "OK";
|
|
81
|
+
INCLUDED: "INCLUDED";
|
|
82
|
+
NOT_CALCULATED: "NOT_CALCULATED";
|
|
83
|
+
UNAVAILABLE: "UNAVAILABLE";
|
|
84
|
+
ERROR: "ERROR";
|
|
85
|
+
}>;
|
|
86
|
+
export type LineStatus = z.infer<typeof LineStatusSchema>;
|
|
87
|
+
export declare const CentsSchema: z.ZodInt;
|
|
88
|
+
export type Cents = z.infer<typeof CentsSchema>;
|
|
89
|
+
export declare const RangeSchema: z.ZodObject<{
|
|
90
|
+
min: z.ZodNumber;
|
|
91
|
+
max: z.ZodNumber;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
export type Range = z.infer<typeof RangeSchema>;
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/schemas/configuration.d.ts
|
|
96
|
+
export declare const RoomSelectionSchema: z.ZodObject<{
|
|
97
|
+
categoryId: z.ZodString;
|
|
98
|
+
productId: z.ZodNullable<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
export type RoomSelection = z.infer<typeof RoomSelectionSchema>;
|
|
101
|
+
export declare const RoomConfigurationSchema: z.ZodObject<{
|
|
102
|
+
clientId: z.ZodString;
|
|
103
|
+
name: z.ZodOptional<z.ZodString>;
|
|
104
|
+
roomTypeCode: z.ZodEnum<{
|
|
105
|
+
LIVING_ROOM: "LIVING_ROOM";
|
|
106
|
+
BEDROOM: "BEDROOM";
|
|
107
|
+
KITCHEN: "KITCHEN";
|
|
108
|
+
KITCHEN_LIVING: "KITCHEN_LIVING";
|
|
109
|
+
BATHROOM: "BATHROOM";
|
|
110
|
+
}>;
|
|
111
|
+
lengthM: z.ZodNumber;
|
|
112
|
+
widthM: z.ZodNumber;
|
|
113
|
+
heightM: z.ZodNumber;
|
|
114
|
+
heatedFloor: z.ZodBoolean;
|
|
115
|
+
selections: z.ZodArray<z.ZodObject<{
|
|
116
|
+
categoryId: z.ZodString;
|
|
117
|
+
productId: z.ZodNullable<z.ZodString>;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
export type RoomConfiguration = z.infer<typeof RoomConfigurationSchema>;
|
|
121
|
+
export declare const OptionSelectionSchema: z.ZodObject<{
|
|
122
|
+
optionId: z.ZodString;
|
|
123
|
+
quantity: z.ZodOptional<z.ZodInt>;
|
|
124
|
+
roomClientIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
export type OptionSelection = z.infer<typeof OptionSelectionSchema>;
|
|
127
|
+
export declare const ConfigurationSchema: z.ZodObject<{
|
|
128
|
+
finishLevel: z.ZodEnum<{
|
|
129
|
+
ROUGH: "ROUGH";
|
|
130
|
+
PRE_FINISH: "PRE_FINISH";
|
|
131
|
+
}>;
|
|
132
|
+
totalAreaSqm: z.ZodNumber;
|
|
133
|
+
balconyAreaSqm: z.ZodNumber;
|
|
134
|
+
balconyTiles: z.ZodBoolean;
|
|
135
|
+
gas: z.ZodBoolean;
|
|
136
|
+
kitchenType: z.ZodEnum<{
|
|
137
|
+
KITCHEN_LIVING: "KITCHEN_LIVING";
|
|
138
|
+
SEPARATE: "SEPARATE";
|
|
139
|
+
}>;
|
|
140
|
+
rooms: z.ZodArray<z.ZodObject<{
|
|
141
|
+
clientId: z.ZodString;
|
|
142
|
+
name: z.ZodOptional<z.ZodString>;
|
|
143
|
+
roomTypeCode: z.ZodEnum<{
|
|
144
|
+
LIVING_ROOM: "LIVING_ROOM";
|
|
145
|
+
BEDROOM: "BEDROOM";
|
|
146
|
+
KITCHEN: "KITCHEN";
|
|
147
|
+
KITCHEN_LIVING: "KITCHEN_LIVING";
|
|
148
|
+
BATHROOM: "BATHROOM";
|
|
149
|
+
}>;
|
|
150
|
+
lengthM: z.ZodNumber;
|
|
151
|
+
widthM: z.ZodNumber;
|
|
152
|
+
heightM: z.ZodNumber;
|
|
153
|
+
heatedFloor: z.ZodBoolean;
|
|
154
|
+
selections: z.ZodArray<z.ZodObject<{
|
|
155
|
+
categoryId: z.ZodString;
|
|
156
|
+
productId: z.ZodNullable<z.ZodString>;
|
|
157
|
+
}, z.core.$strip>>;
|
|
158
|
+
}, z.core.$strip>>;
|
|
159
|
+
options: z.ZodArray<z.ZodObject<{
|
|
160
|
+
optionId: z.ZodString;
|
|
161
|
+
quantity: z.ZodOptional<z.ZodInt>;
|
|
162
|
+
roomClientIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
163
|
+
}, z.core.$strip>>;
|
|
164
|
+
currency: z.ZodEnum<{
|
|
165
|
+
USD: "USD";
|
|
166
|
+
UAH: "UAH";
|
|
167
|
+
}>;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
export type Configuration = z.infer<typeof ConfigurationSchema>;
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region src/schemas/estimate.d.ts
|
|
172
|
+
export declare const EstimateMessageSchema: z.ZodObject<{
|
|
173
|
+
code: z.ZodString;
|
|
174
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
175
|
+
}, z.core.$strip>;
|
|
176
|
+
export type EstimateMessage = z.infer<typeof EstimateMessageSchema>;
|
|
177
|
+
export declare const EstimateLineSchema: z.ZodObject<{
|
|
178
|
+
id: z.ZodString;
|
|
179
|
+
section: z.ZodEnum<{
|
|
180
|
+
OBJECT: "OBJECT";
|
|
181
|
+
ENGINEERING: "ENGINEERING";
|
|
182
|
+
ADDITIONAL: "ADDITIONAL";
|
|
183
|
+
BASE: "BASE";
|
|
184
|
+
MATERIALS: "MATERIALS";
|
|
185
|
+
}>;
|
|
186
|
+
status: z.ZodEnum<{
|
|
187
|
+
OK: "OK";
|
|
188
|
+
INCLUDED: "INCLUDED";
|
|
189
|
+
NOT_CALCULATED: "NOT_CALCULATED";
|
|
190
|
+
UNAVAILABLE: "UNAVAILABLE";
|
|
191
|
+
ERROR: "ERROR";
|
|
192
|
+
}>;
|
|
193
|
+
roomClientId: z.ZodNullable<z.ZodString>;
|
|
194
|
+
categoryId: z.ZodNullable<z.ZodString>;
|
|
195
|
+
productId: z.ZodNullable<z.ZodString>;
|
|
196
|
+
optionId: z.ZodNullable<z.ZodString>;
|
|
197
|
+
packageItemId: z.ZodNullable<z.ZodString>;
|
|
198
|
+
ruleId: z.ZodNullable<z.ZodString>;
|
|
199
|
+
quantity: z.ZodNullable<z.ZodNumber>;
|
|
200
|
+
unit: z.ZodNullable<z.ZodString>;
|
|
201
|
+
unitPriceCents: z.ZodNullable<z.ZodInt>;
|
|
202
|
+
amountCents: z.ZodInt;
|
|
203
|
+
amountUahKopecks: z.ZodNullable<z.ZodInt>;
|
|
204
|
+
warnings: z.ZodArray<z.ZodObject<{
|
|
205
|
+
code: z.ZodString;
|
|
206
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
207
|
+
}, z.core.$strip>>;
|
|
208
|
+
error: z.ZodNullable<z.ZodObject<{
|
|
209
|
+
code: z.ZodString;
|
|
210
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
211
|
+
}, z.core.$strip>>;
|
|
212
|
+
}, z.core.$strip>;
|
|
213
|
+
export type EstimateLine = z.infer<typeof EstimateLineSchema>;
|
|
214
|
+
export declare const SectionTotalSchema: z.ZodObject<{
|
|
215
|
+
usdCents: z.ZodInt;
|
|
216
|
+
uahKopecks: z.ZodNullable<z.ZodInt>;
|
|
217
|
+
}, z.core.$strip>;
|
|
218
|
+
export type SectionTotal = z.infer<typeof SectionTotalSchema>;
|
|
219
|
+
export declare const EstimateTotalsSchema: z.ZodObject<{
|
|
220
|
+
usdCents: z.ZodInt;
|
|
221
|
+
uahKopecks: z.ZodNullable<z.ZodInt>;
|
|
222
|
+
sections: z.ZodRecord<z.ZodEnum<{
|
|
223
|
+
OBJECT: "OBJECT";
|
|
224
|
+
ENGINEERING: "ENGINEERING";
|
|
225
|
+
ADDITIONAL: "ADDITIONAL";
|
|
226
|
+
BASE: "BASE";
|
|
227
|
+
MATERIALS: "MATERIALS";
|
|
228
|
+
}>, z.ZodObject<{
|
|
229
|
+
usdCents: z.ZodInt;
|
|
230
|
+
uahKopecks: z.ZodNullable<z.ZodInt>;
|
|
231
|
+
}, z.core.$strip>>;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
export type EstimateTotals = z.infer<typeof EstimateTotalsSchema>;
|
|
234
|
+
export declare const EstimateWarningSchema: z.ZodObject<{
|
|
235
|
+
code: z.ZodString;
|
|
236
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
237
|
+
lineId: z.ZodOptional<z.ZodString>;
|
|
238
|
+
}, z.core.$strip>;
|
|
239
|
+
export type EstimateWarning = z.infer<typeof EstimateWarningSchema>;
|
|
240
|
+
export declare const EstimateSchema: z.ZodObject<{
|
|
241
|
+
pricingVersion: z.ZodString;
|
|
242
|
+
currency: z.ZodEnum<{
|
|
243
|
+
USD: "USD";
|
|
244
|
+
UAH: "UAH";
|
|
245
|
+
}>;
|
|
246
|
+
exchangeRate: z.ZodNullable<z.ZodObject<{
|
|
247
|
+
rate: z.ZodString;
|
|
248
|
+
date: z.ZodString;
|
|
249
|
+
source: z.ZodEnum<{
|
|
250
|
+
NBU: "NBU";
|
|
251
|
+
MANUAL: "MANUAL";
|
|
252
|
+
}>;
|
|
253
|
+
}, z.core.$strip>>;
|
|
254
|
+
lines: z.ZodArray<z.ZodObject<{
|
|
255
|
+
id: z.ZodString;
|
|
256
|
+
section: z.ZodEnum<{
|
|
257
|
+
OBJECT: "OBJECT";
|
|
258
|
+
ENGINEERING: "ENGINEERING";
|
|
259
|
+
ADDITIONAL: "ADDITIONAL";
|
|
260
|
+
BASE: "BASE";
|
|
261
|
+
MATERIALS: "MATERIALS";
|
|
262
|
+
}>;
|
|
263
|
+
status: z.ZodEnum<{
|
|
264
|
+
OK: "OK";
|
|
265
|
+
INCLUDED: "INCLUDED";
|
|
266
|
+
NOT_CALCULATED: "NOT_CALCULATED";
|
|
267
|
+
UNAVAILABLE: "UNAVAILABLE";
|
|
268
|
+
ERROR: "ERROR";
|
|
269
|
+
}>;
|
|
270
|
+
roomClientId: z.ZodNullable<z.ZodString>;
|
|
271
|
+
categoryId: z.ZodNullable<z.ZodString>;
|
|
272
|
+
productId: z.ZodNullable<z.ZodString>;
|
|
273
|
+
optionId: z.ZodNullable<z.ZodString>;
|
|
274
|
+
packageItemId: z.ZodNullable<z.ZodString>;
|
|
275
|
+
ruleId: z.ZodNullable<z.ZodString>;
|
|
276
|
+
quantity: z.ZodNullable<z.ZodNumber>;
|
|
277
|
+
unit: z.ZodNullable<z.ZodString>;
|
|
278
|
+
unitPriceCents: z.ZodNullable<z.ZodInt>;
|
|
279
|
+
amountCents: z.ZodInt;
|
|
280
|
+
amountUahKopecks: z.ZodNullable<z.ZodInt>;
|
|
281
|
+
warnings: z.ZodArray<z.ZodObject<{
|
|
282
|
+
code: z.ZodString;
|
|
283
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
284
|
+
}, z.core.$strip>>;
|
|
285
|
+
error: z.ZodNullable<z.ZodObject<{
|
|
286
|
+
code: z.ZodString;
|
|
287
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
288
|
+
}, z.core.$strip>>;
|
|
289
|
+
}, z.core.$strip>>;
|
|
290
|
+
totals: z.ZodObject<{
|
|
291
|
+
usdCents: z.ZodInt;
|
|
292
|
+
uahKopecks: z.ZodNullable<z.ZodInt>;
|
|
293
|
+
sections: z.ZodRecord<z.ZodEnum<{
|
|
294
|
+
OBJECT: "OBJECT";
|
|
295
|
+
ENGINEERING: "ENGINEERING";
|
|
296
|
+
ADDITIONAL: "ADDITIONAL";
|
|
297
|
+
BASE: "BASE";
|
|
298
|
+
MATERIALS: "MATERIALS";
|
|
299
|
+
}>, z.ZodObject<{
|
|
300
|
+
usdCents: z.ZodInt;
|
|
301
|
+
uahKopecks: z.ZodNullable<z.ZodInt>;
|
|
302
|
+
}, z.core.$strip>>;
|
|
303
|
+
}, z.core.$strip>;
|
|
304
|
+
warnings: z.ZodArray<z.ZodObject<{
|
|
305
|
+
code: z.ZodString;
|
|
306
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
307
|
+
lineId: z.ZodOptional<z.ZodString>;
|
|
308
|
+
}, z.core.$strip>>;
|
|
309
|
+
incomplete: z.ZodBoolean;
|
|
310
|
+
}, z.core.$strip>;
|
|
311
|
+
export type Estimate = z.infer<typeof EstimateSchema>;
|
|
312
|
+
//#endregion
|
|
313
|
+
//#region src/schemas/preview.d.ts
|
|
314
|
+
export declare const RuleSampleSchema: z.ZodObject<{
|
|
315
|
+
room: z.ZodOptional<z.ZodObject<{
|
|
316
|
+
roomTypeCode: z.ZodEnum<{
|
|
317
|
+
LIVING_ROOM: "LIVING_ROOM";
|
|
318
|
+
BEDROOM: "BEDROOM";
|
|
319
|
+
KITCHEN: "KITCHEN";
|
|
320
|
+
KITCHEN_LIVING: "KITCHEN_LIVING";
|
|
321
|
+
BATHROOM: "BATHROOM";
|
|
322
|
+
}>;
|
|
323
|
+
lengthM: z.ZodNumber;
|
|
324
|
+
widthM: z.ZodNumber;
|
|
325
|
+
heightM: z.ZodNumber;
|
|
326
|
+
heatedFloor: z.ZodBoolean;
|
|
327
|
+
}, z.core.$strip>>;
|
|
328
|
+
product: z.ZodOptional<z.ZodObject<{
|
|
329
|
+
priceCents: z.ZodInt;
|
|
330
|
+
unit: z.ZodEnum<{
|
|
331
|
+
SQM: "SQM";
|
|
332
|
+
LINEAR_M: "LINEAR_M";
|
|
333
|
+
PIECE: "PIECE";
|
|
334
|
+
}>;
|
|
335
|
+
wastePercent: z.ZodNumber;
|
|
336
|
+
}, z.core.$strip>>;
|
|
337
|
+
object: z.ZodObject<{
|
|
338
|
+
totalAreaSqm: z.ZodNumber;
|
|
339
|
+
balconyAreaSqm: z.ZodNumber;
|
|
340
|
+
balconyTiles: z.ZodBoolean;
|
|
341
|
+
gas: z.ZodBoolean;
|
|
342
|
+
kitchenType: z.ZodEnum<{
|
|
343
|
+
KITCHEN_LIVING: "KITCHEN_LIVING";
|
|
344
|
+
SEPARATE: "SEPARATE";
|
|
345
|
+
}>;
|
|
346
|
+
finishLevel: z.ZodEnum<{
|
|
347
|
+
ROUGH: "ROUGH";
|
|
348
|
+
PRE_FINISH: "PRE_FINISH";
|
|
349
|
+
}>;
|
|
350
|
+
roomsCount: z.ZodInt;
|
|
351
|
+
bathroomsCount: z.ZodInt;
|
|
352
|
+
}, z.core.$strip>;
|
|
353
|
+
}, z.core.$strip>;
|
|
354
|
+
export type RuleSample = z.infer<typeof RuleSampleSchema>;
|
|
355
|
+
export declare const RulePreviewSchema: z.ZodObject<{
|
|
356
|
+
quantity: z.ZodNullable<z.ZodNumber>;
|
|
357
|
+
amountCents: z.ZodNullable<z.ZodInt>;
|
|
358
|
+
variables: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean, z.ZodString]>>;
|
|
359
|
+
coefficients: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
360
|
+
error: z.ZodNullable<z.ZodObject<{
|
|
361
|
+
code: z.ZodString;
|
|
362
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
363
|
+
}, z.core.$strip>>;
|
|
364
|
+
}, z.core.$strip>;
|
|
365
|
+
export type RulePreview = z.infer<typeof RulePreviewSchema>;
|
|
366
|
+
//#endregion
|
|
367
|
+
//#region src/schemas/pricing-data.d.ts
|
|
368
|
+
export declare const ExchangeRateSchema: z.ZodObject<{
|
|
369
|
+
rate: z.ZodString;
|
|
370
|
+
date: z.ZodString;
|
|
371
|
+
source: z.ZodEnum<{
|
|
372
|
+
NBU: "NBU";
|
|
373
|
+
MANUAL: "MANUAL";
|
|
374
|
+
}>;
|
|
375
|
+
}, z.core.$strip>;
|
|
376
|
+
export type ExchangeRate = z.infer<typeof ExchangeRateSchema>;
|
|
377
|
+
export declare const PricingLimitsSchema: z.ZodObject<{
|
|
378
|
+
totalAreaSqm: z.ZodObject<{
|
|
379
|
+
min: z.ZodNumber;
|
|
380
|
+
max: z.ZodNumber;
|
|
381
|
+
}, z.core.$strip>;
|
|
382
|
+
rooms: z.ZodObject<{
|
|
383
|
+
min: z.ZodNumber;
|
|
384
|
+
max: z.ZodNumber;
|
|
385
|
+
}, z.core.$strip>;
|
|
386
|
+
roomSideM: z.ZodObject<{
|
|
387
|
+
min: z.ZodNumber;
|
|
388
|
+
max: z.ZodNumber;
|
|
389
|
+
}, z.core.$strip>;
|
|
390
|
+
roomHeightM: z.ZodObject<{
|
|
391
|
+
min: z.ZodNumber;
|
|
392
|
+
max: z.ZodNumber;
|
|
393
|
+
}, z.core.$strip>;
|
|
394
|
+
}, z.core.$strip>;
|
|
395
|
+
export type PricingLimits = z.infer<typeof PricingLimitsSchema>;
|
|
396
|
+
export declare const BaseRateSchema: z.ZodObject<{
|
|
397
|
+
finishLevel: z.ZodEnum<{
|
|
398
|
+
ROUGH: "ROUGH";
|
|
399
|
+
PRE_FINISH: "PRE_FINISH";
|
|
400
|
+
}>;
|
|
401
|
+
areaFromSqm: z.ZodNumber;
|
|
402
|
+
areaToSqm: z.ZodNumber;
|
|
403
|
+
rateCentsPerSqm: z.ZodInt;
|
|
404
|
+
}, z.core.$strip>;
|
|
405
|
+
export type BaseRate = z.infer<typeof BaseRateSchema>;
|
|
406
|
+
export declare const PricingRuleSchema: z.ZodObject<{
|
|
407
|
+
id: z.ZodString;
|
|
408
|
+
level: z.ZodEnum<{
|
|
409
|
+
OBJECT: "OBJECT";
|
|
410
|
+
CATEGORY: "CATEGORY";
|
|
411
|
+
MATERIAL_TYPE: "MATERIAL_TYPE";
|
|
412
|
+
}>;
|
|
413
|
+
categoryId: z.ZodNullable<z.ZodString>;
|
|
414
|
+
materialTypeId: z.ZodNullable<z.ZodString>;
|
|
415
|
+
name: z.ZodObject<{
|
|
416
|
+
en: z.ZodString;
|
|
417
|
+
uk: z.ZodString;
|
|
418
|
+
}, z.core.$strip>;
|
|
419
|
+
quantityFormula: z.ZodNullable<z.ZodString>;
|
|
420
|
+
costFormula: z.ZodString;
|
|
421
|
+
sortOrder: z.ZodInt;
|
|
422
|
+
}, z.core.$strip>;
|
|
423
|
+
export type PricingRule = z.infer<typeof PricingRuleSchema>;
|
|
424
|
+
export declare const PricingRoomTypeSchema: z.ZodObject<{
|
|
425
|
+
id: z.ZodString;
|
|
426
|
+
code: z.ZodString;
|
|
427
|
+
}, z.core.$strip>;
|
|
428
|
+
export type PricingRoomType = z.infer<typeof PricingRoomTypeSchema>;
|
|
429
|
+
export declare const PricingCategorySchema: z.ZodObject<{
|
|
430
|
+
id: z.ZodString;
|
|
431
|
+
wastePercent: z.ZodNumber;
|
|
432
|
+
surface: z.ZodEnum<{
|
|
433
|
+
NONE: "NONE";
|
|
434
|
+
FLOOR: "FLOOR";
|
|
435
|
+
WALLS: "WALLS";
|
|
436
|
+
CEILING: "CEILING";
|
|
437
|
+
}>;
|
|
438
|
+
}, z.core.$strip>;
|
|
439
|
+
export type PricingCategory = z.infer<typeof PricingCategorySchema>;
|
|
440
|
+
export declare const PricingMaterialTypeSchema: z.ZodObject<{
|
|
441
|
+
id: z.ZodString;
|
|
442
|
+
code: z.ZodString;
|
|
443
|
+
}, z.core.$strip>;
|
|
444
|
+
export type PricingMaterialType = z.infer<typeof PricingMaterialTypeSchema>;
|
|
445
|
+
export declare const PricingProductSchema: z.ZodObject<{
|
|
446
|
+
id: z.ZodString;
|
|
447
|
+
categoryId: z.ZodString;
|
|
448
|
+
materialTypeId: z.ZodString;
|
|
449
|
+
priceCents: z.ZodInt;
|
|
450
|
+
unit: z.ZodEnum<{
|
|
451
|
+
SQM: "SQM";
|
|
452
|
+
LINEAR_M: "LINEAR_M";
|
|
453
|
+
PIECE: "PIECE";
|
|
454
|
+
}>;
|
|
455
|
+
wastePercentOverride: z.ZodNullable<z.ZodNumber>;
|
|
456
|
+
heatedFloorCompatible: z.ZodBoolean;
|
|
457
|
+
available: z.ZodBoolean;
|
|
458
|
+
}, z.core.$strip>;
|
|
459
|
+
export type PricingProduct = z.infer<typeof PricingProductSchema>;
|
|
460
|
+
export declare const PricingPackageItemSchema: z.ZodObject<{
|
|
461
|
+
id: z.ZodString;
|
|
462
|
+
includedInBase: z.ZodBoolean;
|
|
463
|
+
priceCents: z.ZodNullable<z.ZodInt>;
|
|
464
|
+
unit: z.ZodNullable<z.ZodEnum<{
|
|
465
|
+
PIECE: "PIECE";
|
|
466
|
+
ROOM_SQM: "ROOM_SQM";
|
|
467
|
+
ROOM: "ROOM";
|
|
468
|
+
PROJECT: "PROJECT";
|
|
469
|
+
}>>;
|
|
470
|
+
}, z.core.$strip>;
|
|
471
|
+
export type PricingPackageItem = z.infer<typeof PricingPackageItemSchema>;
|
|
472
|
+
export declare const PricingOptionSchema: z.ZodObject<{
|
|
473
|
+
id: z.ZodString;
|
|
474
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
475
|
+
HEATED_FLOOR: "HEATED_FLOOR";
|
|
476
|
+
}>>;
|
|
477
|
+
kind: z.ZodEnum<{
|
|
478
|
+
ENGINEERING: "ENGINEERING";
|
|
479
|
+
ADDITIONAL: "ADDITIONAL";
|
|
480
|
+
}>;
|
|
481
|
+
priceCents: z.ZodInt;
|
|
482
|
+
unit: z.ZodEnum<{
|
|
483
|
+
PIECE: "PIECE";
|
|
484
|
+
ROOM_SQM: "ROOM_SQM";
|
|
485
|
+
ROOM: "ROOM";
|
|
486
|
+
PROJECT: "PROJECT";
|
|
487
|
+
}>;
|
|
488
|
+
roomTypeCodes: z.ZodArray<z.ZodString>;
|
|
489
|
+
minQuantity: z.ZodNullable<z.ZodInt>;
|
|
490
|
+
maxQuantity: z.ZodNullable<z.ZodInt>;
|
|
491
|
+
available: z.ZodBoolean;
|
|
492
|
+
}, z.core.$strip>;
|
|
493
|
+
export type PricingOption = z.infer<typeof PricingOptionSchema>;
|
|
494
|
+
export declare const PricingDataSchema: z.ZodObject<{
|
|
495
|
+
version: z.ZodString;
|
|
496
|
+
exchangeRate: z.ZodNullable<z.ZodObject<{
|
|
497
|
+
rate: z.ZodString;
|
|
498
|
+
date: z.ZodString;
|
|
499
|
+
source: z.ZodEnum<{
|
|
500
|
+
NBU: "NBU";
|
|
501
|
+
MANUAL: "MANUAL";
|
|
502
|
+
}>;
|
|
503
|
+
}, z.core.$strip>>;
|
|
504
|
+
limits: z.ZodObject<{
|
|
505
|
+
totalAreaSqm: z.ZodObject<{
|
|
506
|
+
min: z.ZodNumber;
|
|
507
|
+
max: z.ZodNumber;
|
|
508
|
+
}, z.core.$strip>;
|
|
509
|
+
rooms: z.ZodObject<{
|
|
510
|
+
min: z.ZodNumber;
|
|
511
|
+
max: z.ZodNumber;
|
|
512
|
+
}, z.core.$strip>;
|
|
513
|
+
roomSideM: z.ZodObject<{
|
|
514
|
+
min: z.ZodNumber;
|
|
515
|
+
max: z.ZodNumber;
|
|
516
|
+
}, z.core.$strip>;
|
|
517
|
+
roomHeightM: z.ZodObject<{
|
|
518
|
+
min: z.ZodNumber;
|
|
519
|
+
max: z.ZodNumber;
|
|
520
|
+
}, z.core.$strip>;
|
|
521
|
+
}, z.core.$strip>;
|
|
522
|
+
baseRates: z.ZodArray<z.ZodObject<{
|
|
523
|
+
finishLevel: z.ZodEnum<{
|
|
524
|
+
ROUGH: "ROUGH";
|
|
525
|
+
PRE_FINISH: "PRE_FINISH";
|
|
526
|
+
}>;
|
|
527
|
+
areaFromSqm: z.ZodNumber;
|
|
528
|
+
areaToSqm: z.ZodNumber;
|
|
529
|
+
rateCentsPerSqm: z.ZodInt;
|
|
530
|
+
}, z.core.$strip>>;
|
|
531
|
+
coefficients: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
532
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
533
|
+
id: z.ZodString;
|
|
534
|
+
level: z.ZodEnum<{
|
|
535
|
+
OBJECT: "OBJECT";
|
|
536
|
+
CATEGORY: "CATEGORY";
|
|
537
|
+
MATERIAL_TYPE: "MATERIAL_TYPE";
|
|
538
|
+
}>;
|
|
539
|
+
categoryId: z.ZodNullable<z.ZodString>;
|
|
540
|
+
materialTypeId: z.ZodNullable<z.ZodString>;
|
|
541
|
+
name: z.ZodObject<{
|
|
542
|
+
en: z.ZodString;
|
|
543
|
+
uk: z.ZodString;
|
|
544
|
+
}, z.core.$strip>;
|
|
545
|
+
quantityFormula: z.ZodNullable<z.ZodString>;
|
|
546
|
+
costFormula: z.ZodString;
|
|
547
|
+
sortOrder: z.ZodInt;
|
|
548
|
+
}, z.core.$strip>>;
|
|
549
|
+
roomTypes: z.ZodArray<z.ZodObject<{
|
|
550
|
+
id: z.ZodString;
|
|
551
|
+
code: z.ZodString;
|
|
552
|
+
}, z.core.$strip>>;
|
|
553
|
+
categories: z.ZodArray<z.ZodObject<{
|
|
554
|
+
id: z.ZodString;
|
|
555
|
+
wastePercent: z.ZodNumber;
|
|
556
|
+
surface: z.ZodEnum<{
|
|
557
|
+
NONE: "NONE";
|
|
558
|
+
FLOOR: "FLOOR";
|
|
559
|
+
WALLS: "WALLS";
|
|
560
|
+
CEILING: "CEILING";
|
|
561
|
+
}>;
|
|
562
|
+
}, z.core.$strip>>;
|
|
563
|
+
materialTypes: z.ZodArray<z.ZodObject<{
|
|
564
|
+
id: z.ZodString;
|
|
565
|
+
code: z.ZodString;
|
|
566
|
+
}, z.core.$strip>>;
|
|
567
|
+
products: z.ZodArray<z.ZodObject<{
|
|
568
|
+
id: z.ZodString;
|
|
569
|
+
categoryId: z.ZodString;
|
|
570
|
+
materialTypeId: z.ZodString;
|
|
571
|
+
priceCents: z.ZodInt;
|
|
572
|
+
unit: z.ZodEnum<{
|
|
573
|
+
SQM: "SQM";
|
|
574
|
+
LINEAR_M: "LINEAR_M";
|
|
575
|
+
PIECE: "PIECE";
|
|
576
|
+
}>;
|
|
577
|
+
wastePercentOverride: z.ZodNullable<z.ZodNumber>;
|
|
578
|
+
heatedFloorCompatible: z.ZodBoolean;
|
|
579
|
+
available: z.ZodBoolean;
|
|
580
|
+
}, z.core.$strip>>;
|
|
581
|
+
packageItems: z.ZodArray<z.ZodObject<{
|
|
582
|
+
id: z.ZodString;
|
|
583
|
+
includedInBase: z.ZodBoolean;
|
|
584
|
+
priceCents: z.ZodNullable<z.ZodInt>;
|
|
585
|
+
unit: z.ZodNullable<z.ZodEnum<{
|
|
586
|
+
PIECE: "PIECE";
|
|
587
|
+
ROOM_SQM: "ROOM_SQM";
|
|
588
|
+
ROOM: "ROOM";
|
|
589
|
+
PROJECT: "PROJECT";
|
|
590
|
+
}>>;
|
|
591
|
+
}, z.core.$strip>>;
|
|
592
|
+
options: z.ZodArray<z.ZodObject<{
|
|
593
|
+
id: z.ZodString;
|
|
594
|
+
code: z.ZodNullable<z.ZodEnum<{
|
|
595
|
+
HEATED_FLOOR: "HEATED_FLOOR";
|
|
596
|
+
}>>;
|
|
597
|
+
kind: z.ZodEnum<{
|
|
598
|
+
ENGINEERING: "ENGINEERING";
|
|
599
|
+
ADDITIONAL: "ADDITIONAL";
|
|
600
|
+
}>;
|
|
601
|
+
priceCents: z.ZodInt;
|
|
602
|
+
unit: z.ZodEnum<{
|
|
603
|
+
PIECE: "PIECE";
|
|
604
|
+
ROOM_SQM: "ROOM_SQM";
|
|
605
|
+
ROOM: "ROOM";
|
|
606
|
+
PROJECT: "PROJECT";
|
|
607
|
+
}>;
|
|
608
|
+
roomTypeCodes: z.ZodArray<z.ZodString>;
|
|
609
|
+
minQuantity: z.ZodNullable<z.ZodInt>;
|
|
610
|
+
maxQuantity: z.ZodNullable<z.ZodInt>;
|
|
611
|
+
available: z.ZodBoolean;
|
|
612
|
+
}, z.core.$strip>>;
|
|
613
|
+
}, z.core.$strip>;
|
|
614
|
+
export type PricingData = z.infer<typeof PricingDataSchema>;
|
|
615
|
+
//#endregion
|
|
616
|
+
//#region src/estimate/estimate.d.ts
|
|
617
|
+
export declare function estimate(configuration: Configuration, data: PricingData): Estimate;
|
|
618
|
+
//#endregion
|
|
619
|
+
//#region src/estimate/limits.d.ts
|
|
620
|
+
export interface LimitViolation {
|
|
621
|
+
field: string;
|
|
622
|
+
min: number;
|
|
623
|
+
max: number;
|
|
624
|
+
}
|
|
625
|
+
export declare function checkLimits(configuration: Configuration, limits: PricingData['limits'], options?: PricingData['options']): LimitViolation[];
|
|
626
|
+
//#endregion
|
|
627
|
+
//#region src/formula/types.d.ts
|
|
628
|
+
export interface Span {
|
|
629
|
+
readonly start: number;
|
|
630
|
+
readonly end: number;
|
|
631
|
+
}
|
|
632
|
+
export type UnaryOperator = '-' | '!';
|
|
633
|
+
export type BinaryOperator = '||' | '&&' | '==' | '!=' | '<' | '>' | '<=' | '>=' | '+' | '-' | '*' | '/';
|
|
634
|
+
export interface LiteralNode extends Span {
|
|
635
|
+
readonly type: 'Literal';
|
|
636
|
+
readonly value: number | string | boolean;
|
|
637
|
+
}
|
|
638
|
+
export interface IdentifierNode extends Span {
|
|
639
|
+
readonly type: 'Identifier';
|
|
640
|
+
readonly name: string;
|
|
641
|
+
}
|
|
642
|
+
export interface MemberNode extends Span {
|
|
643
|
+
readonly type: 'Member';
|
|
644
|
+
readonly object: FormulaNode;
|
|
645
|
+
readonly property: IdentifierNode;
|
|
646
|
+
}
|
|
647
|
+
export interface CallNode extends Span {
|
|
648
|
+
readonly type: 'Call';
|
|
649
|
+
readonly callee: FormulaNode;
|
|
650
|
+
readonly args: readonly FormulaNode[];
|
|
651
|
+
}
|
|
652
|
+
export interface UnaryNode extends Span {
|
|
653
|
+
readonly type: 'Unary';
|
|
654
|
+
readonly operator: UnaryOperator;
|
|
655
|
+
readonly argument: FormulaNode;
|
|
656
|
+
}
|
|
657
|
+
export interface BinaryNode extends Span {
|
|
658
|
+
readonly type: 'Binary';
|
|
659
|
+
readonly operator: BinaryOperator;
|
|
660
|
+
readonly left: FormulaNode;
|
|
661
|
+
readonly right: FormulaNode;
|
|
662
|
+
}
|
|
663
|
+
export interface ConditionalNode extends Span {
|
|
664
|
+
readonly type: 'Conditional';
|
|
665
|
+
readonly test: FormulaNode;
|
|
666
|
+
readonly consequent: FormulaNode;
|
|
667
|
+
readonly alternate: FormulaNode;
|
|
668
|
+
}
|
|
669
|
+
export type FormulaNode = LiteralNode | IdentifierNode | MemberNode | CallNode | UnaryNode | BinaryNode | ConditionalNode;
|
|
670
|
+
export type FormulaErrorCode = 'FORMULA_SYNTAX' | 'FORMULA_TOO_COMPLEX' | 'UNKNOWN_VARIABLE' | 'UNKNOWN_COEFFICIENT' | 'VARIABLE_NOT_ALLOWED_AT_LEVEL' | 'UNKNOWN_FUNCTION' | 'QUANTITY_NOT_ALLOWED';
|
|
671
|
+
export interface FormulaError<Code extends FormulaErrorCode = FormulaErrorCode> {
|
|
672
|
+
readonly code: Code;
|
|
673
|
+
readonly position: number;
|
|
674
|
+
readonly length: number;
|
|
675
|
+
readonly params?: Readonly<Record<string, string | number>>;
|
|
676
|
+
}
|
|
677
|
+
//#endregion
|
|
678
|
+
//#region src/formula/evaluate.d.ts
|
|
679
|
+
export type FormulaValue = number | boolean | string;
|
|
680
|
+
export type EvaluationReason = 'DIVISION_BY_ZERO' | 'NOT_FINITE' | 'TYPE_MISMATCH';
|
|
681
|
+
export interface EvaluationError {
|
|
682
|
+
readonly code: 'FORMULA_RUNTIME_ERROR' | 'UNKNOWN_VARIABLE' | 'UNKNOWN_COEFFICIENT' | 'UNKNOWN_FUNCTION';
|
|
683
|
+
readonly position: number;
|
|
684
|
+
readonly length: number;
|
|
685
|
+
readonly params?: Readonly<Record<string, string | number>>;
|
|
686
|
+
}
|
|
687
|
+
export type EvaluationResult = {
|
|
688
|
+
readonly ok: true;
|
|
689
|
+
readonly value: FormulaValue;
|
|
690
|
+
} | {
|
|
691
|
+
readonly ok: false;
|
|
692
|
+
readonly error: EvaluationError;
|
|
693
|
+
};
|
|
694
|
+
export interface EvaluationScope {
|
|
695
|
+
readonly variables: object;
|
|
696
|
+
readonly coefficients: Readonly<Record<string, number>>;
|
|
697
|
+
}
|
|
698
|
+
export declare function evaluate(ast: FormulaNode, scope: EvaluationScope): EvaluationResult;
|
|
699
|
+
//#endregion
|
|
700
|
+
//#region src/formula/language.d.ts
|
|
701
|
+
export declare const COEFFICIENT_NAMESPACE = "coef";
|
|
702
|
+
export interface FormulaFunction {
|
|
703
|
+
readonly name: string;
|
|
704
|
+
readonly minArgs: number;
|
|
705
|
+
readonly maxArgs: number;
|
|
706
|
+
readonly apply: (args: readonly number[]) => number;
|
|
707
|
+
}
|
|
708
|
+
export declare const FORMULA_FUNCTION_TABLE: ReadonlyMap<string, FormulaFunction>;
|
|
709
|
+
export declare const FORMULA_FUNCTIONS: readonly string[];
|
|
710
|
+
//#endregion
|
|
711
|
+
//#region src/formula/parse.d.ts
|
|
712
|
+
export declare const FORMULA_LIMITS: {
|
|
713
|
+
readonly maxLength: 500;
|
|
714
|
+
readonly maxDepth: 32;
|
|
715
|
+
readonly maxNodes: 200;
|
|
716
|
+
};
|
|
717
|
+
export type ParseError = FormulaError<'FORMULA_SYNTAX' | 'FORMULA_TOO_COMPLEX'>;
|
|
718
|
+
export type ParseResult = {
|
|
719
|
+
readonly ok: true;
|
|
720
|
+
readonly ast: FormulaNode;
|
|
721
|
+
} | {
|
|
722
|
+
readonly ok: false;
|
|
723
|
+
readonly error: ParseError;
|
|
724
|
+
};
|
|
725
|
+
export declare function parse(source: string): ParseResult;
|
|
726
|
+
//#endregion
|
|
727
|
+
//#region src/formula/preview.d.ts
|
|
728
|
+
export interface PreviewRuleInput {
|
|
729
|
+
readonly level: RuleLevel;
|
|
730
|
+
readonly quantityFormula: string | null;
|
|
731
|
+
readonly costFormula: string;
|
|
732
|
+
readonly coefficients: Readonly<Record<string, number>>;
|
|
733
|
+
readonly sample: RuleSample;
|
|
734
|
+
}
|
|
735
|
+
export declare function previewRule(input: PreviewRuleInput): RulePreview;
|
|
736
|
+
//#endregion
|
|
737
|
+
//#region src/formula/suggest.d.ts
|
|
738
|
+
export declare function levenshtein(a: string, b: string): number;
|
|
739
|
+
export declare function suggestNearest(name: string, candidates: readonly string[], maxDistance?: number): string | undefined;
|
|
740
|
+
//#endregion
|
|
741
|
+
//#region src/formula/validate.d.ts
|
|
742
|
+
export type FormulaKind = 'quantity' | 'cost';
|
|
743
|
+
export type FormulaScope = 'room' | 'product' | 'object';
|
|
744
|
+
export interface FormulaVariable {
|
|
745
|
+
readonly name: string;
|
|
746
|
+
readonly kind: 'number' | 'boolean' | 'enum';
|
|
747
|
+
readonly values?: readonly string[];
|
|
748
|
+
}
|
|
749
|
+
export declare const FORMULA_SCOPE_VARIABLES: Record<FormulaScope, readonly FormulaVariable[]>;
|
|
750
|
+
export declare const FORMULA_QUANTITY_VARIABLE: FormulaVariable;
|
|
751
|
+
export declare const FORMULA_VARIABLES: Record<RuleLevel, readonly FormulaVariable[]>;
|
|
752
|
+
export interface ValidateFormulaInput {
|
|
753
|
+
readonly level: RuleLevel;
|
|
754
|
+
readonly kind: FormulaKind;
|
|
755
|
+
readonly source: string;
|
|
756
|
+
readonly coefficientKeys: readonly string[];
|
|
757
|
+
}
|
|
758
|
+
export interface ValidateFormulaResult {
|
|
759
|
+
readonly valid: boolean;
|
|
760
|
+
readonly coefficientKeys: string[];
|
|
761
|
+
readonly errors: FormulaError[];
|
|
762
|
+
}
|
|
763
|
+
export declare function validateFormula(input: ValidateFormulaInput): ValidateFormulaResult;
|
|
764
|
+
//#endregion
|
|
765
|
+
//#region src/money/convert-uah.d.ts
|
|
766
|
+
export declare function convertCentsToKopecks(cents: number, rate: number | string): number;
|
|
767
|
+
//#endregion
|
|
768
|
+
//#region src/money/to-cents.d.ts
|
|
769
|
+
export declare function toCents(dollars: number): number;
|
|
770
|
+
//#endregion
|
|
771
|
+
//#region src/variables/object.d.ts
|
|
772
|
+
export interface ObjectVariables {
|
|
773
|
+
readonly totalArea: number;
|
|
774
|
+
readonly balconyArea: number;
|
|
775
|
+
readonly balconyTiles: boolean;
|
|
776
|
+
readonly gas: boolean;
|
|
777
|
+
readonly kitchenType: KitchenType;
|
|
778
|
+
readonly finishLevel: FinishLevel;
|
|
779
|
+
readonly roomsCount: number;
|
|
780
|
+
readonly bathroomsCount: number;
|
|
781
|
+
}
|
|
782
|
+
export declare function objectVariables(configuration: Configuration): ObjectVariables;
|
|
783
|
+
//#endregion
|
|
784
|
+
//#region src/variables/product.d.ts
|
|
785
|
+
export interface ProductVariables {
|
|
786
|
+
readonly price: number;
|
|
787
|
+
readonly waste: number;
|
|
788
|
+
readonly unit: ProductUnit;
|
|
789
|
+
}
|
|
790
|
+
export declare function productVariablesOf(product: Pick<PricingProduct, 'priceCents' | 'unit'>, wastePercent: number): ProductVariables;
|
|
791
|
+
export declare function productVariables(product: PricingProduct, category: PricingCategory): ProductVariables;
|
|
792
|
+
//#endregion
|
|
793
|
+
//#region src/variables/room.d.ts
|
|
794
|
+
export interface RoomVariables {
|
|
795
|
+
readonly length: number;
|
|
796
|
+
readonly width: number;
|
|
797
|
+
readonly height: number;
|
|
798
|
+
readonly floorArea: number;
|
|
799
|
+
readonly perimeter: number;
|
|
800
|
+
readonly wallArea: number;
|
|
801
|
+
readonly heatedFloor: boolean;
|
|
802
|
+
readonly roomType: RoomTypeCode;
|
|
803
|
+
}
|
|
804
|
+
export type RoomDimensions = Pick<RoomConfiguration, 'roomTypeCode' | 'lengthM' | 'widthM' | 'heightM' | 'heatedFloor'>;
|
|
805
|
+
export declare function roomVariables(room: RoomDimensions): RoomVariables;
|
|
806
|
+
//#endregion
|