@rentcheck/biz 1.0.1 → 1.0.3

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/package.json CHANGED
@@ -1,20 +1,27 @@
1
1
  {
2
2
  "name": "@rentcheck/biz",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "RC biz",
5
- "types": "lib/index.d.ts",
6
- "main": "dist/index.js",
5
+ "author": "engineering@getrentcheck.com",
6
+ "license": "MIT",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
7
9
  "scripts": {
8
10
  "build": "tsc",
9
11
  "build:watch": "tsc --watch",
10
12
  "test": "cross-env NODE_ENV=test jest --verbose --forceExit"
11
13
  },
12
- "author": "engineering@getrentcheck.com",
13
- "license": "MIT",
14
14
  "devDependencies": {
15
- "@rentcheck/types": "^1.0.460",
16
- "@types/node": "^20.11.30",
17
- "jest": "^29.7.0",
18
- "typescript": "^5.4.3"
15
+ "@babel/runtime": "^7.16.7",
16
+ "@types/lodash": "^4.14.194",
17
+ "jest": "^27.5.1",
18
+ "typescript": "^4.2.3"
19
+ },
20
+ "dependencies": {
21
+ "@rentcheck/types": "file:../types",
22
+ "lodash": "^4.17.21"
23
+ },
24
+ "localDependencies": {
25
+ "@rentcheck/types": "../types"
19
26
  }
20
27
  }
@@ -0,0 +1 @@
1
+ export * as RoomConstants from './rooms';
@@ -1 +1,2 @@
1
1
  export * as Constants from './constants';
2
+ export * as Utils from './utils';
@@ -1 +1 @@
1
- export * as Constants from './constants';
1
+ export * as InspectionTemplates from './inspection-templates';
@@ -10,7 +10,12 @@ import {
10
10
  Timestamp,
11
11
  } from '@rentcheck/types';
12
12
 
13
- import { Constants } from '../../utils';
13
+ import {
14
+ addOrdinalToSectionName,
15
+ parseSelectedSectionName,
16
+ parseTemplateRoomName,
17
+ sectionCanExistMultipleTimes,
18
+ } from './common';
14
19
 
15
20
  type BasicFeatureProps = Pick<
16
21
  TemplateFeature,
@@ -135,75 +140,6 @@ const createFeaturesFromSection = (
135
140
  );
136
141
  };
137
142
 
