@roomwise/calc-engine 0.2.0 → 0.3.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/README.md +1 -2
- package/dist/index.cjs +0 -5
- package/dist/index.d.cts +0 -3
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -136,7 +136,6 @@ const preview = previewRule({
|
|
|
136
136
|
totalAreaSqm: 62,
|
|
137
137
|
balconyAreaSqm: 4,
|
|
138
138
|
balconyTiles: true,
|
|
139
|
-
gas: false,
|
|
140
139
|
kitchenType: 'SEPARATE',
|
|
141
140
|
finishLevel: 'PRE_FINISH',
|
|
142
141
|
roomsCount: 1,
|
|
@@ -202,7 +201,7 @@ roomType == 'KITCHEN' ? ceil(floorArea / 2) : 0
|
|
|
202
201
|
| product | `waste` | number, a fraction (5% is `0.05`): the product override, else the category value |
|
|
203
202
|
| product | `unit` | `SQM`, `LINEAR_M`, `PIECE` |
|
|
204
203
|
| object | `totalArea`, `balconyArea` | number |
|
|
205
|
-
| object | `balconyTiles
|
|
204
|
+
| object | `balconyTiles` | boolean |
|
|
206
205
|
| object | `kitchenType` | `SEPARATE`, `KITCHEN_LIVING` |
|
|
207
206
|
| object | `finishLevel` | `ROUGH`, `PRE_FINISH` |
|
|
208
207
|
| object | `roomsCount`, `bathroomsCount` | number (living rooms, bedrooms and kitchen-living rooms count as rooms) |
|
package/dist/index.cjs
CHANGED
|
@@ -208,7 +208,6 @@ function objectVariables(configuration) {
|
|
|
208
208
|
totalArea: configuration.totalAreaSqm,
|
|
209
209
|
balconyArea: configuration.balconyAreaSqm,
|
|
210
210
|
balconyTiles: configuration.balconyTiles,
|
|
211
|
-
gas: configuration.gas,
|
|
212
211
|
kitchenType: configuration.kitchenType,
|
|
213
212
|
finishLevel: configuration.finishLevel,
|
|
214
213
|
roomsCount: configuration.rooms.filter((room) => COUNTED_AS_ROOMS.includes(room.roomTypeCode)).length,
|
|
@@ -855,7 +854,6 @@ const ConfigurationSchema = zod.z.object({
|
|
|
855
854
|
totalAreaSqm: zod.z.number().positive(),
|
|
856
855
|
balconyAreaSqm: zod.z.number().min(0),
|
|
857
856
|
balconyTiles: zod.z.boolean(),
|
|
858
|
-
gas: zod.z.boolean(),
|
|
859
857
|
kitchenType: KitchenTypeSchema,
|
|
860
858
|
rooms: zod.z.array(RoomConfigurationSchema),
|
|
861
859
|
options: zod.z.array(OptionSelectionSchema),
|
|
@@ -1031,7 +1029,6 @@ const RuleSampleSchema = zod.z.object({
|
|
|
1031
1029
|
totalAreaSqm: zod.z.number().positive(),
|
|
1032
1030
|
balconyAreaSqm: zod.z.number().min(0),
|
|
1033
1031
|
balconyTiles: zod.z.boolean(),
|
|
1034
|
-
gas: zod.z.boolean(),
|
|
1035
1032
|
kitchenType: KitchenTypeSchema,
|
|
1036
1033
|
finishLevel: FinishLevelSchema,
|
|
1037
1034
|
roomsCount: zod.z.int().min(0),
|
|
@@ -1190,7 +1187,6 @@ function objectScope({ object }) {
|
|
|
1190
1187
|
totalArea: object.totalAreaSqm,
|
|
1191
1188
|
balconyArea: object.balconyAreaSqm,
|
|
1192
1189
|
balconyTiles: object.balconyTiles,
|
|
1193
|
-
gas: object.gas,
|
|
1194
1190
|
kitchenType: object.kitchenType,
|
|
1195
1191
|
finishLevel: object.finishLevel,
|
|
1196
1192
|
roomsCount: object.roomsCount,
|
|
@@ -1319,7 +1315,6 @@ const FORMULA_SCOPE_VARIABLES = {
|
|
|
1319
1315
|
number("totalArea"),
|
|
1320
1316
|
number("balconyArea"),
|
|
1321
1317
|
boolean("balconyTiles"),
|
|
1322
|
-
boolean("gas"),
|
|
1323
1318
|
enumeration("kitchenType", KitchenTypeSchema.options),
|
|
1324
1319
|
enumeration("finishLevel", FinishLevelSchema.options),
|
|
1325
1320
|
number("roomsCount"),
|
package/dist/index.d.cts
CHANGED
|
@@ -132,7 +132,6 @@ export declare const ConfigurationSchema: z.ZodObject<{
|
|
|
132
132
|
totalAreaSqm: z.ZodNumber;
|
|
133
133
|
balconyAreaSqm: z.ZodNumber;
|
|
134
134
|
balconyTiles: z.ZodBoolean;
|
|
135
|
-
gas: z.ZodBoolean;
|
|
136
135
|
kitchenType: z.ZodEnum<{
|
|
137
136
|
KITCHEN_LIVING: "KITCHEN_LIVING";
|
|
138
137
|
SEPARATE: "SEPARATE";
|
|
@@ -338,7 +337,6 @@ export declare const RuleSampleSchema: z.ZodObject<{
|
|
|
338
337
|
totalAreaSqm: z.ZodNumber;
|
|
339
338
|
balconyAreaSqm: z.ZodNumber;
|
|
340
339
|
balconyTiles: z.ZodBoolean;
|
|
341
|
-
gas: z.ZodBoolean;
|
|
342
340
|
kitchenType: z.ZodEnum<{
|
|
343
341
|
KITCHEN_LIVING: "KITCHEN_LIVING";
|
|
344
342
|
SEPARATE: "SEPARATE";
|
|
@@ -773,7 +771,6 @@ export interface ObjectVariables {
|
|
|
773
771
|
readonly totalArea: number;
|
|
774
772
|
readonly balconyArea: number;
|
|
775
773
|
readonly balconyTiles: boolean;
|
|
776
|
-
readonly gas: boolean;
|
|
777
774
|
readonly kitchenType: KitchenType;
|
|
778
775
|
readonly finishLevel: FinishLevel;
|
|
779
776
|
readonly roomsCount: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -132,7 +132,6 @@ export declare const ConfigurationSchema: z.ZodObject<{
|
|
|
132
132
|
totalAreaSqm: z.ZodNumber;
|
|
133
133
|
balconyAreaSqm: z.ZodNumber;
|
|
134
134
|
balconyTiles: z.ZodBoolean;
|
|
135
|
-
gas: z.ZodBoolean;
|
|
136
135
|
kitchenType: z.ZodEnum<{
|
|
137
136
|
KITCHEN_LIVING: "KITCHEN_LIVING";
|
|
138
137
|
SEPARATE: "SEPARATE";
|
|
@@ -338,7 +337,6 @@ export declare const RuleSampleSchema: z.ZodObject<{
|
|
|
338
337
|
totalAreaSqm: z.ZodNumber;
|
|
339
338
|
balconyAreaSqm: z.ZodNumber;
|
|
340
339
|
balconyTiles: z.ZodBoolean;
|
|
341
|
-
gas: z.ZodBoolean;
|
|
342
340
|
kitchenType: z.ZodEnum<{
|
|
343
341
|
KITCHEN_LIVING: "KITCHEN_LIVING";
|
|
344
342
|
SEPARATE: "SEPARATE";
|
|
@@ -773,7 +771,6 @@ export interface ObjectVariables {
|
|
|
773
771
|
readonly totalArea: number;
|
|
774
772
|
readonly balconyArea: number;
|
|
775
773
|
readonly balconyTiles: boolean;
|
|
776
|
-
readonly gas: boolean;
|
|
777
774
|
readonly kitchenType: KitchenType;
|
|
778
775
|
readonly finishLevel: FinishLevel;
|
|
779
776
|
readonly roomsCount: number;
|
package/dist/index.js
CHANGED
|
@@ -183,7 +183,6 @@ function objectVariables(configuration) {
|
|
|
183
183
|
totalArea: configuration.totalAreaSqm,
|
|
184
184
|
balconyArea: configuration.balconyAreaSqm,
|
|
185
185
|
balconyTiles: configuration.balconyTiles,
|
|
186
|
-
gas: configuration.gas,
|
|
187
186
|
kitchenType: configuration.kitchenType,
|
|
188
187
|
finishLevel: configuration.finishLevel,
|
|
189
188
|
roomsCount: configuration.rooms.filter((room) => COUNTED_AS_ROOMS.includes(room.roomTypeCode)).length,
|
|
@@ -830,7 +829,6 @@ const ConfigurationSchema = z.object({
|
|
|
830
829
|
totalAreaSqm: z.number().positive(),
|
|
831
830
|
balconyAreaSqm: z.number().min(0),
|
|
832
831
|
balconyTiles: z.boolean(),
|
|
833
|
-
gas: z.boolean(),
|
|
834
832
|
kitchenType: KitchenTypeSchema,
|
|
835
833
|
rooms: z.array(RoomConfigurationSchema),
|
|
836
834
|
options: z.array(OptionSelectionSchema),
|
|
@@ -1006,7 +1004,6 @@ const RuleSampleSchema = z.object({
|
|
|
1006
1004
|
totalAreaSqm: z.number().positive(),
|
|
1007
1005
|
balconyAreaSqm: z.number().min(0),
|
|
1008
1006
|
balconyTiles: z.boolean(),
|
|
1009
|
-
gas: z.boolean(),
|
|
1010
1007
|
kitchenType: KitchenTypeSchema,
|
|
1011
1008
|
finishLevel: FinishLevelSchema,
|
|
1012
1009
|
roomsCount: z.int().min(0),
|
|
@@ -1165,7 +1162,6 @@ function objectScope({ object }) {
|
|
|
1165
1162
|
totalArea: object.totalAreaSqm,
|
|
1166
1163
|
balconyArea: object.balconyAreaSqm,
|
|
1167
1164
|
balconyTiles: object.balconyTiles,
|
|
1168
|
-
gas: object.gas,
|
|
1169
1165
|
kitchenType: object.kitchenType,
|
|
1170
1166
|
finishLevel: object.finishLevel,
|
|
1171
1167
|
roomsCount: object.roomsCount,
|
|
@@ -1294,7 +1290,6 @@ const FORMULA_SCOPE_VARIABLES = {
|
|
|
1294
1290
|
number("totalArea"),
|
|
1295
1291
|
number("balconyArea"),
|
|
1296
1292
|
boolean("balconyTiles"),
|
|
1297
|
-
boolean("gas"),
|
|
1298
1293
|
enumeration("kitchenType", KitchenTypeSchema.options),
|
|
1299
1294
|
enumeration("finishLevel", FinishLevelSchema.options),
|
|
1300
1295
|
number("roomsCount"),
|