kui-crm_actions 0.0.110 → 0.0.112
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 +50 -48
- package/cjs/index.js.map +1 -1
- package/index.d.ts +25 -19
- package/index.js +50 -49
- package/index.js.map +1 -1
- package/package.json +1 -1
package/cjs/index.js
CHANGED
@@ -294,7 +294,8 @@ var inspectionsRequestBody = {
|
|
294
294
|
var _a;
|
295
295
|
return ({
|
296
296
|
feature: ((_a = filling.tag) === null || _a === void 0 ? void 0 : _a.id) || 0,
|
297
|
-
description: filling.
|
297
|
+
description: filling.description,
|
298
|
+
model: filling.name,
|
298
299
|
serial_code: filling.serialNumber,
|
299
300
|
amount: filling.numberOfSubjects,
|
300
301
|
photos: _this.getFilesParams(filling.images),
|
@@ -687,9 +688,9 @@ var apartmentFields = {
|
|
687
688
|
var getBasicApartmentInfoFields = function (handlePlaceSelect, settings) { return [
|
688
689
|
__assign({ name: "country", label: "Country", variant: "custom", CustomInput: kuiCrm.CountryAutocomplete, size: 12 }, settings === null || settings === void 0 ? void 0 : settings.country),
|
689
690
|
__assign({ name: "region", label: "Region", variant: "custom", CustomInput: kuiCrm.RegionAutocomplete }, settings === null || settings === void 0 ? void 0 : settings.region),
|
690
|
-
__assign({ name: "city", label: "City", variant: "custom", CustomInput: kuiCrm.CityAutocomplete }, settings === null || settings === void 0 ? void 0 : settings.city),
|
691
|
-
__assign({ name: "apartment", variant: "custom", CustomInput: kuiComplex.InputWithAddressAutocomplete, handlePlaceSelect: handlePlaceSelect, size: 12 }, settings === null || settings === void 0 ? void 0 : settings.apartment),
|
692
|
-
__assign({ label: "Apartment", name: "apartmentNumber", "data-testid": "apartment_number" }, settings === null || settings === void 0 ? void 0 : settings.apartmentNumber),
|
691
|
+
__assign({ name: "city", label: "City", variant: "custom", CustomInput: kuiCrm.CityAutocomplete, isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.city),
|
692
|
+
__assign({ name: "apartment", variant: "custom", CustomInput: kuiComplex.InputWithAddressAutocomplete, handlePlaceSelect: handlePlaceSelect, size: 12, isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.apartment),
|
693
|
+
__assign({ label: "Apartment", name: "apartmentNumber", "data-testid": "apartment_number", isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.apartmentNumber),
|
693
694
|
__assign({ label: "Zip code", name: "zipCode" }, settings === null || settings === void 0 ? void 0 : settings.zipCode),
|
694
695
|
]; };
|
695
696
|
|
@@ -701,20 +702,19 @@ var BasicApartmentInfoFieldsSchema = {
|
|
701
702
|
city: yup__namespace.object({
|
702
703
|
name: yup__namespace.string().required("This field is required"),
|
703
704
|
}),
|
704
|
-
zipCode: yup__namespace.string().required("This field is required"),
|
705
705
|
};
|
706
706
|
var BasicApartmentInfoStepSchema = yup__namespace.object(BasicApartmentInfoFieldsSchema);
|
707
707
|
|
708
708
|
var getHouseInfoStep = function (settings) { return [
|
709
|
-
__assign({ name: "typeOfHouse", label: "Type houses", variant: "select", options: kuiCrm.HouseTypesValues }, settings === null || settings === void 0 ? void 0 : settings.typeOfHouse),
|
709
|
+
__assign({ name: "typeOfHouse", label: "Type houses", variant: "select", options: kuiCrm.HouseTypesValues, isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.typeOfHouse),
|
710
710
|
__assign({ name: "houseNumber", label: "House series" }, settings === null || settings === void 0 ? void 0 : settings.houseNumber),
|
711
|
-
__assign({ name: "wallMaterial", label: "Wall material", variant: "select", options: kuiCrm.WallMaterialsValues }, settings === null || settings === void 0 ? void 0 : settings.wallMaterial),
|
712
|
-
__assign({ name: "overlapType", label: "Overlap type", variant: "select", options: kuiCrm.SlabsTypesValues }, settings === null || settings === void 0 ? void 0 : settings.overlapType),
|
713
|
-
__assign({ name: "gasLeads", label: "Gas", variant: "select", options: kuiCrm.GasTypesValues }, settings === null || settings === void 0 ? void 0 : settings.gasLeads),
|
714
|
-
__assign({ name: "withHotWater", label: "Hot water", variant: "select", options: kuiCrm.BooleanValues }, settings === null || settings === void 0 ? void 0 : settings.withHotWater),
|
715
|
-
__assign({ name: "passengerElevatorsCount", label: "Passenger elevators", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.passengerElevatorsCount),
|
716
|
-
__assign({ name: "serviceElevatorsCount", label: "Service elevators", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.serviceElevatorsCount),
|
717
|
-
__assign({ name: "buildingYear", label: "Builded" }, settings === null || settings === void 0 ? void 0 : settings.buildingYear),
|
711
|
+
__assign({ name: "wallMaterial", label: "Wall material", variant: "select", options: kuiCrm.WallMaterialsValues, isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.wallMaterial),
|
712
|
+
__assign({ name: "overlapType", label: "Overlap type", variant: "select", options: kuiCrm.SlabsTypesValues, isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.overlapType),
|
713
|
+
__assign({ name: "gasLeads", label: "Gas", variant: "select", options: kuiCrm.GasTypesValues, isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.gasLeads),
|
714
|
+
__assign({ name: "withHotWater", label: "Hot water", variant: "select", options: kuiCrm.BooleanValues, isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.withHotWater),
|
715
|
+
__assign({ name: "passengerElevatorsCount", label: "Passenger elevators", type: "number", isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.passengerElevatorsCount),
|
716
|
+
__assign({ name: "serviceElevatorsCount", label: "Service elevators", type: "number", isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.serviceElevatorsCount),
|
717
|
+
__assign({ name: "buildingYear", label: "Builded", isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.buildingYear),
|
718
718
|
]; };
|
719
719
|
|
720
720
|
var HouseInfoFieldsSchema = {
|
@@ -735,7 +735,7 @@ var inputProps = {
|
|
735
735
|
var getDetailApartmentInfoFields = function (roomsCount, bedroomsCount, settings) {
|
736
736
|
var _a, _b;
|
737
737
|
return __spreadArray(__spreadArray([
|
738
|
-
__assign(__assign({ label: "Total area", name: "area", type: "number" }, inputProps), settings === null || settings === void 0 ? void 0 : settings.area)
|
738
|
+
__assign(__assign({ label: "Total area", name: "area", type: "number", isRequired: true }, inputProps), settings === null || settings === void 0 ? void 0 : settings.area)
|
739
739
|
], (roomsCount
|
740
740
|
? new Array(Number(roomsCount))
|
741
741
|
.fill(0)
|
@@ -746,18 +746,18 @@ var getDetailApartmentInfoFields = function (roomsCount, bedroomsCount, settings
|
|
746
746
|
: "Room ".concat(key + 1);
|
747
747
|
var settingsKey = bedroomsCount && key < bedroomsCount ? "bedrooms" : "rooms";
|
748
748
|
return [
|
749
|
-
__assign({ name: "rooms.".concat(key, ".type"), label: "".concat(label, " type"), variant: "select", options: kuiCrm.RoomTypeValues }, ((settings === null || settings === void 0 ? void 0 : settings[settingsKey])
|
749
|
+
__assign({ name: "rooms.".concat(key, ".type"), label: "".concat(label, " type"), variant: "select", options: kuiCrm.RoomTypeValues, isRequired: true }, ((settings === null || settings === void 0 ? void 0 : settings[settingsKey])
|
750
750
|
? (_a = settings[settingsKey](key)) === null || _a === void 0 ? void 0 : _a.type
|
751
751
|
: {})),
|
752
752
|
];
|
753
753
|
})
|
754
754
|
.flat()
|
755
755
|
: []), true), [
|
756
|
-
__assign(__assign({ name: "ceilingHeight", label: "Ceiling height", type: "number", cornerLabel: "m." }, inputProps), settings === null || settings === void 0 ? void 0 : settings.ceilingHeight),
|
757
|
-
__assign({ name: "numberOfWindows", label: "Windows", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.numberOfWindows),
|
758
|
-
__assign({ name: "renovation.year", label: "Year of last renovation", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.renovation.year),
|
759
|
-
__assign({ name: "renovation.type", label: "Type of renovation", variant: "select", options: kuiCrm.RenovationTypeValues }, (_a = settings === null || settings === void 0 ? void 0 : settings.renovation) === null || _a === void 0 ? void 0 : _a.type),
|
760
|
-
__assign({ name: "renovation.style", label: "Renovation style", variant: "select", options: kuiCrm.RenovationStyleValues }, (_b = settings === null || settings === void 0 ? void 0 : settings.renovation) === null || _b === void 0 ? void 0 : _b.style),
|
756
|
+
__assign(__assign({ name: "ceilingHeight", label: "Ceiling height", type: "number", cornerLabel: "m.", isRequired: true }, inputProps), settings === null || settings === void 0 ? void 0 : settings.ceilingHeight),
|
757
|
+
__assign({ name: "numberOfWindows", label: "Windows", type: "number", isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.numberOfWindows),
|
758
|
+
__assign({ name: "renovation.year", label: "Year of last renovation", type: "number", isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.renovation.year),
|
759
|
+
__assign({ name: "renovation.type", label: "Type of renovation", variant: "select", options: kuiCrm.RenovationTypeValues, isRequired: true }, (_a = settings === null || settings === void 0 ? void 0 : settings.renovation) === null || _a === void 0 ? void 0 : _a.type),
|
760
|
+
__assign({ name: "renovation.style", label: "Renovation style", variant: "select", options: kuiCrm.RenovationStyleValues, isRequired: true }, (_b = settings === null || settings === void 0 ? void 0 : settings.renovation) === null || _b === void 0 ? void 0 : _b.style),
|
761
761
|
], false);
|
762
762
|
};
|
763
763
|
|
@@ -777,13 +777,13 @@ var DetailApartmentInfoFieldsSchema = {
|
|
777
777
|
var DetailApartmentInfoStepSchema = yup__namespace.object(DetailApartmentInfoFieldsSchema);
|
778
778
|
|
779
779
|
var getRoomsApartmentInfoFields = function (settings) { return [
|
780
|
-
__assign({ label: "Floor", name: "floor", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.floor),
|
781
|
-
__assign({ label: "Floors", name: "floorCount", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.floorCount),
|
782
|
-
__assign({ label: "Rooms", name: "roomsNumber", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.roomsNumber),
|
783
|
-
__assign({ label: "Bedrooms", name: "bedroomsNumber", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.bedroomsNumber),
|
784
|
-
__assign({ label: "Bathrooms", name: "bathroomsNumber", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.bathroomsNumber),
|
785
|
-
__assign({ label: "Restrooms", name: "restroomsNumber", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.restroomsNumber),
|
786
|
-
__assign({ label: "Combined bathroom", name: "combinedBathroomsNumber", type: "number" }, settings === null || settings === void 0 ? void 0 : settings.combinedBathroomsNumber),
|
780
|
+
__assign({ label: "Floor", name: "floor", type: "number", isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.floor),
|
781
|
+
__assign({ label: "Floors", name: "floorCount", type: "number", isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.floorCount),
|
782
|
+
__assign({ label: "Rooms", name: "roomsNumber", type: "number", isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.roomsNumber),
|
783
|
+
__assign({ label: "Bedrooms", name: "bedroomsNumber", type: "number", isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.bedroomsNumber),
|
784
|
+
__assign({ label: "Bathrooms", name: "bathroomsNumber", type: "number", isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.bathroomsNumber),
|
785
|
+
__assign({ label: "Restrooms", name: "restroomsNumber", type: "number", isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.restroomsNumber),
|
786
|
+
__assign({ label: "Combined bathroom", name: "combinedBathroomsNumber", type: "number", isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.combinedBathroomsNumber),
|
787
787
|
]; };
|
788
788
|
|
789
789
|
var RoomsApartmentInfoFieldsSchema = {
|
@@ -824,11 +824,11 @@ var RoomsApartmentInfoFieldsSchema = {
|
|
824
824
|
var RoomsApartmentInfoStepSchema = yup__namespace.object(RoomsApartmentInfoFieldsSchema);
|
825
825
|
|
826
826
|
var getSecurityApartmentInfoFields = function (settings) { return [
|
827
|
-
__assign({ label: "Object type", name: "typeOfObject", variant: "select", options: kuiCrm.RoomTypesValues }, settings === null || settings === void 0 ? void 0 : settings.typeOfObject),
|
828
|
-
__assign({ label: "Entrance", name: "entrance" }, settings === null || settings === void 0 ? void 0 : settings.entrance),
|
829
|
-
__assign({ name: "hasIntercom", label: "Intercom", variant: "select", options: kuiCrm.BooleanValues }, settings === null || settings === void 0 ? void 0 : settings.hasIntercom),
|
827
|
+
__assign({ label: "Object type", name: "typeOfObject", variant: "select", options: kuiCrm.RoomTypesValues, isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.typeOfObject),
|
828
|
+
__assign({ label: "Entrance", name: "entrance", isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.entrance),
|
829
|
+
__assign({ name: "hasIntercom", label: "Intercom", variant: "select", options: kuiCrm.BooleanValues, isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.hasIntercom),
|
830
830
|
__assign({ name: "intercomCode", label: "Intercom code", variant: "custom", CustomInput: kuiComplex.DependentInput, dependentInputName: "hasIntercom" }, settings === null || settings === void 0 ? void 0 : settings.intercomCode),
|
831
|
-
__assign({ name: "hasGate", label: "Gate", variant: "select", options: kuiCrm.BooleanValues }, settings === null || settings === void 0 ? void 0 : settings.hasGate),
|
831
|
+
__assign({ name: "hasGate", label: "Gate", variant: "select", options: kuiCrm.BooleanValues, isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.hasGate),
|
832
832
|
__assign({ name: "gateCode", label: "Gate code", variant: "custom", CustomInput: kuiComplex.DependentInput, dependentInputName: "hasGate" }, settings === null || settings === void 0 ? void 0 : settings.gateCode),
|
833
833
|
__assign({ name: "parkingType", label: "Parking", variant: "select", options: kuiCrm.ParkingTypesValues }, settings === null || settings === void 0 ? void 0 : settings.parkingType),
|
834
834
|
__assign({ name: "parkingNumber", label: "Parking number", variant: "custom", CustomInput: kuiComplex.DependentInput, dependentInputName: "parkingType" }, settings === null || settings === void 0 ? void 0 : settings.parkingNumber),
|
@@ -858,17 +858,20 @@ var AdditionalInfoFieldsSchema = {
|
|
858
858
|
countryOfResidence: yup__namespace.object({
|
859
859
|
name: yup__namespace.string().required(kuiCrm.defaultRequiredMessage),
|
860
860
|
}),
|
861
|
+
company: yup__namespace.object({
|
862
|
+
name: yup__namespace.string().required(kuiCrm.defaultRequiredMessage),
|
863
|
+
}),
|
861
864
|
};
|
862
865
|
var AdditionalInfoStepSchema = yup__namespace.object(AdditionalInfoFieldsSchema);
|
863
866
|
|
864
867
|
var getHouseServicesInfoStep = function (settings) { return [
|
865
|
-
__assign({ name: "hasBarrier", label: "Barrier", variant: "select", options: kuiCrm.BooleanValues }, settings === null || settings === void 0 ? void 0 : settings.hasBarrier),
|
868
|
+
__assign({ name: "hasBarrier", label: "Barrier", variant: "select", options: kuiCrm.BooleanValues, isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.hasBarrier),
|
866
869
|
__assign({ name: "barrierPhone", label: "Barrier code", variant: "custom", CustomInput: kuiComplex.DependentInput, dependentInputName: "hasBarrier", Input: kuiComplex.InputPhoneWithForm }, settings === null || settings === void 0 ? void 0 : settings.barrierPhone),
|
867
|
-
__assign({ name: "hasConcierge", label: "Concierge", variant: "select", options: kuiCrm.BooleanValues }, settings === null || settings === void 0 ? void 0 : settings.hasConcierge),
|
870
|
+
__assign({ name: "hasConcierge", label: "Concierge", variant: "select", options: kuiCrm.BooleanValues, isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.hasConcierge),
|
868
871
|
__assign({ name: "conciergePhone", label: "Concierge", variant: "custom", CustomInput: kuiComplex.DependentInput, dependentInputName: "hasConcierge", Input: kuiComplex.InputPhoneWithForm }, settings === null || settings === void 0 ? void 0 : settings.conciergePhone),
|
869
|
-
__assign({ name: "hasSecurity", label: "Security", variant: "select", options: kuiCrm.BooleanValues }, settings === null || settings === void 0 ? void 0 : settings.hasSecurity),
|
872
|
+
__assign({ name: "hasSecurity", label: "Security", variant: "select", options: kuiCrm.BooleanValues, isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.hasSecurity),
|
870
873
|
__assign({ name: "securityPhone", label: "Security", variant: "custom", CustomInput: kuiComplex.DependentInput, dependentInputName: "hasSecurity", Input: kuiComplex.InputPhoneWithForm }, settings === null || settings === void 0 ? void 0 : settings.securityPhone),
|
871
|
-
__assign({ name: "hasVideoControl", label: "Video surveillance", variant: "select", options: kuiCrm.BooleanValues }, settings === null || settings === void 0 ? void 0 : settings.hasVideoControl),
|
874
|
+
__assign({ name: "hasVideoControl", label: "Video surveillance", variant: "select", options: kuiCrm.BooleanValues, isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.hasVideoControl),
|
872
875
|
__assign({ name: "videoControlPhone", label: "Video surveillance", variant: "custom", CustomInput: kuiComplex.DependentInput, dependentInputName: "hasVideoControl", Input: kuiComplex.InputPhoneWithForm }, settings === null || settings === void 0 ? void 0 : settings.videoControlPhone),
|
873
876
|
]; };
|
874
877
|
|
@@ -888,10 +891,10 @@ var metersOptions = kuiCrm.getNumbersValues(7);
|
|
888
891
|
var getMetersInfoStepFields = function (settings) {
|
889
892
|
var _a, _b, _c, _d;
|
890
893
|
return [
|
891
|
-
__assign({ name: "maxMeters.water", label: "Water", variant: "select", options: metersOptions }, (_a = settings === null || settings === void 0 ? void 0 : settings.maxMeters) === null || _a === void 0 ? void 0 : _a.water),
|
892
|
-
__assign({ name: "maxMeters.electricity", label: "Electricity", variant: "select", options: metersOptions }, (_b = settings === null || settings === void 0 ? void 0 : settings.maxMeters) === null || _b === void 0 ? void 0 : _b.electricity),
|
893
|
-
__assign({ name: "maxMeters.gas", label: "Gas", variant: "select", options: metersOptions }, (_c = settings === null || settings === void 0 ? void 0 : settings.maxMeters) === null || _c === void 0 ? void 0 : _c.gas),
|
894
|
-
__assign({ name: "maxMeters.heating", label: "Heating", variant: "select", options: metersOptions }, (_d = settings === null || settings === void 0 ? void 0 : settings.maxMeters) === null || _d === void 0 ? void 0 : _d.heating),
|
894
|
+
__assign({ name: "maxMeters.water", label: "Water", variant: "select", options: metersOptions, isRequired: true }, (_a = settings === null || settings === void 0 ? void 0 : settings.maxMeters) === null || _a === void 0 ? void 0 : _a.water),
|
895
|
+
__assign({ name: "maxMeters.electricity", label: "Electricity", variant: "select", options: metersOptions, isRequired: true }, (_b = settings === null || settings === void 0 ? void 0 : settings.maxMeters) === null || _b === void 0 ? void 0 : _b.electricity),
|
896
|
+
__assign({ name: "maxMeters.gas", label: "Gas", variant: "select", options: metersOptions, isRequired: true }, (_c = settings === null || settings === void 0 ? void 0 : settings.maxMeters) === null || _c === void 0 ? void 0 : _c.gas),
|
897
|
+
__assign({ name: "maxMeters.heating", label: "Heating", variant: "select", options: metersOptions, isRequired: true }, (_d = settings === null || settings === void 0 ? void 0 : settings.maxMeters) === null || _d === void 0 ? void 0 : _d.heating),
|
895
898
|
];
|
896
899
|
};
|
897
900
|
|
@@ -919,17 +922,16 @@ var getTelecommunicationsInfoStepFields = function (settings) {
|
|
919
922
|
};
|
920
923
|
|
921
924
|
var TelecommunicationsInfoFieldsSchema = {
|
922
|
-
tvType: yup__namespace.string().required(kuiCrm.defaultRequiredMessage),
|
923
925
|
homePhone: kuiCrm.phoneNonRequiredSchema("homePhone"),
|
924
926
|
};
|
925
927
|
var TelecommunicationsInfoStepSchema = yup__namespace
|
926
928
|
.object()
|
927
929
|
.shape(TelecommunicationsInfoFieldsSchema, [["homePhone", "homePhone"]]);
|
928
930
|
|
929
|
-
var getFillingInfoFields = function (withType, type, setType, settings) { return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], kuiUtils.addToArrayByCondition(withType, __assign({ label: "Filling type", name: "type", variant: "select", options: kuiCrm.FillingTypeValues, handleChange: setType }, settings === null || settings === void 0 ? void 0 : settings.type)), true), [
|
930
|
-
__assign({ label: "Name (tag)", name: "tag", type: type, variant: "custom", CustomInput: kuiCrm.FillingTagsAutocomplete }, settings === null || settings === void 0 ? void 0 : settings.tag)
|
931
|
-
], false), kuiUtils.addToArrayByCondition(type !== "finish", __assign({ label: "Serial code", name: "serialNumber", size: 6 }, settings === null || settings === void 0 ? void 0 : settings.serialNumber)), true), kuiUtils.addToArrayByCondition(type !== "finish", __assign({ label: "Amount", name: "numberOfSubjects", type: "number", size: 6 }, settings === null || settings === void 0 ? void 0 : settings.numberOfSubjects)), true), [
|
932
|
-
__assign({ label: "Description", name: "
|
931
|
+
var getFillingInfoFields = function (withType, type, setType, settings) { return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], kuiUtils.addToArrayByCondition(withType, __assign({ label: "Filling type", name: "type", variant: "select", options: kuiCrm.FillingTypeValues, handleChange: setType, isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.type)), true), [
|
932
|
+
__assign({ label: "Name (tag)", name: "tag", type: type, variant: "custom", CustomInput: kuiCrm.FillingTagsAutocomplete, isRequired: true }, settings === null || settings === void 0 ? void 0 : settings.tag)
|
933
|
+
], false), kuiUtils.addToArrayByCondition(type !== "finish", __assign({ label: "Model", name: "name" }, settings === null || settings === void 0 ? void 0 : settings.name)), true), kuiUtils.addToArrayByCondition(type !== "finish", __assign({ label: "Serial code", name: "serialNumber", size: 6 }, settings === null || settings === void 0 ? void 0 : settings.serialNumber)), true), kuiUtils.addToArrayByCondition(type !== "finish", __assign({ label: "Amount", name: "numberOfSubjects", type: "number", size: 6 }, settings === null || settings === void 0 ? void 0 : settings.numberOfSubjects)), true), [
|
934
|
+
__assign({ label: "Description", name: "description", isTextArea: true }, settings === null || settings === void 0 ? void 0 : settings.description)
|
933
935
|
], false), kuiUtils.addToArrayByCondition(type !== "finish", __assign({ label: "Instruction", name: "instruction", variant: "custom", CustomInput: kuiCrm.InputFileWithVisibility }, settings === null || settings === void 0 ? void 0 : settings.instruction)), true); };
|
934
936
|
|
935
937
|
var FillingInfoFieldsSchema = yup__namespace.object().shape({
|
@@ -937,8 +939,7 @@ var FillingInfoFieldsSchema = yup__namespace.object().shape({
|
|
937
939
|
tag: yup__namespace.object({
|
938
940
|
name: yup__namespace.string().required("This is a required field"),
|
939
941
|
}),
|
940
|
-
name: yup__namespace.string().
|
941
|
-
serialNumber: yup__namespace.string().when("type", {
|
942
|
+
name: yup__namespace.string().when("type", {
|
942
943
|
is: function (value) { return value === "electronics"; },
|
943
944
|
then: function (rule) { return rule.required(kuiCrm.defaultRequiredMessage); },
|
944
945
|
}),
|
@@ -952,7 +953,7 @@ var getMeterFeaturesFieldsSchema = function (valuesFields) {
|
|
952
953
|
return yup__namespace.object().shape(__assign(__assign({}, meterFeaturesFieldsSchema), Object.assign.apply(Object, __spreadArray([{}], valuesSchema, false))));
|
953
954
|
};
|
954
955
|
|
955
|
-
var
|
956
|
+
var getInventoryMeterFields = function (settings, inputsSettings) { return __spreadArray(__spreadArray([], kuiCrm.basicFieldsOfNewResourceMeter(settings, inputsSettings), true), [
|
956
957
|
__assign({ label: "Activation date", name: "startDate", variant: "date", max: luxon.DateTime.now() }, inputsSettings === null || inputsSettings === void 0 ? void 0 : inputsSettings.startDate),
|
957
958
|
__assign({ label: "Passport", name: "passportFile", variant: "custom", CustomInput: kuiComplex.InputFile }, inputsSettings === null || inputsSettings === void 0 ? void 0 : inputsSettings.passportFile),
|
958
959
|
], false); };
|
@@ -963,7 +964,7 @@ function InventoryMeterInfoFields(props) {
|
|
963
964
|
var defaultType = resource === "water" ? "cold" : "T1";
|
964
965
|
var defaultMeterType = withMeterType ? defaultType : null;
|
965
966
|
var _a = react.useState((defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.type) || defaultMeterType), meterType = _a[0], setMeterType = _a[1];
|
966
|
-
var meterFields =
|
967
|
+
var meterFields = getInventoryMeterFields({
|
967
968
|
resource: resource,
|
968
969
|
meterType: meterType,
|
969
970
|
});
|
@@ -1217,6 +1218,7 @@ exports.getDetailApartmentInfoFields = getDetailApartmentInfoFields;
|
|
1217
1218
|
exports.getFillingInfoFields = getFillingInfoFields;
|
1218
1219
|
exports.getHouseInfoStep = getHouseInfoStep;
|
1219
1220
|
exports.getHouseServicesInfoStep = getHouseServicesInfoStep;
|
1221
|
+
exports.getInventoryMeterFields = getInventoryMeterFields;
|
1220
1222
|
exports.getMetersInfoStepFields = getMetersInfoStepFields;
|
1221
1223
|
exports.getPartialMeterInfoSchema = getPartialMeterInfoSchema;
|
1222
1224
|
exports.getRoomsApartmentInfoFields = getRoomsApartmentInfoFields;
|