138
- export const parseTemplateRoomName = (name: string) => {
139
- if (name === 'Floors') {
140
- return 'Floor';
141
- }
142
-
143
- if (name === 'Full Bathrooms') {
144
- return 'Full Bathroom';
145
- }
146
-
147
- if (name === 'Half Bathrooms') {
148
- return 'Half Bathroom';
149
- }
150
-
151
- if (name === 'Bedrooms') {
152
- return 'Bedroom';
153
- }
154
-
155
- return name;
156
- };
157
-
158
- export const sectionCanExistMultipleTimes = (sectionName: string) =>
159
- [
160
- 'Bedroom',
161
- 'Bedrooms',
162
- 'Full Bathroom',
163
- 'Full Bathrooms',
164
- 'Half Bathroom',
165
- 'Half Bathrooms',
166
- 'Floor',
167
- 'Floors',
168
- ].includes(sectionName);
169
-
170
- const addOrdinalToFloorSection = (number: number) => {
171
- /**
172
- * America has no concept of a ground floor, so we add 1 to the number
173
- * to get the correct floor name. /shrug
174
- */
175
- const floor = number + 1;
176
-
177
- if (floor % 10 === 1) {
178
- return `${floor}st Floor`;
179
- }
180
-
181
- if (floor % 10 === 2) {
182
- return `${floor}nd Floor`;
183
- }
184
-
185
- if (floor % 10 === 3) {
186
- return `${floor}rd Floor`;
187
- }
188
-
189
- return `${floor}th Floor`;
190
- };
191
-
192
- /**
193
- * Adds an ordinal to the section to account for repeatable sections.
194
- *
195
- * @param sectionName Floor, Bedroom, Full Bathroom, Half Bathroom
196
- * @param number index of the section, 0 indexed
197
- * @returns the updated section name, e.g. "First Floor", "Second Bedroom"
198
- */
199
- const addOrdinalToSectionName = (sectionName: string, number: number) => {
200
- if (sectionName === 'Floor') {
201
- return addOrdinalToFloorSection(number);
202
- }
203
-
204
- return `${Constants.ordinalPrefixes[number]} ${sectionName}`;
205
- };
206
-
207
143
  const createFeaturesFromRepeatableSection = (
208
144
  sectionName: string,
209
145
  section: TemplateSection,
@@ -228,26 +164,6 @@ const createFeaturesFromRepeatableSection = (
228
164
  .flat();
229
165
  };
230
166
 
231
- const parseSelectedSectionName = (name: string) => {
232
- if (/(\d)+(st|nd|rd|th) Floor/.test(name)) {
233
- return 'Floors';
234
- }
235
-
236
- if (/\w+ Full Bathroom/.test(name)) {
237
- return 'Full Bathrooms';
238
- }
239
-
240
- if (/\w+ Half Bathroom/.test(name)) {
241
- return 'Half Bathrooms';
242
- }
243
-
244
- if (/\w+ Bedroom/.test(name)) {
245
- return 'Bedrooms';
246
- }
247
-
248
- return name;
249
- };
250
-
251
167
  const createFeaturesForSpecificFeaturesTemplate = (
252
168
  inspection: Inspection,
253
169
  inspectionTemplate: InspectionTemplate
@@ -0,0 +1,123 @@
1
+ import { RoomConstants } from '../../constants';
2
+
3
+ /**
4
+ * Converts the template room name from plural to singular, this is to
5
+ * account for legacy functionality where the template section name is
6
+ * plural and the feature section name is singular.
7
+ * @param name the section name
8
+ * @returns the singular version of the template section name
9
+ */
10
+ export const parseTemplateRoomName = (name: string) => {
11
+ if (name === 'Floors') {
12
+ return 'Floor';
13
+ }
14
+
15
+ if (name === 'Full Bathrooms') {
16
+ return 'Full Bathroom';
17
+ }
18
+
19
+ if (name === 'Half Bathrooms') {
20
+ return 'Half Bathroom';
21
+ }
22
+
23
+ if (name === 'Bedrooms') {
24
+ return 'Bedroom';
25
+ }
26
+
27
+ return name;
28
+ };
29
+
30
+ /**
31
+ * Checks if a section can be created multiple times.
32
+ *
33
+ * @param sectionName the section name without ordinal
34
+ * @returns true if the section is repeatable based on property configuration
35
+ */
36
+ export const sectionCanExistMultipleTimes = (sectionName: string) =>
37
+ [
38
+ 'Bedroom',
39
+ 'Bedrooms',
40
+ 'Full Bathroom',
41
+ 'Full Bathrooms',
42
+ 'Half Bathroom',
43
+ 'Half Bathrooms',
44
+ 'Floor',
45
+ 'Floors',
46
+ ].includes(sectionName);
47
+
48
+ /**
49
+ * Parses the section name to remove the ordinal and return the template section name.
50
+ *
51
+ * @param name the section name including ordinal.
52
+ * Examples: 1st Floor, 2nd Floor, 3rd Floor, 4th Floor, 5th Floor,
53
+ * First Full Bathroom, Second Full Bathroom, Third Full Bathroom, Fourth Full Bathroom, Fifth Full Bathroom,
54
+ * First Half Bathroom, Second Half Bathroom, Third Half Bathroom, Fourth Half Bathroom, Fifth Half Bathroom,
55
+ * First Bedroom, Second Bedroom, Third Bedroom, Fourth Bedroom, Fifth Bedroom
56
+ *
57
+ * @returns The template section name without the ordinal.
58
+ * Examples: 1st Floor -> Floors, First Full Bathroom -> Full Bathrooms, etc.
59
+ */
60
+ export const parseSelectedSectionName = (name: string) => {
61
+ if (/(\d)+(st|nd|rd|th) Floor/.test(name)) {
62
+ return 'Floors';
63
+ }
64
+
65
+ if (/\w+ Full Bathroom/.test(name)) {
66
+ return 'Full Bathrooms';
67
+ }
68
+
69
+ if (/\w+ Half Bathroom/.test(name)) {
70
+ return 'Half Bathrooms';
71
+ }
72
+
73
+ if (/\w+ Bedroom/.test(name)) {
74
+ return 'Bedrooms';
75
+ }
76
+
77
+ return name;
78
+ };
79
+
80
+ /**
81
+ * Adds an ordinal to the floor section to account for repeatable sections.
82
+ * @param number the floor number, 0 based
83
+ * @returns the floor section + ordinal, e.g. "1st Floor", "2nd Floor"
84
+ */
85
+ const addOrdinalToFloorSection = (number: number) => {
86
+ /**
87
+ * America has no concept of a ground floor, so we add 1 to the number
88
+ * to get the correct floor name. /shrug
89
+ */
90
+ const floor = number + 1;
91
+
92
+ if (floor % 10 === 1) {
93
+ return `${floor}st Floor`;
94
+ }
95
+
96
+ if (floor % 10 === 2) {
97
+ return `${floor}nd Floor`;
98
+ }
99
+
100
+ if (floor % 10 === 3) {
101
+ return `${floor}rd Floor`;
102
+ }
103
+
104
+ return `${floor}th Floor`;
105
+ };
106
+
107
+ /**
108
+ * Adds an ordinal to the section to account for repeatable sections.
109
+ *
110
+ * @param sectionName Floor, Bedroom, Full Bathroom, Half Bathroom
111
+ * @param number index of the section, 0 indexed
112
+ * @returns the updated section name, e.g. "First Floor", "Second Bedroom"
113
+ */
114
+ export const addOrdinalToSectionName = (
115
+ sectionName: string,
116
+ number: number
117
+ ) => {
118
+ if (sectionName === 'Floor') {
119
+ return addOrdinalToFloorSection(number);
120
+ }
121
+
122
+ return `${RoomConstants.ordinalPrefixes[number]} ${sectionName}`;
123
+ };
@@ -0,0 +1,3 @@
1
+ export * from './build-template-features';
2
+ export * from './common';
3
+ export * from './template-logic';
@@ -0,0 +1,69 @@
1
+ import {
2
+ Feature,
3
+ InspectionTemplate,
4
+ MULTIPLE_CHOICE_RESPONSE_SEPARATOR,
5
+ } from '@rentcheck/types';
6
+ import _, { lowerCase } from 'lodash';
7
+ import { parseTemplateRoomName } from './common';
8
+
9
+ export const getQuestionIdsAttachedToLogic = (
10
+ inspectionTemplate: InspectionTemplate
11
+ ) =>
12
+ inspectionTemplate.sections
13
+ .map((section) => section.logic)
14
+ .flat()
15
+ .filter((logic) => logic.trigger_type === 'question')
16
+ .map((l) => l.trigger_id);
17
+
18
+ export const sectionShouldBeVisible = (
19
+ section: Feature['section'],
20
+ otherFeatures: Feature[],
21
+ template: InspectionTemplate
22
+ ): boolean => {
23
+ const templateSection = template.sections.find(
24
+ (s) =>
25
+ parseTemplateRoomName(s.name) === section.name && s.type === section.type
26
+ );
27
+
28
+ if (!templateSection) {
29
+ return false;
30
+ }
31
+
32
+ if (!templateSection.logic.length) {
33
+ return true;
34
+ }
35
+
36
+ /**
37
+ * If section has logic we need to find at least one trigger
38
+ * that allows it to show
39
+ */
40
+ return templateSection.logic.some((condition) => {
41
+ if (condition.trigger_type !== 'question') {
42
+ return false;
43
+ }
44
+
45
+ const featureWithQuestion = otherFeatures.find((f) =>
46
+ f.questions.some((q) => q.id === condition.trigger_id)
47
+ );
48
+
49
+ if (!featureWithQuestion) {
50
+ return false;
51
+ }
52
+
53
+ const questionIndex = featureWithQuestion?.questions.findIndex(
54
+ (q) => q.id === condition.trigger_id
55
+ );
56
+
57
+ /**
58
+ * Split first if it's multiple choice
59
+ * We lowercase because yes/no questions have been used for a long
60
+ * time and we're not sure if the case is enforced there
61
+ */
62
+ const conditionValue = condition.condition_value.map(lowerCase);
63
+ const response = featureWithQuestion.responses[questionIndex]
64
+ .split(MULTIPLE_CHOICE_RESPONSE_SEPARATOR)
65
+ .map(lowerCase);
66
+
67
+ return _.intersection(conditionValue, response).length > 0;
68
+ });
69
+ };
package/tsconfig.json CHANGED
@@ -5,13 +5,7 @@
5
5
  "target": "es6",
6
6
  "moduleResolution": "node",
7
7
  "esModuleInterop": true,
8
- "allowSyntheticDefaultImports": true,
9
-
10
- // typeorm
11
- "emitDecoratorMetadata": true,
12
- "experimentalDecorators": true,
13
- "sourceMap": true,
14
-
8
+
15
9
  // directories
16
10
  "rootDir": "src",
17
11
  "outDir": "dist",
@@ -1,10 +0,0 @@
1
- import { Feature, Inspection, InspectionTemplate, Property } from '@rentcheck/types';
2
- export declare const parseTemplateRoomName: (name: string) => string;
3
- export declare const sectionCanExistMultipleTimes: (sectionName: string) => boolean;
4
- type BuildTemplateFeaturesParams = {
5
- inspection: Inspection;
6
- property: Property;
7
- inspectionTemplate: InspectionTemplate;
8
- };
9
- export declare const buildTemplateFeatures: ({ inspection, property, inspectionTemplate, }: BuildTemplateFeaturesParams) => Promise<Feature[]>;
10
- export {};
@@ -1,215 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.buildTemplateFeatures = exports.sectionCanExistMultipleTimes = exports.parseTemplateRoomName = void 0;
13
- const utils_1 = require("../../utils");
14
- const createResponsesForFeature = (feature) => feature.questions.map((q) => {
15
- if (q.type === 'yes/no') {
16
- return 'Yes';
17
- }
18
- return '';
19
- });
20
- const createEmptyFeature = (inspection, basicFeatureProps, section, sectionName, sectionNameWithOrdinal) => (Object.assign(Object.assign({}, basicFeatureProps), { id: '', inspection_id: inspection.id, property_id: inspection.propertyID, section: {
21
- name: sectionName,
22
- name_with_ordinal: sectionNameWithOrdinal !== null && sectionNameWithOrdinal !== void 0 ? sectionNameWithOrdinal : sectionName,
23
- type: section.type,
24
- }, images: [], videos: [], image_links: [], video_links: [], rating: undefined, incomplete: true, not_applicable: false, notes: '', responses: createResponsesForFeature(basicFeatureProps), uploaded: false, revision_requested: false, revision_requested_update: false, edited_by_reviewer: false, review_notes: '', reviewed_by: undefined, reviewed_at: undefined, maintenance_flags: [], created_date: new Date(), updated_date: new Date() }));
25
- const createFeaturesFromSection = (inspection, section, sectionName, sectionNameWithOrdinal) => {
26
- if (!section.features.length) {
27
- return [];
28
- }
29
- /**
30
- * If fast track is enabled, we only create one feature for the section
31
- * with the name of the section as feature name and a predefined description.
32
- */
33
- if (inspection.fast_track) {
34
- const basicFeatureProps = {
35
- name: sectionName,
36
- description: '',
37
- is_rating_required: true,
38
- reference_photos: [],
39
- number_of_photos_required: 1,
40
- questions: [],
41
- };
42
- if (section.type === 'room') {
43
- basicFeatureProps.description =
44
- `Stand back from each corner to ` +
45
- `ensure you get photos of the ${sectionName} in its entirety.`;
46
- }
47
- else if (section.type === 'section') {
48
- basicFeatureProps.description =
49
- `Take any additional ${sectionName}` +
50
- ` photos that you would like to document.`;
51
- }
52
- return [
53
- createEmptyFeature(inspection, basicFeatureProps, section, sectionName, sectionNameWithOrdinal),
54
- ];
55
- }
56
- /**
57
- * If fast track is not enabled, we create features based on the template
58
- * features for the section.
59
- */
60
- return section.features.map((tf) => createEmptyFeature(inspection, tf, section, sectionName, sectionNameWithOrdinal));
61
- };
62
- const parseTemplateRoomName = (name) => {
63
- if (name === 'Floors') {
64
- return 'Floor';
65
- }
66
- if (name === 'Full Bathrooms') {
67
- return 'Full Bathroom';
68
- }
69
- if (name === 'Half Bathrooms') {
70
- return 'Half Bathroom';
71
- }
72
- if (name === 'Bedrooms') {
73
- return 'Bedroom';
74
- }
75
- return name;
76
- };
77
- exports.parseTemplateRoomName = parseTemplateRoomName;
78
- const sectionCanExistMultipleTimes = (sectionName) => [
79
- 'Bedroom',
80
- 'Bedrooms',
81
- 'Full Bathroom',
82
- 'Full Bathrooms',
83
- 'Half Bathroom',
84
- 'Half Bathrooms',
85
- 'Floor',
86
- 'Floors',
87
- ].includes(sectionName);
88
- exports.sectionCanExistMultipleTimes = sectionCanExistMultipleTimes;
89
- const addOrdinalToFloorSection = (number) => {
90
- /**
91
- * America has no concept of a ground floor, so we add 1 to the number
92
- * to get the correct floor name. /shrug
93
- */
94
- const floor = number + 1;
95
- if (floor % 10 === 1) {
96
- return `${floor}st Floor`;
97
- }
98
- if (floor % 10 === 2) {
99
- return `${floor}nd Floor`;
100
- }
101
- if (floor % 10 === 3) {
102
- return `${floor}rd Floor`;
103
- }
104
- return `${floor}th Floor`;
105
- };
106
- /**
107
- * Adds an ordinal to the section to account for repeatable sections.
108
- *
109
- * @param sectionName Floor, Bedroom, Full Bathroom, Half Bathroom
110
- * @param number index of the section, 0 indexed
111
- * @returns the updated section name, e.g. "First Floor", "Second Bedroom"
112
- */
113
- const addOrdinalToSectionName = (sectionName, number) => {
114
- if (sectionName === 'Floor') {
115
- return addOrdinalToFloorSection(number);
116
- }
117
- return `${utils_1.Constants.ordinalPrefixes[number]} ${sectionName}`;
118
- };
119
- const createFeaturesFromRepeatableSection = (sectionName, section, inspection, property) => {
120
- const sectionCount = sectionName === 'Floor'
121
- ? property.floors
122
- : inspection.rooms.filter((r) => r === sectionName).length;
123
- return new Array(sectionCount)
124
- .fill(null)
125
- .map((_, i) => createFeaturesFromSection(inspection, section, sectionName, addOrdinalToSectionName(sectionName, i)))
126
- .flat();
127
- };
128
- const parseSelectedSectionName = (name) => {
129
- if (/(\d)+(st|nd|rd|th) Floor/.test(name)) {
130
- return 'Floors';
131
- }
132
- if (/\w+ Full Bathroom/.test(name)) {
133
- return 'Full Bathrooms';
134
- }
135
- if (/\w+ Half Bathroom/.test(name)) {
136
- return 'Half Bathrooms';
137
- }
138
- if (/\w+ Bedroom/.test(name)) {
139
- return 'Bedrooms';
140
- }
141
- return name;
142
- };
143
- const createFeaturesForSpecificFeaturesTemplate = (inspection, inspectionTemplate) => {
144
- var _a;
145
- const features = [];
146
- const selectedFeatures = Array.from((_a = inspection.selected_features) !== null && _a !== void 0 ? _a : []);
147
- for (const selectedFeature of selectedFeatures) {
148
- const sectionName = parseSelectedSectionName(selectedFeature.section);
149
- const section = inspectionTemplate.sections.find((s) => s.name === sectionName);
150
- if (!section) {
151
- continue;
152
- }
153
- const selectedFeaturesInSection = section.features.filter((f) => selectedFeature.feature === f.name);
154
- const limitedSection = Object.assign(Object.assign({}, section), { features: selectedFeaturesInSection });
155
- /**
156
- * For selected features we create sections in the template regardless of
157
- * property rooms. We assume all that logic already happened in the backend
158
- * at the time of inspection creation
159
- */
160
- features.push(...createFeaturesFromSection(inspection, limitedSection, section.name, selectedFeature.room_name));
161
- }
162
- return features;
163
- };
164
- const createFeaturesForAllRoomsTemplate = (inspection, inspectionTemplate, property) => {
165
- const features = [];
166
- for (const section of inspectionTemplate.sections) {
167
- /**
168
- * We create sections in the template regardless of
169
- * property rooms.
170
- */
171
- if (section.type === 'section') {
172
- features.push(...createFeaturesFromSection(inspection, section, section.name));
173
- }
174
- /**
175
- * For room type sections we first check if the room exists on
176
- * the property/inspection. If it does we create the features for that room.
177
- */
178
- if (section.type === 'room') {
179
- /**
180
- * Some section names use plural nomenclature, while the property rooms
181
- * are all singular, that's why we first need to change
182
- */
183
- const singularName = (0, exports.parseTemplateRoomName)(section.name);
184
- if (!inspection.rooms.includes(singularName)) {
185
- continue;
186
- }
187
- /**
188
- * If this is a section that can be repeated (Bedroom, Bathroom, etc.)
189
- * we need to create features for each room of that type.
190
- */
191
- if ((0, exports.sectionCanExistMultipleTimes)(section.name)) {
192
- features.push(...createFeaturesFromRepeatableSection(singularName, section, inspection, property));
193
- }
194
- else {
195
- features.push(...createFeaturesFromSection(inspection, section, singularName));
196
- }
197
- }
198
- }
199
- return features;
200
- };
201
- const buildTemplateFeatures = (_a) => __awaiter(void 0, [_a], void 0, function* ({ inspection, property, inspectionTemplate, }) {
202
- const features = [];
203
- if (!property) {
204
- return [];
205
- }
206
- if (inspectionTemplate.template_type === 'all-rooms') {
207
- features.push(...createFeaturesForAllRoomsTemplate(inspection, inspectionTemplate, property));
208
- }
209
- if (inspectionTemplate.template_type === 'specific-features') {
210
- features.push(...createFeaturesForSpecificFeaturesTemplate(inspection, inspectionTemplate));
211
- }
212
- return features;
213
- });
214
- exports.buildTemplateFeatures = buildTemplateFeatures;
215
- //# sourceMappingURL=build-template-features.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-template-features.js","sourceRoot":"","sources":["../../../src/api/inspection-template/build-template-features.ts"],"names":[],"mappings":";;;;;;;;;;;;AAYA,uCAAwC;AAYxC,MAAM,yBAAyB,GAAG,CAAC,OAA0B,EAAY,EAAE,CAC1E,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;IAC3B,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACd,CAAC;IAED,OAAO,EAAE,CAAC;AACX,CAAC,CAAC,CAAC;AAEJ,MAAM,kBAAkB,GAAG,CAC1B,UAAsB,EACtB,iBAAoC,EACpC,OAAwB,EACxB,WAAmB,EACnB,sBAA+B,EACd,EAAE,CAAC,iCACjB,iBAAiB,KAEpB,EAAE,EAAE,EAAE,EACN,aAAa,EAAE,UAAU,CAAC,EAAE,EAC5B,WAAW,EAAE,UAAU,CAAC,UAAU,EAElC,OAAO,EAAE;QACR,IAAI,EAAE,WAAW;QACjB,iBAAiB,EAAE,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EACR,kBAAkB,GACW;IAC7B,MAAM,QAAQ,GAAc,EAAE,CAAC;IAE/B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,OAAO,EAAE,CAAC;IACX,CAAC;IAED,IAAI,kBAAkB,CAAC,aAAa,KAAK,WAAW,EAAE,CAAC;QACtD,QAAQ,CAAC,IAAI,CACZ,GAAG,iCAAiC,CACnC,UAAU,EACV,kBAAkB,EAClB,QAAQ,CACR,CACD,CAAC;IACH,CAAC;IAED,IAAI,kBAAkB,CAAC,aAAa,KAAK,mBAAmB,EAAE,CAAC;QAC9D,QAAQ,CAAC,IAAI,CACZ,GAAG,yCAAyC,CAC3C,UAAU,EACV,kBAAkB,CAClB,CACD,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC,CAAA,CAAC;AA/BW,QAAA,qBAAqB,yBA+BhC"}
@@ -1,7 +0,0 @@
1
- export declare const InspectionTemplateBiz: {
2
- buildTemplateFeatures: ({ inspection, property, inspectionTemplate, }: {
3
- inspection: import("@rentcheck/types").Inspection;
4
- property: import("@rentcheck/types").Property;
5
- inspectionTemplate: import("@rentcheck/types").InspectionTemplate;
6
- }) => Promise<import("@rentcheck/types").Feature[]>;
7
- };
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InspectionTemplateBiz = void 0;
4
- const build_template_features_1 = require("./build-template-features");
5
- exports.InspectionTemplateBiz = { buildTemplateFeatures: build_template_features_1.buildTemplateFeatures };
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/inspection-template/index.ts"],"names":[],"mappings":";;;AAAA,uEAAkE;AAErD,QAAA,qBAAqB,GAAG,EAAE,qBAAqB,EAArB,+CAAqB,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- export declare const ordinalPrefixes: string[];
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ordinalPrefixes = void 0;
4
- exports.ordinalPrefixes = [
5
- 'First',
6
- 'Second',
7
- 'Third',
8
- 'Fourth',
9
- 'Fifth',
10
- 'Sixth',
11
- 'Seventh',
12
- 'Eighth',
13
- 'Ninth',
14
- ];
15
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG;IAC9B,OAAO;IACP,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,OAAO;IACP,OAAO;IACP,SAAS;IACT,QAAQ;IACR,OAAO;CACP,CAAC"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Constants = void 0;
27
- exports.Constants = __importStar(require("./constants"));
28
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAAyC"}
@@ -1,3 +0,0 @@
1
- import { buildTemplateFeatures } from './build-template-features';
2
-
3
- export const InspectionTemplateBiz = { buildTemplateFeatures };
File without changes