kui-crm_actions 0.0.149 → 0.0.151

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,10 +1,10 @@
1
1
  import * as kui_crm from 'kui-crm';
2
- import { InputParams, ResourceTypes, MeterTypes, FileStore, InputFileWithVisibilityFields, MeterFeaturesFormFields, InspectionTypes, InspectionRoomPhotoTypes, ParkingTypes, ImageStore, ApartmentDescriptionParams, ApartmentMetroStationsParams, CityParams, RoomTypes, RenovationParams, RoomParams, HouseTypes, WallMaterials, OverlapTypes, GasTypes, PhoneParams, WifiParams, InternetProviderParams, TVTypes, CompanyAutocompleteFields, CountryAutocompleteFields, TaxesTypes, MetersCountParams, ContractLinkModel, ImageBodyRequest, FileBodyRequest, RoomType, ApartmentMetroParams, ApartmentMainInfoModelFields, HouseInfoModelFields, PostInspectionFillingListModel, ApartmentDetailInfoModelFields, FillingTypes, FillingListItemModel, FillingInfoFormFields as FillingInfoFormFields$1, FillingTagsAutocompleteFields, ApartmentFillingVariants, ApartmentModel, ApartmentPartialDescriptionParams, MainObjectInfoInterface, ApartmentMainInfoParams, SecurityObjectInfoInterface, ApartmentSecurityInfoParams, DetailObjectInfoInterface, ApartmentDetailInfoParams, ApartmentTelecommunicationInfoParams, ApartmentWithHouseInfoModelFields, ApartmentHouseInfoParams, MaxMetersInfoParams, LatLonParams, InspectionRoomPhotoModel, InspectionFillingModel, TransferInspectionMeterModel, InventoryInspectionMeterModel, InspectionPartialMetersInfoParams, ApartmentPaymentInfoParams, FullInspectionCommonFields, InspectionPaymentInfoParams, InspectionMeterCommonInfo, InspectionMeterInfoParams, InventoryInspectionFields, InspectionMetersInfoParams, BasicMeterFieldsSettings, InputByTypeProps, BasicMeterFeaturesFormFields, InspectionFeedbackParams, GeolocationParams } from 'kui-crm';
2
+ import { InputParams, ResourceTypes, MeterTypes, FileStore, InputFileWithVisibilityFields, MeterFeaturesFormFields, InspectionTypes, InspectionRoomPhotoTypes, ParkingTypes, CityParams, ApartmentMetroStationsParams, RoomTypes, RenovationParams, RoomParams, HouseTypes, WallMaterials, OverlapTypes, GasTypes, ImageStore, ApartmentDescriptionParams, PhoneParams, WifiParams, InternetProviderParams, TVTypes, CompanyAutocompleteFields, CountryAutocompleteFields, TaxesTypes, MetersCountParams, ContractLinkModel, ImageBodyRequest, FileBodyRequest, RoomType, ApartmentMetroParams, ApartmentMainInfoModelFields, HouseInfoModelFields, PostInspectionFillingListModel, TransferInspectionTypes as TransferInspectionTypes$1, ApartmentDetailInfoModelFields, FillingTypes, FillingListItemModel, FillingInfoFormFields as FillingInfoFormFields$1, FillingTagsAutocompleteFields, ApartmentFillingVariants, ApartmentModel, ApartmentPartialDescriptionParams, MainObjectInfoInterface, ApartmentMainInfoParams, SecurityObjectInfoInterface, ApartmentSecurityInfoParams, DetailObjectInfoInterface, ApartmentDetailInfoParams, ApartmentTelecommunicationInfoParams, ApartmentWithHouseInfoModelFields, ApartmentHouseInfoParams, MaxMetersInfoParams, LatLonParams, InspectionRoomPhotoModel, InspectionFillingModel, TransferInspectionMeterModel, InventoryInspectionMeterModel, InspectionPartialMetersInfoParams, ApartmentPaymentInfoParams, FullInspectionCommonFields, InspectionPaymentInfoParams, InspectionMeterCommonInfo, InspectionMeterInfoParams, InventoryInspectionFields, InspectionMetersInfoParams, BasicMeterFieldsSettings, InputByTypeProps, BasicMeterFeaturesFormFields, InspectionFeedbackParams, 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';
6
- import { UseFormReturn } from 'react-hook-form';
7
6
  import { InputWithAddressFields } from 'kui-complex/dist/InputWithAddressAutocomplete';
7
+ import { UseFormReturn } from 'react-hook-form';
8
8
  import { ReactElement } from 'react';
9
9
 
10
10
  declare const getPartialMeterInfoSchema: (valuesFields: InputParams<any>[]) => yup.ObjectSchema<{
@@ -99,78 +99,6 @@ type InspectionImageFieldsSettings = {
99
99
  [key: string]: any
100
100
  }
101
101
 
102
- type InspectionFillingCardProps = {
103
- className?: string
104
- form: UseFormReturn<any>
105
- index: number
106
- filling: FillingCheckParams
107
- warningLabel: string
108
- disabled?: boolean
109
- }
110
-
111
- type InspectionFillingItemFields = {
112
- id: number
113
- check?: boolean | null
114
- }
115
-
116
- type InspectionFillingListFields = {
117
- fillingList: InspectionFillingItemFields[]
118
- }
119
-
120
- declare const InspectionFillingCard: (props: InspectionFillingCardProps) => JSX.Element;
121
-
122
- type TransferInspectionTypes =
123
- | "maroom_tenant"
124
- | "tenant_maroom"
125
- | "maroom_landlord"
126
- | "tenant_landlord"
127
-
128
- type RegularInspectionFormFields = CommonInspectionFormFields &
129
- InspectionPartialMetersStepFields &
130
- InspectionRoomsImagesFields &
131
- InspectionFillingListFields
132
-
133
- type TransferInspectionFormFields = {
134
- transferType: TransferInspectionTypes
135
- } & CommonInspectionFormFields &
136
- InspectionPartialMetersStepFields &
137
- InspectionRoomsImagesFields &
138
- InspectionFillingListFields
139
-
140
- type MeterValue = string | number | null
141
-
142
- type MeterValuesFields = {
143
- resource: ResourceTypes
144
- type?: MeterTypes
145
- value?: MeterValue
146
- T1?: MeterValue
147
- T2?: MeterValue
148
- T3?: MeterValue
149
- initialValue?: MeterValue
150
- initialValueT1?: MeterValue
151
- initialValueT2?: MeterValue
152
- initialValueT3?: MeterValue
153
- }
154
-
155
- type RoomImagesParams = {
156
- type: InspectionRoomPhotoTypes
157
- comment?: string
158
- images: ImageStore[]
159
- roomNumber?: number
160
- }
161
-
162
- type ApartmentDescriptionWithMetro = ApartmentDescriptionParams &
163
- ApartmentMetroStationsParams
164
-
165
- type FillingCheckParams = {
166
- id: number
167
- name: string
168
- tagName: string
169
- serialNumber?: string
170
- numberOfSubjects?: number | string | null
171
- wasMissing?: boolean
172
- }
173
-
174
102
  type BasicApartmentInfoStepFields = {
175
103
  apartment: InputWithAddressFields
176
104
  apartmentNumber: number | string | null
@@ -243,6 +171,78 @@ type InitialInspectionInfoFields = BasicApartmentInfoStepFields &
243
171
  DetailApartmentInfoStepFields &
244
172
  HouseInfoStepFields
245
173
 
174
+ type InspectionFillingCardProps = {
175
+ className?: string
176
+ form: UseFormReturn<any>
177
+ index: number
178
+ filling: FillingCheckParams
179
+ warningLabel: string
180
+ disabled?: boolean
181
+ }
182
+
183
+ type InspectionFillingItemFields = {
184
+ id: number
185
+ check?: boolean | null
186
+ }
187
+
188
+ type InspectionFillingListFields = {
189
+ fillingList: InspectionFillingItemFields[]
190
+ }
191
+
192
+ declare const InspectionFillingCard: (props: InspectionFillingCardProps) => JSX.Element;
193
+
194
+ type TransferInspectionTypes =
195
+ | "maroom_tenant"
196
+ | "tenant_maroom"
197
+ | "maroom_landlord"
198
+ | "tenant_landlord"
199
+
200
+ type RegularInspectionFormFields = CommonInspectionFormFields &
201
+ InspectionPartialMetersStepFields &
202
+ InspectionRoomsImagesFields &
203
+ InspectionFillingListFields
204
+
205
+ type TransferInspectionFormFields = {
206
+ transferType: TransferInspectionTypes
207
+ } & CommonInspectionFormFields &
208
+ InspectionPartialMetersStepFields &
209
+ InspectionRoomsImagesFields &
210
+ InspectionFillingListFields
211
+
212
+ type MeterValue = string | number | null
213
+
214
+ type MeterValuesFields = {
215
+ resource: ResourceTypes
216
+ type?: MeterTypes
217
+ value?: MeterValue
218
+ T1?: MeterValue
219
+ T2?: MeterValue
220
+ T3?: MeterValue
221
+ initialValue?: MeterValue
222
+ initialValueT1?: MeterValue
223
+ initialValueT2?: MeterValue
224
+ initialValueT3?: MeterValue
225
+ }
226
+
227
+ type RoomImagesParams = {
228
+ type: InspectionRoomPhotoTypes
229
+ comment?: string
230
+ images: ImageStore[]
231
+ roomNumber?: number
232
+ }
233
+
234
+ type ApartmentDescriptionWithMetro = ApartmentDescriptionParams &
235
+ ApartmentMetroStationsParams
236
+
237
+ type FillingCheckParams = {
238
+ id: number
239
+ name: string
240
+ tagName: string
241
+ serialNumber?: string
242
+ numberOfSubjects?: number | string | null
243
+ wasMissing?: boolean
244
+ }
245
+
246
246
  type HouseServicesInfoStepFields = {
247
247
  hasBarrier: boolean | null
248
248
  barrierPhone: PhoneParams | null
@@ -384,7 +384,7 @@ declare type RegularlyInspectionFieldsBody = {
384
384
  meters: PartialMeterModel[];
385
385
  } & PostInspectionFillingListModel;
386
386
  declare type TransferInspectionFieldsBody = {
387
- transfer_type: TransferInspectionTypes;
387
+ transfer_type: TransferInspectionTypes$1;
388
388
  meters: PartialMeterModel[];
389
389
  contract_document?: FileBodyRequest | null;
390
390
  } & PostInspectionFillingListModel;
@@ -426,7 +426,7 @@ declare type InspectionTypesResponse = {
426
426
  inspection_types: InspectionTypes[];
427
427
  };
428
428
  declare type TransferTypesResponse = {
429
- transfer_inspection_types: TransferInspectionTypes[];
429
+ transfer_inspection_types: TransferInspectionTypes$1[];
430
430
  };
431
431
 
432
432
  declare class FillingListStore {
@@ -502,8 +502,8 @@ type InventoryInspectionPostFormFields = {
502
502
  } & Omit<InventoryInspectionFormFields, "fillingList">
503
503
 
504
504
  declare const inspectionsRequests: {
505
- getInspectionTypes(apartmentId: number): Promise<InspectionTypes[] | undefined>;
506
- getTransferTypes(apartmentId: number): Promise<TransferInspectionTypes[] | undefined>;
505
+ getInspectionTypes(apartmentId: number): Promise<[Error | null, InspectionTypes[] | undefined]>;
506
+ getTransferTypes(apartmentId: number): Promise<[Error | null, TransferInspectionTypes$1[] | undefined]>;
507
507
  createInspection(apartmentId: number, body: any, loader: Loader): Promise<number | undefined>;
508
508
  createInitialInspection(data: InitialInspectionFormFields, apartmentId: number, loader: Loader): Promise<number | null | undefined>;
509
509
  createRegularInspection(data: RegularInspectionFormFields, apartmentId: number, loader: Loader): Promise<number | null | undefined>;
package/index.js CHANGED
@@ -356,26 +356,30 @@ var inspectionsRequestBody = {
356
356
  var inspectionsRequests = {
357
357
  getInspectionTypes: function (apartmentId) {
358
358
  return __awaiter(this, void 0, void 0, function () {
359
- var _a, res;
359
+ var _a, err, res;
360
360
  return __generator(this, function (_b) {
361
361
  switch (_b.label) {
362
362
  case 0: return [4 /*yield*/, to(requests.get("/apartments/".concat(apartmentId, "/inspection-types")))];
363
363
  case 1:
364
- _a = _b.sent(), _a[0], res = _a[1];
365
- return [2 /*return*/, res === null || res === void 0 ? void 0 : res.inspection_types];
364
+ _a = _b.sent(), err = _a[0], res = _a[1];
365
+ if (err)
366
+ return [2 /*return*/, [err, undefined]];
367
+ return [2 /*return*/, [null, res === null || res === void 0 ? void 0 : res.inspection_types]];
366
368
  }
367
369
  });
368
370
  });
369
371
  },
370
372
  getTransferTypes: function (apartmentId) {
371
373
  return __awaiter(this, void 0, void 0, function () {
372
- var _a, res;
374
+ var _a, err, res;
373
375
  return __generator(this, function (_b) {
374
376
  switch (_b.label) {
375
377
  case 0: return [4 /*yield*/, to(requests.get("/apartments/".concat(apartmentId, "/transfer-inspection-types")))];
376
378
  case 1:
377
- _a = _b.sent(), _a[0], res = _a[1];
378
- return [2 /*return*/, res === null || res === void 0 ? void 0 : res.transfer_inspection_types];
379
+ _a = _b.sent(), err = _a[0], res = _a[1];
380
+ if (err)
381
+ return [2 /*return*/, [err, undefined]];
382
+ return [2 /*return*/, [null, res === null || res === void 0 ? void 0 : res.transfer_inspection_types]];
379
383
  }
380
384
  });
381
385
  });