kui-crm_actions 0.0.83 → 0.0.84

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 CHANGED
@@ -568,25 +568,21 @@ var apartmentFields = {
568
568
  : 0,
569
569
  }); });
570
570
  },
571
- getInspectionFillingParams: function (filling) {
571
+ getInspectionFillingParams: function (filling, withChecking) {
572
572
  var _a;
573
- return {
574
- id: filling.id,
575
- name: filling.description || "",
576
- tag: {
573
+ return __assign({ id: filling.id, name: filling.description || "", tag: {
577
574
  id: filling.feature.id,
578
575
  name: filling.feature.name,
579
- },
580
- images: (_a = filling.photos) === null || _a === void 0 ? void 0 : _a.map(function (image) {
576
+ }, images: (_a = filling.photos) === null || _a === void 0 ? void 0 : _a.map(function (image) {
581
577
  return kuiCrm.ImageStore.initFromImageModel(image);
582
- }),
583
- serialNumber: filling.serial_code,
584
- numberOfSubjects: Number(filling.amount),
585
- instruction: filling.instruction
578
+ }), serialNumber: filling.serial_code, numberOfSubjects: Number(filling.amount), instruction: filling.instruction
586
579
  ? kuiCrm.FileStore.initFromDocumentModel(filling.instruction)
587
- : null,
588
- type: kuiCrm.matchesAPIFillingTypes[filling.feature.feature_type],
589
- };
580
+ : null, type: kuiCrm.matchesAPIFillingTypes[filling.feature.feature_type] }, (withChecking && filling.feature.feature_type === "appliance"
581
+ ? {
582
+ check: !filling.is_absent,
583
+ wasMissing: filling.previously_absent,
584
+ }
585
+ : {}));
590
586
  },
591
587
  getApartmentDescriptionWithMetro: function (apartment) {
592
588
  return __assign(__assign({}, this.getApartmentDescriptionInfo(apartment)), { metroStations: this.getMetroStationsParams(apartment === null || apartment === void 0 ? void 0 : apartment.metro_stations) });
@@ -1065,10 +1061,7 @@ var useFillingList = function (apartmentId, formStore, fillingStore) {
1065
1061
  var _a, _b;
1066
1062
  if (!fillingStore.loader.isLoading && !((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.filling) === null || _b === void 0 ? void 0 : _b.length)) {
1067
1063
  formStore.updateFormFields({
1068
- fillingList: fillingStore.fillingList.map(function (filling) { return ({
1069
- id: filling.id,
1070
- check: false,
1071
- }); }),
1064
+ fillingList: fillingStore.fillingList.map(function (filling) { return (__assign(__assign({}, filling), { check: false })); }),
1072
1065
  });
1073
1066
  }
1074
1067
  }, [fillingStore.fillingList, fillingStore.loader.isLoading]);