kui-crm_actions 0.0.60 → 0.0.62

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as kui_crm from 'kui-crm';
2
- import { ResourceTypes, MeterTypes, InputParams, InputFileWithVisibilityFields, MeterFeaturesFormFields, ContractLinkModel, ImageBodyRequest, FileBodyRequest, RoomType, ApartmentMainInfoModelFields, TaxesTypes, ApartmentDetailInfoModelFields, CityParams, RoomTypes, RenovationParams, RoomParams, PhoneParams, ParkingTypes as ParkingTypes$1, WifiParams, InternetProviderParams, TVTypes, CompanyAutocompleteFields, CountryAutocompleteFields, MetersCountParams, FillingTagsAutocompleteFields, ApartmentFillingVariants, FillingInfoFormFields as FillingInfoFormFields$1, GeolocationParams } from 'kui-crm';
2
+ import { InputParams, ResourceTypes, MeterTypes, InputFileWithVisibilityFields, MeterFeaturesFormFields, InspectionTypes, InspectionRoomPhotoTypes, ParkingTypes, ContractLinkModel, ImageBodyRequest, FileBodyRequest, RoomType, ApartmentMainInfoModelFields, TaxesTypes, ApartmentDetailInfoModelFields, CityParams, RoomTypes, RenovationParams, RoomParams, PhoneParams, WifiParams, InternetProviderParams, TVTypes, CompanyAutocompleteFields, CountryAutocompleteFields, MetersCountParams, FillingTagsAutocompleteFields, ApartmentFillingVariants, FillingInfoFormFields as FillingInfoFormFields$1, GeolocationParams } from 'kui-crm';
3
3
  import { DateTime } from 'luxon';
4
4
  import { Loader, MultistepForm, PhoneParams as PhoneParams$1 } from 'kui-utils';
5
5
  import * as yup from 'yup';
@@ -7,8 +7,6 @@ import UploadFileParams$2, { UploadFileParams as UploadFileParams$1 } from 'kui-
7
7
  import { InputWithAddressFields } from 'kui-complex/dist/InputWithAddressAutocomplete';
8
8
  import { ReactElement } from 'react';
9
9
 
