kui-crm_actions 0.0.4 → 0.0.5
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/cjs/index.js +31 -3
- package/cjs/index.js.map +1 -1
- package/index.d.ts +336 -8
- package/index.js +20 -2
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
@@ -1,18 +1,83 @@
|
|
1
|
-
import
|
1
|
+
import * as kui_crm from 'kui-crm';
|
2
|
+
import { RoomType, CountryModel, RegionModel, CityModel, CountyModel, DistrictModel, LatLonParams, RoomTypes, RenovationType, RenovationStyle, ParkingTypes, InputParams, ResourceTypes as ResourceTypes$1, MeterTypes as MeterTypes$1, InputFileWithVisibilityFields, MeterFeaturesFormFields, ContractLinkModel, FileBodyRequest, ImageBodyRequest, CityParams, RenovationParams, RoomParams, PhoneParams, WifiParams, InternetProviderParams, TVTypes, CompanyAutocompleteFields, CountryAutocompleteFields, TaxesTypes as TaxesTypes$1, MetersCountParams, FillingInfoFormFields } from 'kui-crm';
|
2
3
|
import * as yup from 'yup';
|
3
|
-
import { Loader } from 'kui-utils';
|
4
|
+
import { Loader, MultistepForm } from 'kui-utils';
|
4
5
|
import { DateTime } from 'luxon';
|
5
6
|
import UploadFileParams, { UploadFileParams as UploadFileParams$1 } from 'kui-complex/dist/FileItem';
|
6
7
|
import { InputWithAddressFields } from 'kui-complex/dist/InputWithAddressAutocomplete';
|
7
8
|
|
9
|
+
declare type RoomModel = {
|
10
|
+
area: number | null;
|
11
|
+
room_type?: RoomType | null;
|
12
|
+
};
|
8
13
|
declare type WaterMeterTypes = "cold" | "hot";
|
9
14
|
declare type ElectricityMeterTypes = "T1" | "T2" | "T3";
|
10
15
|
declare type ResourceTypes = "water" | "electricity" | "gas" | "heating";
|
11
|
-
declare type
|
16
|
+
declare type TaxesTypes = "resident" | "nonresident" | "individual-entrepreneur" | "company" | "self-employed";
|
17
|
+
declare type MeterTypes = ElectricityMeterTypes | WaterMeterTypes | null;
|
18
|
+
declare type ApartmentMainInfoModelFields = {
|
19
|
+
country: CountryModel;
|
20
|
+
region: RegionModel;
|
21
|
+
city: CityModel;
|
22
|
+
county: CountyModel;
|
23
|
+
district: DistrictModel;
|
24
|
+
geolocation: LatLonParams;
|
25
|
+
address: string;
|
26
|
+
apartment_number: string | number;
|
27
|
+
post_index?: string;
|
28
|
+
floor: number | null;
|
29
|
+
floor_count: number;
|
30
|
+
room_type: RoomTypes | null;
|
31
|
+
num_entrance: string;
|
32
|
+
has_intercom: boolean | null;
|
33
|
+
intercom_code: string;
|
34
|
+
has_gate: boolean | null;
|
35
|
+
gate_code: string;
|
36
|
+
area: string | number | null;
|
37
|
+
living_area: string | number | null;
|
38
|
+
kitchen_area: string | number | null;
|
39
|
+
rooms_number: number | null;
|
40
|
+
bedrooms_number: number | null;
|
41
|
+
bathrooms_number: number | null;
|
42
|
+
restrooms_number: number | null;
|
43
|
+
combined_bathrooms_number: number | null;
|
44
|
+
ceiling_height: string | number | null;
|
45
|
+
number_of_windows: number | null;
|
46
|
+
renovation_year?: number | null;
|
47
|
+
renovation_type?: RenovationType | null;
|
48
|
+
renovation_style?: RenovationStyle | null;
|
49
|
+
rooms: RoomModel[];
|
50
|
+
};
|
51
|
+
declare type ApartmentDetailInfoModelFields = {
|
52
|
+
financial_personal_account: string;
|
53
|
+
max_electricity_counters: number | null;
|
54
|
+
max_gas_counters: number | null;
|
55
|
+
max_heating_counters: number | null;
|
56
|
+
max_water_counters: number | null;
|
57
|
+
has_barrier: boolean | null;
|
58
|
+
has_concierge: boolean | null;
|
59
|
+
has_security: boolean | null;
|
60
|
+
has_video_surveillance: boolean | null;
|
61
|
+
barrier_phone: string | null;
|
62
|
+
concierge_phone: string | null;
|
63
|
+
security_phone: string | null;
|
64
|
+
video_surveillance_phone: string | null;
|
65
|
+
home_phone: string | null;
|
66
|
+
wifi_name: string;
|
67
|
+
wifi_password: string;
|
68
|
+
internet_provider_link: string;
|
69
|
+
internet_provider_login: string;
|
70
|
+
internet_provider_password: string;
|
71
|
+
parking_type: ParkingTypes | null;
|
72
|
+
parking_number: string;
|
73
|
+
passenger_elevators_number: string | number | null;
|
74
|
+
service_elevators_number: string | number | null;
|
75
|
+
payer_code: string;
|
76
|
+
};
|
12
77
|
|
13
78
|
declare const getPartialMeterInfoFields: (resource: ResourceTypes, type?: MeterTypes | undefined) => InputParams<any>[];
|
14
79
|
|
15
|
-
declare const getPartialMeterInfoSchema: (valuesFields:
|
80
|
+
declare const getPartialMeterInfoSchema: (valuesFields: InputParams<any>[]) => yup.ObjectSchema<{
|
16
81
|
[x: string]: any;
|
17
82
|
}, yup.AnyObject, {
|
18
83
|
[x: string]: any;
|
@@ -49,6 +114,12 @@ type InspectionPartialMetersStepFields = {
|
|
49
114
|
meters: PartialMeterInfoFields[]
|
50
115
|
}
|
51
116
|
|
117
|
+
type ApartmentMetersStoreInterface = {
|
118
|
+
loader: Loader
|
119
|
+
fetchMeters: () => Promise<void>
|
120
|
+
meters: PartialMeterInfoFields[]
|
121
|
+
}
|
122
|
+
|
52
123
|
type InspectionTypes =
|
53
124
|
| "initial"
|
54
125
|
| "inventory"
|
@@ -95,6 +166,108 @@ type TransferInspectionFormFields = {
|
|
95
166
|
InspectionPartialMetersStepFields &
|
96
167
|
InspectionRoomsImagesFields
|
97
168
|
|
169
|
+
declare type InspectionAppraisalLiteModel = {
|
170
|
+
id: number;
|
171
|
+
date: string;
|
172
|
+
max_price: string;
|
173
|
+
min_price: string;
|
174
|
+
};
|
175
|
+
declare type InspectionImpairmentLiteModel = {
|
176
|
+
id: number;
|
177
|
+
damage: string;
|
178
|
+
wear_and_tear: string;
|
179
|
+
};
|
180
|
+
declare type ApartmentInspectionModel = {
|
181
|
+
id: number;
|
182
|
+
date: string;
|
183
|
+
inspection_type: InspectionTypes;
|
184
|
+
rental_contract?: ContractLinkModel;
|
185
|
+
appraisal: InspectionAppraisalLiteModel | null;
|
186
|
+
impairment: InspectionImpairmentLiteModel | null;
|
187
|
+
comment: string;
|
188
|
+
};
|
189
|
+
declare type CommonInspectionFields = {
|
190
|
+
based_on: number | null;
|
191
|
+
date: string;
|
192
|
+
inspection_type: InspectionTypes;
|
193
|
+
};
|
194
|
+
declare type PostApartmentInspectionRequest = {
|
195
|
+
based_on?: number;
|
196
|
+
date: string;
|
197
|
+
inspection_type: InspectionTypes;
|
198
|
+
initial?: InitialInspectionFieldsBody;
|
199
|
+
quarterly?: QuarterlyInspectionFieldsBody;
|
200
|
+
transfer?: TransferInspectionFieldsBody;
|
201
|
+
};
|
202
|
+
declare type InspectionMeterValueModel = {
|
203
|
+
value?: string | number | null;
|
204
|
+
T1?: string | number | null;
|
205
|
+
T2?: string | number | null;
|
206
|
+
T3?: string | number | null;
|
207
|
+
};
|
208
|
+
declare type PartialMeterModel = {
|
209
|
+
id: number;
|
210
|
+
passport_number: string;
|
211
|
+
meter_type?: MeterTypes;
|
212
|
+
resource_type: ResourceTypes;
|
213
|
+
values: InspectionMeterValueModel;
|
214
|
+
};
|
215
|
+
declare type InspectionMeterCommonFields = {
|
216
|
+
meter_type?: MeterTypes | null;
|
217
|
+
passport_number: string;
|
218
|
+
resource_type: ResourceTypes;
|
219
|
+
activation_date: string;
|
220
|
+
operating_account?: string | null;
|
221
|
+
company?: number;
|
222
|
+
passport: FileBodyRequest;
|
223
|
+
};
|
224
|
+
declare type InventoryMeterModel = {
|
225
|
+
values: InspectionMeterValueModel;
|
226
|
+
} & InspectionMeterCommonFields;
|
227
|
+
declare type InspectionFillingParams = {
|
228
|
+
feature: number;
|
229
|
+
description?: string;
|
230
|
+
serial_code?: string;
|
231
|
+
amount?: number | string | null;
|
232
|
+
photos: ImageBodyRequest[];
|
233
|
+
instruction?: FileBodyRequest | null;
|
234
|
+
};
|
235
|
+
declare type InitialInspectionFieldsBody = {
|
236
|
+
city: number;
|
237
|
+
} & Omit<Partial<ApartmentMainInfoModelFields>, "city">;
|
238
|
+
declare type QuarterlyInspectionFieldsBody = {
|
239
|
+
meters: PartialMeterModel[];
|
240
|
+
};
|
241
|
+
declare type TransferInspectionFieldsBody = {
|
242
|
+
transfer_type: TransferInspectionTypes;
|
243
|
+
meters: PartialMeterModel[];
|
244
|
+
};
|
245
|
+
declare type InventoryInspectionFieldsBody = {
|
246
|
+
country_of_residence: number | null;
|
247
|
+
administrative_company: number | null;
|
248
|
+
tax_type: TaxesTypes | null;
|
249
|
+
meters: InventoryMeterModel[];
|
250
|
+
filling: InspectionFillingParams[];
|
251
|
+
not_allowed_children: boolean;
|
252
|
+
not_allowed_pets: boolean;
|
253
|
+
additional_terms: string;
|
254
|
+
} & Partial<ApartmentDetailInfoModelFields>;
|
255
|
+
declare type InventoryInspectionPostBody = {
|
256
|
+
inventory: InventoryInspectionFieldsBody;
|
257
|
+
rooms_with_photos: InspectionRoomPhotoRequest[];
|
258
|
+
} & CommonInspectionFields;
|
259
|
+
declare type InitialInspectionPostBody = {
|
260
|
+
initial: InitialInspectionFieldsBody;
|
261
|
+
rooms_with_photos: InspectionRoomPhotoRequest[];
|
262
|
+
} & CommonInspectionFields;
|
263
|
+
declare type QuarterlyInspectionPostBody = {
|
264
|
+
quarterly: QuarterlyInspectionFieldsBody;
|
265
|
+
rooms_with_photos: InspectionRoomPhotoRequest[];
|
266
|
+
} & CommonInspectionFields;
|
267
|
+
declare type TransferInspectionPostBody = {
|
268
|
+
transfer: TransferInspectionFieldsBody;
|
269
|
+
rooms_with_photos: InspectionRoomPhotoRequest[];
|
270
|
+
} & CommonInspectionFields;
|
98
271
|
declare type InspectionRoomPhotoRequest = {
|
99
272
|
room_purpose: InspectionRoomPhotoTypes;
|
100
273
|
comment?: string;
|
@@ -173,7 +346,7 @@ type ApartmentPaymentsFormFields = {
|
|
173
346
|
communalServicesAccount: string
|
174
347
|
company: CompanyAutocompleteFields | null
|
175
348
|
countryOfResidence: CountryAutocompleteFields | null
|
176
|
-
taxesType: TaxesTypes | null
|
349
|
+
taxesType: TaxesTypes$1 | null
|
177
350
|
}
|
178
351
|
|
179
352
|
type AdditionalInfoStepFields = {
|
@@ -222,12 +395,70 @@ declare const inspectionsRequests: {
|
|
222
395
|
createInventoryInspection(data: InventoryInspectionFormFields, apartmentId: number, loader: Loader): Promise<number | null | undefined>;
|
223
396
|
};
|
224
397
|
|
225
|
-
declare
|
226
|
-
|
398
|
+
declare const inspectionsRequestBody: {
|
399
|
+
getPostBodyInitialInspection(inspection: InitialInspectionFormFields, roomsImages: InspectionRoomPhotoRequest[]): InitialInspectionPostBody;
|
400
|
+
getInitialInspectionFields(inspection: InitialInspectionInfoFields): InitialInspectionFieldsBody;
|
401
|
+
getPostBodyQuarterlyInspection(inspection: QuarterlyInspectionFormFields, roomsImages: InspectionRoomPhotoRequest[]): QuarterlyInspectionPostBody;
|
402
|
+
getPostBodyTransferInspection(inspection: TransferInspectionFormFields, roomsImages: InspectionRoomPhotoRequest[]): TransferInspectionPostBody;
|
403
|
+
getPartialInspectionMeters(meters: PartialMeterInfoFields[]): {
|
404
|
+
meters: {
|
405
|
+
id: number;
|
406
|
+
resource_type: kui_crm.ResourceTypes;
|
407
|
+
meter_type: kui_crm.MeterTypes | undefined;
|
408
|
+
passport_number: string;
|
409
|
+
values: {
|
410
|
+
[key: string]: any;
|
411
|
+
};
|
412
|
+
}[];
|
413
|
+
};
|
414
|
+
getPostBodyInventoryInspection(inspection: InventoryInspectionFormFields, roomsImages: InspectionRoomPhotoRequest[], fillingFiles: FileBodyRequest[], metersFiles: FileBodyRequest[], fillingImages: ImageBodyRequest[][]): InventoryInspectionPostBody;
|
415
|
+
getInventoryInspectionMeters(meters: InspectionMeterFields$1[], metersFiles: FileBodyRequest[]): {
|
416
|
+
meters: {
|
417
|
+
passport: FileBodyRequest;
|
418
|
+
values: {
|
419
|
+
[key: string]: any;
|
420
|
+
};
|
421
|
+
id: number | undefined;
|
422
|
+
meter_type: kui_crm.MeterTypes | undefined;
|
423
|
+
passport_number: string;
|
424
|
+
resource_type: kui_crm.ResourceTypes;
|
425
|
+
activation_date: string;
|
426
|
+
operating_account: string | null | undefined;
|
427
|
+
company: number | undefined;
|
428
|
+
tariff: number | undefined;
|
429
|
+
}[];
|
430
|
+
};
|
431
|
+
getMeterCommonFields(meter: InspectionMeterFields$1): {
|
432
|
+
id: number | undefined;
|
433
|
+
meter_type: kui_crm.MeterTypes | undefined;
|
434
|
+
passport_number: string;
|
435
|
+
resource_type: kui_crm.ResourceTypes;
|
436
|
+
activation_date: string;
|
437
|
+
operating_account: string | null | undefined;
|
438
|
+
company: number | undefined;
|
439
|
+
tariff: number | undefined;
|
440
|
+
};
|
441
|
+
getMeterValues(initialValue?: string | number | null | undefined, lastValue?: string | number | null | undefined): {
|
442
|
+
[key: string]: any;
|
443
|
+
};
|
227
444
|
};
|
228
445
|
|
229
446
|
declare const getBasicApartmentInfoFields: (handlePlaceSelect: (coords: google.maps.LatLngLiteral) => void, settings?: InspectionFieldsSettings | undefined) => InputParams<BasicApartmentInfoStepFields>[];
|
230
447
|
|
448
|
+
declare const BasicApartmentInfoFieldsSchema: {
|
449
|
+
apartment: yup.ObjectSchema<{
|
450
|
+
address: string;
|
451
|
+
}, yup.AnyObject, {
|
452
|
+
address: undefined;
|
453
|
+
}, "">;
|
454
|
+
apartmentNumber: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
455
|
+
city: yup.ObjectSchema<{
|
456
|
+
name: string;
|
457
|
+
}, yup.AnyObject, {
|
458
|
+
name: undefined;
|
459
|
+
}, "">;
|
460
|
+
zipCode: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
461
|
+
};
|
231
462
|
declare const BasicApartmentInfoStepSchema: yup.ObjectSchema<{
|
232
463
|
apartment: {
|
233
464
|
address: string;
|
@@ -250,6 +481,26 @@ declare const BasicApartmentInfoStepSchema: yup.ObjectSchema<{
|
|
250
481
|
|
251
482
|
declare const getDetailApartmentInfoFields: (roomsCount?: number | null | undefined, settings?: InspectionFieldsSettings | undefined) => InputParams<DetailApartmentInfoStepFields>[];
|
252
483
|
|
484
|
+
declare const DetailApartmentInfoFieldsSchema: {
|
485
|
+
area: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
486
|
+
livingArea: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
487
|
+
kitchenArea: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
488
|
+
rooms: yup.ArraySchema<{
|
489
|
+
type: string;
|
490
|
+
area: number;
|
491
|
+
}[] | undefined, yup.AnyObject, "", "">;
|
492
|
+
ceilingHeight: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
493
|
+
numberOfWindows: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
494
|
+
renovation: yup.ObjectSchema<{
|
495
|
+
year: number;
|
496
|
+
type: string;
|
497
|
+
style: string;
|
498
|
+
}, yup.AnyObject, {
|
499
|
+
year: undefined;
|
500
|
+
type: undefined;
|
501
|
+
style: undefined;
|
502
|
+
}, "">;
|
503
|
+
};
|
253
504
|
declare const DetailApartmentInfoStepSchema: yup.ObjectSchema<{
|
254
505
|
area: number;
|
255
506
|
livingArea: number;
|
@@ -281,6 +532,15 @@ declare const DetailApartmentInfoStepSchema: yup.ObjectSchema<{
|
|
281
532
|
|
282
533
|
declare const getRoomsApartmentInfoFields: (settings?: InspectionFieldsSettings | undefined) => InputParams<RoomsApartmentInfoStepFields>[];
|
283
534
|
|
535
|
+
declare const RoomsApartmentInfoFieldsSchema: {
|
536
|
+
floor: yup.NumberSchema<number | undefined, yup.AnyObject, undefined, "">;
|
537
|
+
floorCount: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
538
|
+
roomsNumber: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
539
|
+
bedroomsNumber: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
540
|
+
bathroomsNumber: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
541
|
+
restroomsNumber: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
542
|
+
combinedBathroomsNumber: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
543
|
+
};
|
284
544
|
declare const RoomsApartmentInfoStepSchema: yup.ObjectSchema<{
|
285
545
|
floor: number | undefined;
|
286
546
|
floorCount: number;
|
@@ -301,6 +561,14 @@ declare const RoomsApartmentInfoStepSchema: yup.ObjectSchema<{
|
|
301
561
|
|
302
562
|
declare const getSecurityApartmentInfoFields: (settings?: InspectionFieldsSettings | undefined) => InputParams<SecurityApartmentInfoStepFields>[];
|
303
563
|
|
564
|
+
declare const SecurityApartmentInfoFieldsSchema: {
|
565
|
+
typeOfRoom: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
566
|
+
entrance: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
567
|
+
hasIntercom: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
568
|
+
intercomCode: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
569
|
+
hasGate: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
570
|
+
gateCode: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
571
|
+
};
|
304
572
|
declare const SecurityApartmentInfoStepSchema: yup.ObjectSchema<{
|
305
573
|
typeOfRoom: string;
|
306
574
|
entrance: string;
|
@@ -320,6 +588,9 @@ declare const SecurityApartmentInfoStepSchema: yup.ObjectSchema<{
|
|
320
588
|
declare const getApartmentPaymentFields: (settings?: InspectionFieldsSettings | undefined) => any[];
|
321
589
|
declare const getAdditionalInfoStepFields: (settings?: InspectionFieldsSettings | undefined) => InputParams<AdditionalInfoStepFields>[];
|
322
590
|
|
591
|
+
declare const AdditionalInfoFieldsSchema: {
|
592
|
+
taxesType: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
593
|
+
};
|
323
594
|
declare const AdditionalInfoStepSchema: yup.ObjectSchema<{
|
324
595
|
taxesType: string;
|
325
596
|
}, yup.AnyObject, {
|
@@ -328,6 +599,36 @@ declare const AdditionalInfoStepSchema: yup.ObjectSchema<{
|
|
328
599
|
|
329
600
|
declare const getHouseServicesInfoStep: (settings?: InspectionFieldsSettings | undefined) => InputParams<HouseServicesInfoStepFields>[];
|
330
601
|
|
602
|
+
declare const HouseServicesInfoFieldsSchema: {
|
603
|
+
hasBarrier: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
604
|
+
barrierPhone: yup.ObjectSchema<{
|
605
|
+
phoneNumber: string | null | undefined;
|
606
|
+
} | null, yup.AnyObject, {
|
607
|
+
phoneNumber: undefined;
|
608
|
+
}, "">;
|
609
|
+
hasConcierge: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
610
|
+
conciergePhone: yup.ObjectSchema<{
|
611
|
+
phoneNumber: string | null | undefined;
|
612
|
+
} | null, yup.AnyObject, {
|
613
|
+
phoneNumber: undefined;
|
614
|
+
}, "">;
|
615
|
+
hasSecurity: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
616
|
+
securityPhone: yup.ObjectSchema<{
|
617
|
+
phoneNumber: string | null | undefined;
|
618
|
+
} | null, yup.AnyObject, {
|
619
|
+
phoneNumber: undefined;
|
620
|
+
}, "">;
|
621
|
+
hasVideoControl: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
622
|
+
videoControlPhone: yup.ObjectSchema<{
|
623
|
+
phoneNumber: string | null | undefined;
|
624
|
+
} | null, yup.AnyObject, {
|
625
|
+
phoneNumber: undefined;
|
626
|
+
}, "">;
|
627
|
+
parkingType: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
|
628
|
+
parkingNumber: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
|
629
|
+
passengerElevatorsCount: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
630
|
+
serviceElevatorsCount: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
|
631
|
+
};
|
331
632
|
declare const HouseServicesInfoStepSchema: yup.ObjectSchema<{
|
332
633
|
hasBarrier: string;
|
333
634
|
barrierPhone: {
|
@@ -374,6 +675,19 @@ declare const HouseServicesInfoStepSchema: yup.ObjectSchema<{
|
|
374
675
|
|
375
676
|
declare const getMetersInfoStepFields: (settings?: InspectionFieldsSettings | undefined) => InputParams<MetersInfoStepFields>[];
|
376
677
|
|
678
|
+
declare const MetersInfoFieldsSchema: {
|
679
|
+
maxMeters: yup.ObjectSchema<{
|
680
|
+
water: number;
|
681
|
+
electricity: number;
|
682
|
+
gas: number;
|
683
|
+
heating: number;
|
684
|
+
}, yup.AnyObject, {
|
685
|
+
water: undefined;
|
686
|
+
electricity: undefined;
|
687
|
+
gas: undefined;
|
688
|
+
heating: undefined;
|
689
|
+
}, "">;
|
690
|
+
};
|
377
691
|
declare const MetersInfoStepSchema: yup.ObjectSchema<{
|
378
692
|
maxMeters: {
|
379
693
|
water: number;
|
@@ -392,6 +706,14 @@ declare const MetersInfoStepSchema: yup.ObjectSchema<{
|
|
392
706
|
|
393
707
|
declare const getTelecommunicationsInfoStepFields: (settings?: InspectionFieldsSettings | undefined) => InputParams<TelecommunicationsInfoStepFields>[];
|
394
708
|
|
709
|
+
declare const TelecommunicationsInfoFieldsSchema: {
|
710
|
+
tvType: yup.StringSchema<string, yup.AnyObject, undefined, "">;
|
711
|
+
homePhone: yup.ObjectSchema<{
|
712
|
+
phoneNumber: string | null | undefined;
|
713
|
+
} | null, yup.AnyObject, {
|
714
|
+
phoneNumber: undefined;
|
715
|
+
}, "">;
|
716
|
+
};
|
395
717
|
declare const TelecommunicationsInfoStepSchema: yup.ObjectSchema<{
|
396
718
|
tvType: string;
|
397
719
|
homePhone: {
|
@@ -404,4 +726,10 @@ declare const TelecommunicationsInfoStepSchema: yup.ObjectSchema<{
|
|
404
726
|
};
|
405
727
|
}, "">;
|
406
728
|
|
407
|
-
|
729
|
+
declare const useMetersValues: (formStore: MultistepForm<any>, metersStore: ApartmentMetersStoreInterface) => void;
|
730
|
+
|
731
|
+
declare type InspectionFieldsSettings = {
|
732
|
+
[key: string]: InputParams<any>;
|
733
|
+
};
|
734
|
+
|
735
|
+
export { AdditionalInfoFieldsSchema, AdditionalInfoStepFields, AdditionalInfoStepSchema, ApartmentDetailInfoModelFields, ApartmentInspectionModel, ApartmentMainInfoModelFields, ApartmentPaymentsFormFields, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepFields, BasicApartmentInfoStepSchema, CommonInspectionFields, CommonInspectionFormFields, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepFields, DetailApartmentInfoStepSchema, ElectricityMeterTypes, FillingInfoStepFields, FillingListInfoStepFields, HouseServicesInfoFieldsSchema, HouseServicesInfoStepFields, HouseServicesInfoStepSchema, InitialInspectionFieldsBody, InitialInspectionFormFields, InitialInspectionInfoFields, InitialInspectionPostBody, InspectionAppraisalLiteModel, InspectionFieldsSettings, InspectionFillingParams, InspectionImpairmentLiteModel, InspectionMeterCommonFields, InspectionMeterFields$1 as InspectionMeterFields, InspectionMeterValueModel, InspectionMetersStepFields$1 as InspectionMetersStepFields, InspectionPartialMetersStepFields, InspectionRoomImagesParams, InspectionRoomPhotoRequest, InspectionRoomPhotoTypes, InspectionRoomsImagesFields, InspectionTypes, InventoryInspectionFieldsBody, InventoryInspectionFormFields, InventoryInspectionPostBody, InventoryMeterModel, MeterTypes, MetersInfoFieldsSchema, MetersInfoStepFields, MetersInfoStepSchema, PartialMeterInfoFields, PartialMeterInfoStepProps, PartialMeterModel, PostApartmentInspectionRequest, QuarterlyInspectionFieldsBody, QuarterlyInspectionFormFields, QuarterlyInspectionPostBody, ResourceTypes, RoomModel, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepFields, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepFields, SecurityApartmentInfoStepSchema, TaxesTypes, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepFields, TelecommunicationsInfoStepSchema, TransferInspectionFieldsBody, TransferInspectionFormFields, TransferInspectionPostBody, TransferInspectionTypes, WaterMeterTypes, getAdditionalInfoStepFields, getApartmentPaymentFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, inspectionsRequestBody, inspectionsRequests, useMetersValues };
|
package/index.js
CHANGED
@@ -4,6 +4,7 @@ import { requests, uploadImages, uploadFiles, CountryAutocomplete, RegionAutocom
|
|
4
4
|
import to from 'await-to-js';
|
5
5
|
import { DateTime } from 'luxon';
|
6
6
|
import { InputWithAddressAutocomplete, DependentInput, CheckboxWithController, InputPhoneWithForm } from 'kui-complex';
|
7
|
+
import { useEffect } from 'react';
|
7
8
|
|
8
9
|
/******************************************************************************
|
9
10
|
Copyright (c) Microsoft Corporation.
|
@@ -101,7 +102,10 @@ var getPartialMeterInfoFields = function (resource, type) {
|
|
101
102
|
};
|
102
103
|
|
103
104
|
var getPartialMeterInfoSchema = function (valuesFields) {
|
104
|
-
var
|
105
|
+
var filteredFields = valuesFields
|
106
|
+
.filter(function (field) { return field.type === "number"; })
|
107
|
+
.map(function (field) { return field.name; });
|
108
|
+
var valuesSchema = filteredFields.map(function (field) {
|
105
109
|
var _a;
|
106
110
|
return (_a = {},
|
107
111
|
_a[field] = yup
|
@@ -607,5 +611,19 @@ var TelecommunicationsInfoStepSchema = yup
|
|
607
611
|
.object()
|
608
612
|
.shape(TelecommunicationsInfoFieldsSchema, [["homePhone", "homePhone"]]);
|
609
613
|
|
610
|
-
|
614
|
+
var useMetersValues = function (formStore, metersStore) {
|
615
|
+
useEffect(function () {
|
616
|
+
var _a, _b;
|
617
|
+
if (!((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.meters) === null || _b === void 0 ? void 0 : _b.length)) {
|
618
|
+
metersStore.fetchMeters();
|
619
|
+
}
|
620
|
+
}, []);
|
621
|
+
useEffect(function () {
|
622
|
+
if (!metersStore.loader.isLoading) {
|
623
|
+
formStore.updateFormFields({ meters: metersStore.meters });
|
624
|
+
}
|
625
|
+
}, [metersStore.meters, metersStore.loader.isLoading]);
|
626
|
+
};
|
627
|
+
|
628
|
+
export { AdditionalInfoFieldsSchema, AdditionalInfoStepSchema, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepSchema, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepSchema, HouseServicesInfoFieldsSchema, HouseServicesInfoStepSchema, MetersInfoFieldsSchema, MetersInfoStepSchema, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepSchema, getAdditionalInfoStepFields, getApartmentPaymentFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, inspectionsRequestBody, inspectionsRequests, useMetersValues };
|
611
629
|
//# sourceMappingURL=index.js.map
|