kui-crm_actions 0.0.49 → 0.0.51
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 +7 -7
- package/cjs/index.js.map +1 -1
- package/index.d.ts +10 -10
- package/index.js +7 -7
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
@@ -80,7 +80,7 @@ type InspectionTypes =
|
|
80
80
|
| "initial"
|
81
81
|
| "inventory"
|
82
82
|
| "transfer"
|
83
|
-
| "
|
83
|
+
| "regular"
|
84
84
|
| "appraisal"
|
85
85
|
| "impairments"
|
86
86
|
|
@@ -130,7 +130,7 @@ type TransferInspectionTypes =
|
|
130
130
|
| "tenant_maroom"
|
131
131
|
| "maroom_landlord"
|
132
132
|
|
133
|
-
type
|
133
|
+
type RegularInspectionFormFields = CommonInspectionFormFields &
|
134
134
|
InspectionPartialMetersStepFields &
|
135
135
|
InspectionRoomsImagesFields
|
136
136
|
|
@@ -187,7 +187,7 @@ declare type PostApartmentInspectionRequest = {
|
|
187
187
|
inspection_type: InspectionTypes;
|
188
188
|
dropbox_link?: string;
|
189
189
|
initial?: InitialInspectionFieldsBody;
|
190
|
-
|
190
|
+
regular?: RegularlyInspectionFieldsBody;
|
191
191
|
transfer?: TransferInspectionFieldsBody;
|
192
192
|
};
|
193
193
|
declare type MeterValueModel = {
|
@@ -241,7 +241,7 @@ declare type InitialInspectionFieldsBody = {
|
|
241
241
|
city: number;
|
242
242
|
rooms: InitialInspectionRoomParams[];
|
243
243
|
} & Omit<Partial<ApartmentMainInfoModelFields>, "city" | "rooms">;
|
244
|
-
declare type
|
244
|
+
declare type RegularlyInspectionFieldsBody = {
|
245
245
|
meters: PartialMeterModel[];
|
246
246
|
};
|
247
247
|
declare type TransferInspectionFieldsBody = {
|
@@ -266,8 +266,8 @@ declare type InitialInspectionPostBody = {
|
|
266
266
|
initial: InitialInspectionFieldsBody;
|
267
267
|
photo_groups: InspectionRoomPhotoRequest[];
|
268
268
|
} & CommonInspectionFields;
|
269
|
-
declare type
|
270
|
-
|
269
|
+
declare type RegularInspectionPostBody = {
|
270
|
+
regular: RegularlyInspectionFieldsBody;
|
271
271
|
photo_groups: InspectionRoomPhotoRequest[];
|
272
272
|
} & CommonInspectionFields;
|
273
273
|
declare type TransferInspectionPostBody = {
|
@@ -409,7 +409,7 @@ declare const inspectionsRequests: {
|
|
409
409
|
createInspection(apartmentId: number, body: any, loader: Loader): Promise<number | undefined>;
|
410
410
|
loadInspectionImages(loader: Loader, roomsImages: InspectionRoomImagesParams[]): Promise<InspectionRoomPhotoRequest[]>;
|
411
411
|
createInitialInspection(data: InitialInspectionFormFields, apartmentId: number, loader: Loader): Promise<number | null | undefined>;
|
412
|
-
|
412
|
+
createRegularInspection(data: RegularInspectionFormFields, apartmentId: number, loader: Loader): Promise<number | null | undefined>;
|
413
413
|
createTransferInspection(data: TransferInspectionFormFields, apartmentId: number, loader: Loader): Promise<number | null | undefined>;
|
414
414
|
createInventoryInspection(data: InventoryInspectionFormFields, apartmentId: number, loader: Loader): Promise<number | null | undefined>;
|
415
415
|
getRoomParams(room: InspectionRoomImagesParams, photos?: ImageBodyRequest[] | undefined): {
|
@@ -422,7 +422,7 @@ declare const inspectionsRequests: {
|
|
422
422
|
declare const inspectionsRequestBody: {
|
423
423
|
getPostBodyInitialInspection(inspection: InitialInspectionFormFields, roomsImages: InspectionRoomPhotoRequest[]): InitialInspectionPostBody;
|
424
424
|
getInitialInspectionFields(inspection: InitialInspectionInfoFields): InitialInspectionFieldsBody;
|
425
|
-
|
425
|
+
getPostBodyRegularInspection(inspection: RegularInspectionFormFields, roomsImages: InspectionRoomPhotoRequest[], metersImages: ImageBodyRequest[][]): RegularInspectionPostBody;
|
426
426
|
getPostBodyTransferInspection(inspection: TransferInspectionFormFields, roomsImages: InspectionRoomPhotoRequest[], metersImages: ImageBodyRequest[][]): TransferInspectionPostBody;
|
427
427
|
getPartialInspectionMeters(meters: PartialMeterInfoFields[], metersImages: ImageBodyRequest[][]): {
|
428
428
|
meters: {
|
@@ -850,9 +850,9 @@ type ApartmentOverlayProps = {
|
|
850
850
|
inspection: ApartmentInspectionParams
|
851
851
|
map?: google.maps.Map
|
852
852
|
getClientLink?: (id: number) => string
|
853
|
-
|
853
|
+
getInspectionLink: (id: number, inspectionId: number) => string
|
854
854
|
}
|
855
855
|
|
856
856
|
declare const ApartmentInspectionOverlay: (props: ApartmentOverlayProps) => JSX.Element;
|
857
857
|
|
858
|
-
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,
|
858
|
+
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 };
|
package/index.js
CHANGED
@@ -174,14 +174,14 @@ var inspectionsRequestBody = {
|
|
174
174
|
}); }),
|
175
175
|
};
|
176
176
|
},
|
177
|
-
|
177
|
+
getPostBodyRegularInspection: function (inspection, roomsImages, metersImages) {
|
178
178
|
return {
|
179
179
|
date: DateTime.now().toISODate(),
|
180
|
-
inspection_type: "
|
180
|
+
inspection_type: "regular",
|
181
181
|
based_on: null,
|
182
182
|
dropbox_link: inspection.dropboxLink,
|
183
183
|
photo_groups: roomsImages,
|
184
|
-
|
184
|
+
regular: this.getPartialInspectionMeters(inspection.meters, metersImages),
|
185
185
|
};
|
186
186
|
},
|
187
187
|
getPostBodyTransferInspection: function (inspection, roomsImages, metersImages) {
|
@@ -355,7 +355,7 @@ var inspectionsRequests = {
|
|
355
355
|
});
|
356
356
|
});
|
357
357
|
},
|
358
|
-
|
358
|
+
createRegularInspection: function (data, apartmentId, loader) {
|
359
359
|
var _a;
|
360
360
|
return __awaiter(this, void 0, void 0, function () {
|
361
361
|
var metersImages, files, body;
|
@@ -370,7 +370,7 @@ var inspectionsRequests = {
|
|
370
370
|
], metersImages, true))];
|
371
371
|
case 1:
|
372
372
|
files = _b.sent();
|
373
|
-
body = inspectionsRequestBody.
|
373
|
+
body = inspectionsRequestBody.getPostBodyRegularInspection(data, files[0], files.slice(1));
|
374
374
|
return [2 /*return*/, this.createInspection(apartmentId, body, loader)];
|
375
375
|
case 2: return [2 /*return*/, null];
|
376
376
|
}
|
@@ -759,10 +759,10 @@ var StyledPhoneIcon = styled(PhoneIcon)(templateObject_2$1 || (templateObject_2$
|
|
759
759
|
var templateObject_1$2, templateObject_2$1;
|
760
760
|
|
761
761
|
var ApartmentInspectionCard = function (props) {
|
762
|
-
var inspection = props.inspection, onClose = props.onClose, getClientLink = props.getClientLink,
|
762
|
+
var inspection = props.inspection, onClose = props.onClose, getClientLink = props.getClientLink, getInspectionLink = props.getInspectionLink;
|
763
763
|
var apartment = inspection.apartment, tenant = inspection.tenant, metroStations = inspection.metroStations;
|
764
764
|
var clientLink = getClientLink ? getClientLink(tenant.id) : "";
|
765
|
-
var apartmentLink =
|
765
|
+
var apartmentLink = getInspectionLink(apartment.id, inspection.id);
|
766
766
|
return (jsxs(StyledCard, { children: [jsx(Link, __assign({ href: apartmentLink }, { children: jsx(StyledPreviewContent, { imageSrc: apartment.previewImage, description: "".concat(apartment.address, ", \u043A\u0432. ").concat(apartment.apartmentNumber) }) })), jsx(Grid, __assign({ container: true, spacing: 2, alignItems: "center" }, { children: metroStations.map(function (station) { return (jsx(MetroStation, { metroStation: station }, station.name)); }) })), jsxs(StyledTenantInfo, __assign({ container: true, alignItems: "center", justify: "space-between" }, { children: [clientLink ? (jsx(StyledClientLink, __assign({ href: clientLink }, { children: jsx(UserBadge, { weight: 500, user: tenant }) }))) : (jsx(UserBadge, { weight: 500, user: tenant })), !!tenant.phone && jsx(ContactPhone, { phone: tenant.phone })] })), jsx(StyledCloseButton, __assign({ isCircle: true, size: "xs", variant: "whiteWithGray", onClick: onClose }, { children: jsx(CloseIcon, { width: 6, height: 6 }) }))] }));
|
767
767
|
};
|
768
768
|
var StyledCard = styled.div(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n width: 330px;\n background: ", ";\n border-radius: 8px;\n padding: 8px;\n position: absolute;\n bottom: 46px;\n left: -115px;\n z-index: 1;\n"], ["\n width: 330px;\n background: ", ";\n border-radius: 8px;\n padding: 8px;\n position: absolute;\n bottom: 46px;\n left: -115px;\n z-index: 1;\n"])), theme.palette.grey.zero);
|