10
- declare const getPartialMeterInfoFields: (resource: ResourceTypes, type?: MeterTypes | undefined, name?: string | undefined, settings?: any) => InputParams<any>[];
11
-
12
10
  declare const getPartialMeterInfoSchema: (valuesFields: InputParams<any>[]) => yup.ObjectSchema<{
13
11
  [x: string]: any;
14
12
  }, yup.AnyObject, {
@@ -74,27 +72,6 @@ type ApartmentMetersStoreInterface = {
74
72
  meters: PartialMeterInfoFields[]
75
73
  }
76
74
 
77
- declare type ParkingTypes = "public" | "house" | "underground" | "multi_level";
78
-
79
- type InspectionTypes =
80
- | "initial"
81
- | "inventory"
82
- | "transfer"
83
- | "regular"
84
- | "appraisal"
85
- | "impairments"
86
-
87
- type InspectionRoomPhotoTypes =
88
- | "kitchen"
89
- | "bathroom"
90
- | "room"
91
- | "bedroom"
92
- | "entrance"
93
- | "others"
94
- | "toilet"
95
- | "combined_bathroom"
96
- | "keys"
97
-
98
75
  type CommonInspectionFormFields = {
99
76
  date: DateTime
100
77
  basedOn?: number
@@ -234,6 +211,7 @@ declare type InspectionFillingParams = {
234
211
  instruction?: FileBodyRequest | null;
235
212
  };
236
213
  declare type InitialInspectionRoomParams = {
214
+ id: number;
237
215
  room_type?: RoomType | null;
238
216
  order_number?: number;
239
217
  };
@@ -289,7 +267,7 @@ type BasicApartmentInfoStepFields = {
289
267
  }
290
268
 
291
269
  type SecurityApartmentInfoStepFields = {
292
- typeOfRoom: RoomTypes | null
270
+ typeOfObject: RoomTypes | null
293
271
  entrance: string
294
272
  hasIntercom: boolean | null
295
273
  intercomCode: string
@@ -335,7 +313,7 @@ type HouseServicesInfoStepFields = {
335
313
  securityPhone: PhoneParams | null
336
314
  hasVideoControl: boolean | null
337
315
  videoControlPhone: PhoneParams | null
338
- parkingType: ParkingTypes$1 | null
316
+ parkingType: ParkingTypes | null
339
317
  parkingNumber: string
340
318
  passengerElevatorsCount: number | null
341
319
  serviceElevatorsCount: number | null
@@ -413,7 +391,7 @@ declare const inspectionsRequests: {
413
391
  createTransferInspection(data: TransferInspectionFormFields, apartmentId: number, loader: Loader): Promise<number | null | undefined>;
414
392
  createInventoryInspection(data: InventoryInspectionFormFields, apartmentId: number, loader: Loader): Promise<number | null | undefined>;
415
393
  getRoomParams(room: InspectionRoomImagesParams, photos?: ImageBodyRequest[] | undefined): {
416
- purpose: InspectionRoomPhotoTypes;
394
+ purpose: kui_crm.InspectionRoomPhotoTypes;
417
395
  comment: string;
418
396
  photos: ImageBodyRequest[];
419
397
  };
@@ -605,7 +583,7 @@ declare const RoomsApartmentInfoStepSchema: yup.ObjectSchema<{
605
583
  declare const getSecurityApartmentInfoFields: (settings?: InspectionFieldsSettings | undefined) => InputParams<SecurityApartmentInfoStepFields>[];
606
584
 
607
585
  declare const SecurityApartmentInfoFieldsSchema: {
608
- typeOfRoom: yup.StringSchema<string, yup.AnyObject, undefined, "">;
586
+ typeOfObject: yup.StringSchema<string, yup.AnyObject, undefined, "">;
609
587
  entrance: yup.StringSchema<string, yup.AnyObject, undefined, "">;
610
588
  hasIntercom: yup.StringSchema<string, yup.AnyObject, undefined, "">;
611
589
  intercomCode: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
@@ -615,7 +593,7 @@ declare const SecurityApartmentInfoFieldsSchema: {
615
593
  parkingNumber: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
616
594
  };
617
595
  declare const SecurityApartmentInfoStepSchema: yup.ObjectSchema<{
618
- typeOfRoom: string;
596
+ typeOfObject: string;
619
597
  entrance: string;
620
598
  hasIntercom: string;
621
599
  intercomCode: string | null | undefined;
@@ -624,7 +602,7 @@ declare const SecurityApartmentInfoStepSchema: yup.ObjectSchema<{
624
602
  parkingType: string | null | undefined;
625
603
  parkingNumber: string | null | undefined;
626
604
  }, yup.AnyObject, {
627
- typeOfRoom: undefined;
605
+ typeOfObject: undefined;
628
606
  entrance: undefined;
629
607
  hasIntercom: undefined;
630
608
  intercomCode: undefined;
@@ -634,7 +612,6 @@ declare const SecurityApartmentInfoStepSchema: yup.ObjectSchema<{
634
612
  parkingNumber: undefined;
635
613
  }, "">;
636
614
 
637
- declare const getApartmentPaymentFields: (settings?: InspectionFieldsSettings | undefined) => any[];
638
615
  declare const getAdditionalInfoStepFields: (settings?: InspectionFieldsSettings | undefined) => InputParams<AdditionalInfoStepFields>[];
639
616
 
640
617
  declare const AdditionalInfoFieldsSchema: {
@@ -860,4 +837,4 @@ type ApartmentOverlayProps = {
860
837
 
861
838
  declare const ApartmentInspectionOverlay: (props: ApartmentOverlayProps) => JSX.Element;
862
839
 
863
- export { AdditionalInfoFieldsSchema, AdditionalInfoStepFields, AdditionalInfoStepSchema, ApartmentInspectionModel, ApartmentInspectionOverlay, ApartmentInspectionParams, ApartmentLinkParams, ApartmentPaymentsFormFields, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepFields, BasicApartmentInfoStepSchema, CommonInspectionFields, CommonInspectionFormFields, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepFields, DetailApartmentInfoStepSchema, FillingInfoFieldsSchema, FillingInfoFormFields, FillingInfoStepFields, FillingListInfoStepFields, HouseServicesInfoFieldsSchema, HouseServicesInfoStepFields, HouseServicesInfoStepSchema, InitialInspectionFieldsBody, InitialInspectionFormFields, InitialInspectionInfoFields, InitialInspectionPostBody, InitialInspectionRoomParams, InspectionAppraisalLiteModel, InspectionFieldsSettings, InspectionFillingParams, InspectionImpairmentLiteModel, InspectionMeterCommonFields, InspectionMeterFields$1 as InspectionMeterFields, InspectionMeterValueModel, InspectionMetersStepFields$1 as InspectionMetersStepFields, InspectionPartialMetersStepFields, InspectionRoomImagesParams, InspectionRoomPhotoRequest, InspectionRoomPhotoTypes, InspectionRoomsImagesFields, InspectionTypes, InventoryInspectionFieldsBody, InventoryInspectionFormFields, InventoryInspectionPostBody, InventoryMeterModel, MeterInfoStepProps, MeterValueModel, MeterValuesFields, MetersInfoFieldsSchema, MetersInfoStepFields, MetersInfoStepSchema, MetroStationParams, PartialMeterInfoFields, PartialMeterInfoStepProps, PartialMeterModel, PostApartmentInspectionRequest, RegularInspectionFormFields, RegularInspectionPostBody, RegularlyInspectionFieldsBody, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepFields, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepFields, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepFields, TelecommunicationsInfoStepSchema, TenantParams, TransferInspectionFieldsBody, TransferInspectionFormFields, TransferInspectionPostBody, TransferInspectionTypes, getAdditionalInfoStepFields, getApartmentPaymentFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useMetersValues };
840
+ export { AdditionalInfoFieldsSchema, AdditionalInfoStepFields, AdditionalInfoStepSchema, ApartmentInspectionModel, ApartmentInspectionOverlay, ApartmentInspectionParams, ApartmentLinkParams, ApartmentPaymentsFormFields, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepFields, BasicApartmentInfoStepSchema, CommonInspectionFields, CommonInspectionFormFields, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepFields, DetailApartmentInfoStepSchema, FillingInfoFieldsSchema, FillingInfoFormFields, FillingInfoStepFields, FillingListInfoStepFields, HouseServicesInfoFieldsSchema, HouseServicesInfoStepFields, HouseServicesInfoStepSchema, InitialInspectionFieldsBody, InitialInspectionFormFields, InitialInspectionInfoFields, InitialInspectionPostBody, InitialInspectionRoomParams, InspectionAppraisalLiteModel, InspectionFieldsSettings, InspectionFillingParams, InspectionImpairmentLiteModel, InspectionMeterCommonFields, InspectionMeterFields$1 as InspectionMeterFields, InspectionMeterValueModel, InspectionMetersStepFields$1 as InspectionMetersStepFields, InspectionPartialMetersStepFields, InspectionRoomImagesParams, InspectionRoomPhotoRequest, InspectionRoomsImagesFields, InventoryInspectionFieldsBody, InventoryInspectionFormFields, InventoryInspectionPostBody, InventoryMeterModel, MeterInfoStepProps, MeterValueModel, MeterValuesFields, MetersInfoFieldsSchema, MetersInfoStepFields, MetersInfoStepSchema, MetroStationParams, PartialMeterInfoFields, PartialMeterInfoStepProps, PartialMeterModel, PostApartmentInspectionRequest, RegularInspectionFormFields, RegularInspectionPostBody, RegularlyInspectionFieldsBody, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepFields, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepFields, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepFields, TelecommunicationsInfoStepSchema, TenantParams, TransferInspectionFieldsBody, TransferInspectionFormFields, TransferInspectionPostBody, TransferInspectionTypes, getAdditionalInfoStepFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useMetersValues };
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { NumberField, requests, uploadImages, uploadFiles, CountryAutocomplete, RegionAutocomplete, CityAutocomplete, RenovationTypeValues, RenovationStyleValues, RoomTypeValues, RoomTypesValues, BooleanValues, ParkingTypesValues, fieldWithConditionSchema, defaultRequiredMessage, CompanyAutocomplete, TaxTypeValues, phoneWithConditionSchema, positiveNumberSchema, getNumbersValues, TVTypesValues, phoneNonRequiredSchema, InputFileWithVisibility, FillingTypeValues, FillingTagsAutocomplete, PreviewContent, Link, UserBadge, useMapCards, MapOverlay } from 'kui-crm';
2
- import { addToArrayByCondition, clearNotValidFields, getPhoneNumberFromPhoneParams, resHandler, callPromises } from 'kui-utils';
3
1
  import * as yup from 'yup';
2
+ import { requests, uploadImages, uploadFiles, CountryAutocomplete, RegionAutocomplete, CityAutocomplete, RenovationTypeValues, RenovationStyleValues, RoomTypeValues, RoomTypesValues, BooleanValues, ParkingTypesValues, fieldWithConditionSchema, defaultRequiredMessage, getApartmentPaymentFields, phoneWithConditionSchema, positiveNumberSchema, getNumbersValues, TVTypesValues, phoneNonRequiredSchema, InputFileWithVisibility, FillingTypeValues, FillingTagsAutocomplete, PreviewContent, Link, UserBadge, useMapCards, MapOverlay } from 'kui-crm';
3
+ import { clearNotValidFields, getPhoneNumberFromPhoneParams, resHandler, callPromises, addToArrayByCondition } from 'kui-utils';
4
4
  import to from 'await-to-js';
5
5
  import { DateTime } from 'luxon';
6
6
  import { InputWithAddressAutocomplete, DependentInput, CheckboxWithController, InputPhoneWithForm } from 'kui-complex';
@@ -101,26 +101,6 @@ function __makeTemplateObject(cooked, raw) {
101
101
  return cooked;
102
102
  }
103
103
 
104
- var valueOptions = {
105
- variant: "custom",
106
- CustomInput: NumberField,
107
- maxIntegerPart: 7,
108
- maxDecimalPart: 3,
109
- };
110
- var getPartialMeterInfoFields = function (resource, type, name, settings) {
111
- var prefixName = name ? "".concat(name, ".") : "";
112
- if (resource === "electricity") {
113
- return __spreadArray(__spreadArray([
114
- __assign({ label: "Number", name: "".concat(prefixName, "number") }, settings === null || settings === void 0 ? void 0 : settings.number),
115
- __assign(__assign({ label: "T1 value", name: "".concat(prefixName, "T1") }, valueOptions), settings === null || settings === void 0 ? void 0 : settings.t1)
116
- ], addToArrayByCondition(type !== "T1", __assign(__assign({ label: "T2 value", name: "".concat(prefixName, "T2") }, valueOptions), settings === null || settings === void 0 ? void 0 : settings.t2)), true), addToArrayByCondition(type === "T3", __assign(__assign({ label: "T3 value", name: "".concat(prefixName, "T3") }, valueOptions), settings === null || settings === void 0 ? void 0 : settings.t3)), true);
117
- }
118
- return [
119
- __assign({ label: "Number", name: "".concat(prefixName, "number") }, settings === null || settings === void 0 ? void 0 : settings.number),
120
- __assign(__assign({ label: "Value", name: "".concat(prefixName, "value") }, valueOptions), settings === null || settings === void 0 ? void 0 : settings.value),
121
- ];
122
- };
123
-
124
104
  var getPartialMeterInfoSchema = function (valuesFields) {
125
105
  var filteredFields = valuesFields
126
106
  .filter(function (field) { return field.type === "number"; })
@@ -158,7 +138,7 @@ var inspectionsRequestBody = {
158
138
  post_index: inspection.zipCode,
159
139
  floor: inspection.floor,
160
140
  floor_count: inspection.floorCount,
161
- room_type: inspection.typeOfRoom,
141
+ room_type: inspection.typeOfObject,
162
142
  num_entrance: inspection.entrance,
163
143
  has_intercom: inspection.hasIntercom,
164
144
  intercom_code: inspection.intercomCode,
@@ -175,6 +155,7 @@ var inspectionsRequestBody = {
175
155
  renovation_type: (_b = inspection.renovation) === null || _b === void 0 ? void 0 : _b.type,
176
156
  renovation_style: (_c = inspection.renovation) === null || _c === void 0 ? void 0 : _c.style,
177
157
  rooms: inspection.rooms.map(function (room, index) { return ({
158
+ id: room.id,
178
159
  room_type: room.type,
179
160
  order_number: index,
180
161
  }); }),
@@ -557,7 +538,7 @@ var RoomsApartmentInfoFieldsSchema = {
557
538
  var RoomsApartmentInfoStepSchema = yup.object(RoomsApartmentInfoFieldsSchema);
558
539
 
559
540
  var getSecurityApartmentInfoFields = function (settings) { return [
560
- __assign({ label: "Object type", name: "typeOfRoom", variant: "select", options: RoomTypesValues }, settings === null || settings === void 0 ? void 0 : settings.typeOfRoom),
541
+ __assign({ label: "Object type", name: "typeOfObject", variant: "select", options: RoomTypesValues }, settings === null || settings === void 0 ? void 0 : settings.typeOfObject),
561
542
  __assign({ label: "Entrance", name: "entrance" }, settings === null || settings === void 0 ? void 0 : settings.entrance),
562
543
  __assign({ name: "hasIntercom", label: "Intercom", variant: "select", options: BooleanValues }, settings === null || settings === void 0 ? void 0 : settings.hasIntercom),
563
544
  __assign({ name: "intercomCode", label: "Intercom code", variant: "custom", CustomInput: DependentInput, dependentInputName: "hasIntercom" }, settings === null || settings === void 0 ? void 0 : settings.intercomCode),
@@ -568,7 +549,7 @@ var getSecurityApartmentInfoFields = function (settings) { return [
568
549
  ]; };
569
550
 
570
551
  var SecurityApartmentInfoFieldsSchema = {
571
- typeOfRoom: yup.string().required("This field is required"),
552
+ typeOfObject: yup.string().required("This field is required"),
572
553
  entrance: yup.string().required("This field is required"),
573
554
  hasIntercom: yup.string().required("This field is required"),
574
555
  intercomCode: fieldWithConditionSchema("hasIntercom"),
@@ -588,13 +569,6 @@ var SecurityApartmentInfoStepSchema = yup.object(SecurityApartmentInfoFieldsSche
588
569
  var checkboxLabelProps = {
589
570
  size: "s",
590
571
  };
591
- var getApartmentPaymentFields = function (settings) { return [
592
- __assign({ name: "payerCode", label: "Payer code" }, settings === null || settings === void 0 ? void 0 : settings.payerCode),
593
- __assign({ name: "communalServicesAccount", label: "Operational account number" }, settings === null || settings === void 0 ? void 0 : settings.communalServicesAccount),
594
- __assign({ name: "company", label: "Administrative company", variant: "custom", CustomInput: CompanyAutocomplete }, settings === null || settings === void 0 ? void 0 : settings.company),
595
- __assign({ name: "countryOfResidence", label: "Country of Residence", variant: "custom", CustomInput: CountryAutocomplete }, settings === null || settings === void 0 ? void 0 : settings.countryOfResidence),
596
- __assign({ label: "Tax type", name: "taxesType", variant: "select", options: TaxTypeValues }, settings === null || settings === void 0 ? void 0 : settings.taxesType),
597
- ]; };
598
572
  var getAdditionalInfoStepFields = function (settings) { return __spreadArray([
599
573
  __assign({ label: "Pets", name: "withPets", variant: "custom", CustomInput: CheckboxWithController, labelProps: checkboxLabelProps }, settings === null || settings === void 0 ? void 0 : settings.withPets),
600
574
  __assign({ label: "Children", name: "withChildren", variant: "custom", CustomInput: CheckboxWithController, labelProps: checkboxLabelProps }, settings === null || settings === void 0 ? void 0 : settings.withChildren),
@@ -787,5 +761,5 @@ var ApartmentInspectionOverlay = function (props) {
787
761
  var StyledWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
788
762
  var templateObject_1;
789
763
 
790
- export { AdditionalInfoFieldsSchema, AdditionalInfoStepSchema, ApartmentInspectionOverlay, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepSchema, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepSchema, FillingInfoFieldsSchema, HouseServicesInfoFieldsSchema, HouseServicesInfoStepSchema, MetersInfoFieldsSchema, MetersInfoStepSchema, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepSchema, getAdditionalInfoStepFields, getApartmentPaymentFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useMetersValues };
764
+ export { AdditionalInfoFieldsSchema, AdditionalInfoStepSchema, ApartmentInspectionOverlay, BasicApartmentInfoFieldsSchema, BasicApartmentInfoStepSchema, DetailApartmentInfoFieldsSchema, DetailApartmentInfoStepSchema, FillingInfoFieldsSchema, HouseServicesInfoFieldsSchema, HouseServicesInfoStepSchema, MetersInfoFieldsSchema, MetersInfoStepSchema, RoomsApartmentInfoFieldsSchema, RoomsApartmentInfoStepSchema, SecurityApartmentInfoFieldsSchema, SecurityApartmentInfoStepSchema, TelecommunicationsInfoFieldsSchema, TelecommunicationsInfoStepSchema, getAdditionalInfoStepFields, getBasicApartmentInfoFields, getDetailApartmentInfoFields, getFillingInfoFields, getHouseServicesInfoStep, getMetersInfoStepFields, getPartialMeterInfoSchema, getRoomsApartmentInfoFields, getRoomsImagesSteps, getSecurityApartmentInfoFields, getTelecommunicationsInfoStepFields, inspectionsRequestBody, inspectionsRequests, renderMetersSteps, useMetersValues };
791
765
  //# sourceMappingURL=index.js.map