kui-crm_actions 0.0.80 → 0.0.82

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 { InputParams, ResourceTypes, MeterTypes, FileStore, InputFileWithVisibilityFields, MeterFeaturesFormFields, InspectionTypes, InspectionRoomPhotoTypes, ParkingTypes, CityParams, RoomTypes, RenovationParams, RoomParams, ImageStore, ApartmentDescriptionParams, ApartmentMetroStationsParams, PhoneParams, WifiParams, InternetProviderParams, TVTypes, CompanyAutocompleteFields, CountryAutocompleteFields, TaxesTypes, MetersCountParams, FillingTagsAutocompleteFields, ApartmentFillingVariants, ImageBodyRequest, FillingInfoFormFields as FillingInfoFormFields$1, ContractLinkModel, FileBodyRequest, RoomType, ApartmentMainInfoModelFields, PostInspectionFillingListModel, ApartmentDetailInfoModelFields, ApartmentModel, ApartmentPartialDescriptionParams, MainObjectInfoInterface, ApartmentMainInfoParams, SecurityObjectInfoInterface, ApartmentSecurityInfoParams, DetailObjectInfoInterface, ApartmentDetailInfoParams, ApartmentTelecommunicationInfoParams, ApartmentHouseInfoParams, MaxMetersInfoParams, LatLonParams, InspectionRoomPhotoModel, InspectionFillingModel, ApartmentMetroParams, TransferInspectionMeterModel, InventoryInspectionMeterModel, InspectionPartialMetersInfoParams, ApartmentPaymentInfoParams, FullInspectionCommonFields, InspectionPaymentInfoParams, InspectionMeterCommonInfo, InspectionMeterInfoParams, InventoryInspectionFields, InspectionMetersInfoParams, InspectionFeedbackParams, FillingListItemModel, GeolocationParams } from 'kui-crm';
2
+ import { InputParams, ResourceTypes, MeterTypes, FileStore, InputFileWithVisibilityFields, MeterFeaturesFormFields, InspectionTypes, InspectionRoomPhotoTypes, ParkingTypes, CityParams, RoomTypes, RenovationParams, RoomParams, ImageStore, ApartmentDescriptionParams, ApartmentMetroStationsParams, PhoneParams, WifiParams, InternetProviderParams, TVTypes, CompanyAutocompleteFields, CountryAutocompleteFields, TaxesTypes, MetersCountParams, FillingTagsAutocompleteFields, ApartmentFillingVariants, ImageBodyRequest, FillingInfoFormFields as FillingInfoFormFields$1, ContractLinkModel, FileBodyRequest, RoomType, ApartmentMainInfoModelFields, PostInspectionFillingListModel, ApartmentDetailInfoModelFields, ApartmentModel, ApartmentPartialDescriptionParams, MainObjectInfoInterface, ApartmentMainInfoParams, SecurityObjectInfoInterface, ApartmentSecurityInfoParams, DetailObjectInfoInterface, ApartmentDetailInfoParams, ApartmentTelecommunicationInfoParams, ApartmentHouseInfoParams, MaxMetersInfoParams, LatLonParams, InspectionRoomPhotoModel, InspectionFillingModel, ApartmentMetroParams, TransferInspectionMeterModel, InventoryInspectionMeterModel, InspectionPartialMetersInfoParams, ApartmentPaymentInfoParams, FullInspectionCommonFields, InspectionPaymentInfoParams, InspectionMeterCommonInfo, InspectionMeterInfoParams, InventoryInspectionFields, InspectionMetersInfoParams, InspectionFeedbackParams, FillingTypes, FillingListItemModel, 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';
@@ -152,11 +152,11 @@ type InspectionFillingCardProps = {
152
152
 
153
153
  type InspectionFillingItemFields = {
154
154
  id: number
155
- check: boolean
155
+ check?: boolean | null
156
156
  }
157
157
 
158
158
  type InspectionFillingListFields = {
159
- filling: InspectionFillingItemFields[]
159
+ fillingList: InspectionFillingItemFields[]
160
160
  }
161
161
 
162
162
  declare const InspectionFillingCard: (props: InspectionFillingCardProps) => JSX.Element;
@@ -875,7 +875,7 @@ declare class FillingListStore {
875
875
  fillingList: FillingCheckParams[];
876
876
  loader: Loader;
877
877
  constructor();
878
- fetchFillingList: (apartmentId: number) => Promise<void>;
878
+ fetchFillingList: (apartmentId: number, fillingType?: FillingTypes | undefined) => Promise<void>;
879
879
  updateFillingList: (fillingList: FillingListItemModel[]) => void;
880
880
  }
881
881
 
package/index.js CHANGED
@@ -194,7 +194,7 @@ var inspectionsRequestBody = {
194
194
  based_on: null,
195
195
  dropbox_link: inspection.dropboxLink,
196
196
  photo_groups: roomsImages,
197
- regular: __assign(__assign({}, this.getInspectionFilling(inspection.filling)), this.getPartialInspectionMeters(inspection.meters)),
197
+ regular: __assign(__assign({}, this.getInspectionFilling(inspection.fillingList)), this.getPartialInspectionMeters(inspection.meters)),
198
198
  };
199
199
  },
200
200
  getPostBodyTransferInspection: function (inspection, roomsImages) {
@@ -204,7 +204,7 @@ var inspectionsRequestBody = {
204
204
  based_on: null,
205
205
  dropbox_link: inspection.dropboxLink,
206
206
  photo_groups: roomsImages,
207
- transfer: __assign(__assign({ transfer_type: inspection.transferType }, this.getInspectionFilling(inspection.filling)), this.getPartialInspectionMeters(inspection.meters)),
207
+ transfer: __assign(__assign({ transfer_type: inspection.transferType }, this.getInspectionFilling(inspection.fillingList)), this.getPartialInspectionMeters(inspection.meters)),
208
208
  };
209
209
  },
210
210
  getInspectionFilling: function (fillingList) {
@@ -972,7 +972,7 @@ var templateObject_1$5, templateObject_2$4, templateObject_3$1;
972
972
 
973
973
  var InspectionFillingCard = function (props) {
974
974
  var className = props.className, form = props.form, index = props.index, disabled = props.disabled, other = __rest(props, ["className", "form", "index", "disabled"]);
975
- return (jsx(StyledCard$1, __assign({ className: className }, { children: jsx(StyledCheckbox, { form: form, name: "filling.".concat(index, ".check"), label: jsx(FillingCardContent, __assign({}, other)), disabled: disabled }) })));
975
+ return (jsx(StyledCard$1, __assign({ className: className }, { children: jsx(StyledCheckbox, { form: form, name: "fillingList.".concat(index, ".check"), label: jsx(FillingCardContent, __assign({}, other)), disabled: disabled }) })));
976
976
  };
977
977
  var StyledCard$1 = styled(Grid)(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n padding: 8px 16px;\n border-radius: 12px;\n background: white;\n"], ["\n padding: 8px 16px;\n border-radius: 12px;\n background: white;\n"])));
978
978
  var StyledCheckbox = styled(CheckboxWithController)(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n .KUI-Label_checkbox {\n margin-left: 0;\n }\n"], ["\n .KUI-Label_checkbox {\n margin-left: 0;\n }\n"])));
@@ -995,13 +995,13 @@ var useMetersValues = function (formStore, metersStore) {
995
995
  var FillingListStore = /** @class */ (function () {
996
996
  function FillingListStore() {
997
997
  var _this = this;
998
- this.fetchFillingList = function (apartmentId) { return __awaiter(_this, void 0, void 0, function () {
998
+ this.fetchFillingList = function (apartmentId, fillingType) { return __awaiter(_this, void 0, void 0, function () {
999
999
  var response;
1000
1000
  return __generator(this, function (_a) {
1001
1001
  switch (_a.label) {
1002
1002
  case 0:
1003
1003
  this.loader.startLoading();
1004
- return [4 /*yield*/, to(ApartmentsAgent.getFillingList(apartmentId))];
1004
+ return [4 /*yield*/, to(ApartmentsAgent.getFillingList(apartmentId, fillingType))];
1005
1005
  case 1:
1006
1006
  response = _a.sent();
1007
1007
  resHandler(response, this.loader, this.updateFillingList);
@@ -1029,14 +1029,14 @@ var useFillingList = function (apartmentId, formStore, fillingStore) {
1029
1029
  useEffect(function () {
1030
1030
  var _a, _b;
1031
1031
  if (!((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.filling) === null || _b === void 0 ? void 0 : _b.length) && apartmentId) {
1032
- fillingStore.fetchFillingList(apartmentId);
1032
+ fillingStore.fetchFillingList(apartmentId, "appliance");
1033
1033
  }
1034
1034
  }, [apartmentId]);
1035
1035
  useEffect(function () {
1036
1036
  var _a, _b;
1037
1037
  if (!fillingStore.loader.isLoading && !((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.filling) === null || _b === void 0 ? void 0 : _b.length)) {
1038
1038
  formStore.updateFormFields({
1039
- filling: fillingStore.fillingList.map(function (filling) { return ({
1039
+ fillingList: fillingStore.fillingList.map(function (filling) { return ({
1040
1040
  id: filling.id,
1041
1041
  check: false,
1042
1042
  }); }),