kui-crm_actions 0.0.61 → 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
@@ -290,7 +267,7 @@ type BasicApartmentInfoStepFields = {
290
267
  }
291
268
 
292
269
  type SecurityApartmentInfoStepFields = {
293
- typeOfRoom: RoomTypes | null
270
+ typeOfObject: RoomTypes | null
294
271
  entrance: string
295
272
  hasIntercom: boolean | null
296
273
  intercomCode: string
@@ -336,7 +313,7 @@ type HouseServicesInfoStepFields = {
336
313
  securityPhone: PhoneParams | null
337
314
  hasVideoControl: boolean | null
338
315
  videoControlPhone: PhoneParams | null
339
- parkingType: ParkingTypes$1 | null
316
+ parkingType: ParkingTypes | null
340
317
  parkingNumber: string
341
318
  passengerElevatorsCount: number | null
342
319
  serviceElevatorsCount: number | null
@@ -414,7 +391,7 @@ declare const inspectionsRequests: {
414
391
  createTransferInspection(data: TransferInspectionFormFields, apartmentId: number, loader: Loader): Promise<number | null | undefined>;
415
392
  createInventoryInspection(data: InventoryInspectionFormFields, apartmentId: number, loader: Loader): Promise<number | null | undefined>;
416
393
  getRoomParams(room: InspectionRoomImagesParams, photos?: ImageBodyRequest[] | undefined): {
417
- purpose: InspectionRoomPhotoTypes;
394
+ purpose: kui_crm.InspectionRoomPhotoTypes;
418
395
  comment: string;
419
396
  photos: ImageBodyRequest[];
420
397
  };
@@ -606,7 +583,7 @@ declare const RoomsApartmentInfoStepSchema: yup.ObjectSchema<{
606
583
  declare const getSecurityApartmentInfoFields: (settings?: InspectionFieldsSettings | undefined) => InputParams<SecurityApartmentInfoStepFields>[];
607
584
 
608
585
  declare const SecurityApartmentInfoFieldsSchema: {
609
- typeOfRoom: yup.StringSchema<string, yup.AnyObject, undefined, "">;
586
+ typeOfObject: yup.StringSchema<string, yup.AnyObject, undefined, "">;
610
587
  entrance: yup.StringSchema<string, yup.AnyObject, undefined, "">;
611
588
  hasIntercom: yup.StringSchema<string, yup.AnyObject, undefined, "">;
612
589
  intercomCode: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
@@ -616,7 +593,7 @@ declare const SecurityApartmentInfoFieldsSchema: {
616
593
  parkingNumber: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
617
594
  };
618
595
  declare const SecurityApartmentInfoStepSchema: yup.ObjectSchema<{
619
- typeOfRoom: string;
596
+ typeOfObject: string;
620
597
  entrance: string;
621
598
  hasIntercom: string;
622
599
  intercomCode: string | null | undefined;
@@ -625,7 +602,7 @@ declare const SecurityApartmentInfoStepSchema: yup.ObjectSchema<{
625
602
  parkingType: string | null | undefined;
626
603
  parkingNumber: string | null | undefined;
627
604
  }, yup.AnyObject, {
628
- typeOfRoom: undefined;
605
+ typeOfObject: undefined;
629
606
  entrance: undefined;
630
607
  hasIntercom: undefined;
631
608
  intercomCode: undefined;
@@ -635,7 +612,6 @@ declare const SecurityApartmentInfoStepSchema: yup.ObjectSchema<{
635
612
  parkingNumber: undefined;
636
613
  }, "">;
637
614
 
638
- declare const getApartmentPaymentFields: (settings?: InspectionFieldsSettings | undefined) => any[];
639
615
  declare const getAdditionalInfoStepFields: (settings?: InspectionFieldsSettings | undefined) => InputParams<AdditionalInfoStepFields>[];
640
616
 
641
617
  declare const AdditionalInfoFieldsSchema: {
@@ -861,4 +837,4 @@ type ApartmentOverlayProps = {
861
837
 
862
838
  declare const ApartmentInspectionOverlay: (props: ApartmentOverlayProps) => JSX.Element;
863
839
 
864
- 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,
@@ -558,7 +538,7 @@ var RoomsApartmentInfoFieldsSchema = {
558
538
  var RoomsApartmentInfoStepSchema = yup.object(RoomsApartmentInfoFieldsSchema);
559
539
 
560
540
  var getSecurityApartmentInfoFields = function (settings) { return [
561
- __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),
562
542
  __assign({ label: "Entrance", name: "entrance" }, settings === null || settings === void 0 ? void 0 : settings.entrance),
563
543
  __assign({ name: "hasIntercom", label: "Intercom", variant: "select", options: BooleanValues }, settings === null || settings === void 0 ? void 0 : settings.hasIntercom),
564
544
  __assign({ name: "intercomCode", label: "Intercom code", variant: "custom", CustomInput: DependentInput, dependentInputName: "hasIntercom" }, settings === null || settings === void 0 ? void 0 : settings.intercomCode),
@@ -569,7 +549,7 @@ var getSecurityApartmentInfoFields = function (settings) { return [
569
549
  ]; };
570
550
 
571
551
  var SecurityApartmentInfoFieldsSchema = {
572
- typeOfRoom: yup.string().required("This field is required"),
552
+ typeOfObject: yup.string().required("This field is required"),
573
553
  entrance: yup.string().required("This field is required"),
574
554
  hasIntercom: yup.string().required("This field is required"),
575
555
  intercomCode: fieldWithConditionSchema("hasIntercom"),
@@ -589,13 +569,6 @@ var SecurityApartmentInfoStepSchema = yup.object(SecurityApartmentInfoFieldsSche
589
569
  var checkboxLabelProps = {
590
570
  size: "s",
591
571
  };
592
- var getApartmentPaymentFields = function (settings) { return [
593
- __assign({ name: "payerCode", label: "Payer code" }, settings === null || settings === void 0 ? void 0 : settings.payerCode),
594
- __assign({ name: "communalServicesAccount", label: "Operational account number" }, settings === null || settings === void 0 ? void 0 : settings.communalServicesAccount),
595
- __assign({ name: "company", label: "Administrative company", variant: "custom", CustomInput: CompanyAutocomplete }, settings === null || settings === void 0 ? void 0 : settings.company),
596
- __assign({ name: "countryOfResidence", label: "Country of Residence", variant: "custom", CustomInput: CountryAutocomplete }, settings === null || settings === void 0 ? void 0 : settings.countryOfResidence),
597
- __assign({ label: "Tax type", name: "taxesType", variant: "select", options: TaxTypeValues }, settings === null || settings === void 0 ? void 0 : settings.taxesType),
598
- ]; };
599
572
  var getAdditionalInfoStepFields = function (settings) { return __spreadArray([
600
573
  __assign({ label: "Pets", name: "withPets", variant: "custom", CustomInput: CheckboxWithController, labelProps: checkboxLabelProps }, settings === null || settings === void 0 ? void 0 : settings.withPets),
601
574
  __assign({ label: "Children", name: "withChildren", variant: "custom", CustomInput: CheckboxWithController, labelProps: checkboxLabelProps }, settings === null || settings === void 0 ? void 0 : settings.withChildren),
@@ -788,5 +761,5 @@ var ApartmentInspectionOverlay = function (props) {
788
761
  var StyledWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
789
762
  var templateObject_1;
790
763
 
791
- 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 };
792
765
  //# sourceMappingURL=index.js.map