@bpd-library/utilities 1.2.8-beta.9 → 1.2.8

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.
Files changed (297) hide show
  1. package/dist/api-utilities/compose-exclude-string.d.ts +3 -0
  2. package/dist/api-utilities/compose-exclude-string.js +5 -0
  3. package/dist/api-utilities/compose-exclude-string.js.map +1 -0
  4. package/dist/esm/api/http.js +120 -0
  5. package/dist/esm/api/http.js.map +1 -0
  6. package/dist/esm/api/index.js +11 -0
  7. package/dist/esm/api/index.js.map +1 -0
  8. package/dist/esm/api-utilities/compose-exclude-string.js +6 -0
  9. package/dist/esm/api-utilities/compose-exclude-string.js.map +1 -0
  10. package/dist/esm/api-utilities/decimal-range/merge-decimal-range.js +13 -0
  11. package/dist/esm/api-utilities/decimal-range/merge-decimal-range.js.map +1 -0
  12. package/dist/esm/api-utilities/decimal-range/merge-specification-range.js +29 -0
  13. package/dist/esm/api-utilities/decimal-range/merge-specification-range.js.map +1 -0
  14. package/dist/esm/api-utilities/district-status.js +14 -0
  15. package/dist/esm/api-utilities/district-status.js.map +1 -0
  16. package/dist/esm/api-utilities/find-filter.js +41 -0
  17. package/dist/esm/api-utilities/find-filter.js.map +1 -0
  18. package/dist/esm/api-utilities/get/coordinates.js +31 -0
  19. package/dist/esm/api-utilities/get/coordinates.js.map +1 -0
  20. package/dist/esm/api-utilities/get/layer-raster.js +4 -0
  21. package/dist/esm/api-utilities/get/layer-raster.js.map +1 -0
  22. package/dist/esm/api-utilities/show-mortgage-price.js +11 -0
  23. package/dist/esm/api-utilities/show-mortgage-price.js.map +1 -0
  24. package/dist/esm/api-utilities/show-price.js +13 -0
  25. package/dist/esm/api-utilities/show-price.js.map +1 -0
  26. package/dist/esm/constants/index.js +7 -0
  27. package/dist/esm/constants/index.js.map +1 -0
  28. package/dist/esm/date.js +11 -0
  29. package/dist/esm/date.js.map +1 -0
  30. package/dist/esm/debounce.js +25 -0
  31. package/dist/esm/debounce.js.map +1 -0
  32. package/dist/esm/dom/dom.js +9 -0
  33. package/dist/esm/dom/dom.js.map +1 -0
  34. package/dist/esm/environment.js +27 -0
  35. package/dist/esm/environment.js.map +1 -0
  36. package/dist/esm/extended-api-models/excluded-properties.js +36 -0
  37. package/dist/esm/extended-api-models/excluded-properties.js.map +1 -0
  38. package/dist/esm/extended-api-models/extended-area-projects.js +12 -0
  39. package/dist/esm/extended-api-models/extended-area-projects.js.map +1 -0
  40. package/dist/esm/extended-api-models/extended-area.js +182 -0
  41. package/dist/esm/extended-api-models/extended-area.js.map +1 -0
  42. package/dist/esm/extended-api-models/status/apartment-building-status.js +60 -0
  43. package/dist/esm/extended-api-models/status/apartment-building-status.js.map +1 -0
  44. package/dist/esm/extended-api-models/status/construction-number-status.js +20 -0
  45. package/dist/esm/extended-api-models/status/construction-number-status.js.map +1 -0
  46. package/dist/esm/extended-api-models/status/property-type-status.js +60 -0
  47. package/dist/esm/extended-api-models/status/property-type-status.js.map +1 -0
  48. package/dist/esm/extended-api-models/utilities/apartment-building-view.js +5 -0
  49. package/dist/esm/extended-api-models/utilities/apartment-building-view.js.map +1 -0
  50. package/dist/esm/extended-api-models/utilities/extended-model-price-range.js +37 -0
  51. package/dist/esm/extended-api-models/utilities/extended-model-price-range.js.map +1 -0
  52. package/dist/esm/extended-api-models/utilities/find-extended-object.js +23 -0
  53. package/dist/esm/extended-api-models/utilities/find-extended-object.js.map +1 -0
  54. package/dist/esm/extended-api-models/utilities/is-apartment.js +14 -0
  55. package/dist/esm/extended-api-models/utilities/is-apartment.js.map +1 -0
  56. package/dist/esm/function-is-true.js +13 -0
  57. package/dist/esm/function-is-true.js.map +1 -0
  58. package/dist/esm/generated/bpd-client.js +53 -0
  59. package/dist/esm/generated/bpd-client.js.map +1 -0
  60. package/dist/esm/geometry/country-bounding-box.js +14 -0
  61. package/dist/esm/geometry/country-bounding-box.js.map +1 -0
  62. package/dist/esm/geometry/geometry.js +65 -0
  63. package/dist/esm/geometry/geometry.js.map +1 -0
  64. package/dist/esm/hooks/use-click-outside.js +34 -0
  65. package/dist/esm/hooks/use-click-outside.js.map +1 -0
  66. package/dist/esm/hooks/use-form-changes.js +30 -0
  67. package/dist/esm/hooks/use-form-changes.js.map +1 -0
  68. package/dist/esm/hooks/use-history.js +15 -0
  69. package/dist/esm/hooks/use-history.js.map +1 -0
  70. package/dist/esm/hooks/use-keyboard-focus.js +14 -0
  71. package/dist/esm/hooks/use-keyboard-focus.js.map +1 -0
  72. package/dist/esm/hooks/use-lazy.js +47 -0
  73. package/dist/esm/hooks/use-lazy.js.map +1 -0
  74. package/dist/esm/hooks/use-map-storage.js +16 -0
  75. package/dist/esm/hooks/use-map-storage.js.map +1 -0
  76. package/dist/esm/hooks/use-scroll-position.js +23 -0
  77. package/dist/esm/hooks/use-scroll-position.js.map +1 -0
  78. package/dist/esm/hooks/use-scroll-to.js +66 -0
  79. package/dist/esm/hooks/use-scroll-to.js.map +1 -0
  80. package/dist/esm/hooks/use-stylesheet.js +8 -0
  81. package/dist/esm/hooks/use-stylesheet.js.map +1 -0
  82. package/dist/esm/hooks/use-url-params.js +31 -0
  83. package/dist/esm/hooks/use-url-params.js.map +1 -0
  84. package/dist/esm/index.js +40 -0
  85. package/dist/esm/index.js.map +1 -0
  86. package/dist/esm/is-touch.js +32 -0
  87. package/dist/esm/is-touch.js.map +1 -0
  88. package/dist/esm/media-query/breakpoints.js +29 -0
  89. package/dist/esm/media-query/breakpoints.js.map +1 -0
  90. package/dist/esm/media-query/media-query.js +39 -0
  91. package/dist/esm/media-query/media-query.js.map +1 -0
  92. package/dist/esm/media-query/utils/index.js +35 -0
  93. package/dist/esm/media-query/utils/index.js.map +1 -0
  94. package/dist/esm/raf-throttle.js +24 -0
  95. package/dist/esm/raf-throttle.js.map +1 -0
  96. package/dist/esm/throttle.js +23 -0
  97. package/dist/esm/throttle.js.map +1 -0
  98. package/dist/esm/to-currency.js +26 -0
  99. package/dist/esm/to-currency.js.map +1 -0
  100. package/dist/extended-api-models/excluded-properties.d.ts +5 -0
  101. package/dist/extended-api-models/excluded-properties.js +35 -0
  102. package/dist/extended-api-models/excluded-properties.js.map +1 -0
  103. package/dist/geometry/country-bounding-box.d.ts +1 -1
  104. package/dist/geometry/country-bounding-box.js.map +1 -1
  105. package/dist/hooks/use-stylesheet.d.ts +1 -0
  106. package/dist/hooks/use-stylesheet.js +5 -0
  107. package/dist/hooks/use-stylesheet.js.map +1 -0
  108. package/dist/lib/api/http.js +117 -0
  109. package/dist/lib/api/http.js.map +1 -0
  110. package/dist/lib/api/index.js +8 -0
  111. package/dist/lib/api/index.js.map +1 -0
  112. package/dist/lib/api-utilities/api-utilities.js +9 -0
  113. package/dist/lib/api-utilities/api-utilities.js.map +1 -0
  114. package/dist/lib/api-utilities/api-utilities.test.js +122 -0
  115. package/dist/lib/api-utilities/api-utilities.test.js.map +1 -0
  116. package/dist/lib/api-utilities/api-utilities.types.js +1 -0
  117. package/dist/lib/api-utilities/api-utilities.types.js.map +1 -0
  118. package/dist/lib/api-utilities/compose-exclude-string.js +5 -0
  119. package/dist/lib/api-utilities/compose-exclude-string.js.map +1 -0
  120. package/dist/lib/api-utilities/decimal-range/merge-decimal-range.js +12 -0
  121. package/dist/lib/api-utilities/decimal-range/merge-decimal-range.js.map +1 -0
  122. package/dist/lib/api-utilities/decimal-range/merge-specification-range.js +27 -0
  123. package/dist/lib/api-utilities/decimal-range/merge-specification-range.js.map +1 -0
  124. package/dist/lib/api-utilities/district-status.js +13 -0
  125. package/dist/lib/api-utilities/district-status.js.map +1 -0
  126. package/dist/lib/api-utilities/find-filter.js +40 -0
  127. package/dist/lib/api-utilities/find-filter.js.map +1 -0
  128. package/dist/lib/api-utilities/get/coordinates.js +29 -0
  129. package/dist/lib/api-utilities/get/coordinates.js.map +1 -0
  130. package/dist/lib/api-utilities/get/layer-raster.js +3 -0
  131. package/dist/lib/api-utilities/get/layer-raster.js.map +1 -0
  132. package/dist/lib/api-utilities/index.js +2 -0
  133. package/dist/lib/api-utilities/index.js.map +1 -0
  134. package/dist/lib/api-utilities/show-mortgage-price.js +10 -0
  135. package/dist/lib/api-utilities/show-mortgage-price.js.map +1 -0
  136. package/dist/lib/api-utilities/show-price.js +12 -0
  137. package/dist/lib/api-utilities/show-price.js.map +1 -0
  138. package/dist/lib/constants/index.js +5 -0
  139. package/dist/lib/constants/index.js.map +1 -0
  140. package/dist/lib/date.js +10 -0
  141. package/dist/lib/date.js.map +1 -0
  142. package/dist/lib/debounce.js +23 -0
  143. package/dist/lib/debounce.js.map +1 -0
  144. package/dist/lib/dom/dom.js +7 -0
  145. package/dist/lib/dom/dom.js.map +1 -0
  146. package/dist/lib/dom/index.js +2 -0
  147. package/dist/lib/dom/index.js.map +1 -0
  148. package/dist/lib/environment.js +25 -0
  149. package/dist/lib/environment.js.map +1 -0
  150. package/dist/lib/extended-api-models/excluded-properties.js +35 -0
  151. package/dist/lib/extended-api-models/excluded-properties.js.map +1 -0
  152. package/dist/lib/extended-api-models/extended-area-projects.js +10 -0
  153. package/dist/lib/extended-api-models/extended-area-projects.js.map +1 -0
  154. package/dist/lib/extended-api-models/extended-area.js +179 -0
  155. package/dist/lib/extended-api-models/extended-area.js.map +1 -0
  156. package/dist/lib/extended-api-models/index.js +7 -0
  157. package/dist/lib/extended-api-models/index.js.map +1 -0
  158. package/dist/lib/extended-api-models/status/apartment-building-status.js +58 -0
  159. package/dist/lib/extended-api-models/status/apartment-building-status.js.map +1 -0
  160. package/dist/lib/extended-api-models/status/construction-number-status.js +19 -0
  161. package/dist/lib/extended-api-models/status/construction-number-status.js.map +1 -0
  162. package/dist/lib/extended-api-models/status/property-type-status.js +58 -0
  163. package/dist/lib/extended-api-models/status/property-type-status.js.map +1 -0
  164. package/dist/lib/extended-api-models/utilities/apartment-building-view.js +4 -0
  165. package/dist/lib/extended-api-models/utilities/apartment-building-view.js.map +1 -0
  166. package/dist/lib/extended-api-models/utilities/extended-model-price-range.js +35 -0
  167. package/dist/lib/extended-api-models/utilities/extended-model-price-range.js.map +1 -0
  168. package/dist/lib/extended-api-models/utilities/find-extended-object.js +21 -0
  169. package/dist/lib/extended-api-models/utilities/find-extended-object.js.map +1 -0
  170. package/dist/lib/extended-api-models/utilities/is-apartment.js +13 -0
  171. package/dist/lib/extended-api-models/utilities/is-apartment.js.map +1 -0
  172. package/dist/lib/function-is-true.js +11 -0
  173. package/dist/lib/function-is-true.js.map +1 -0
  174. package/dist/lib/generated/bpd-client.js +50 -0
  175. package/dist/lib/generated/bpd-client.js.map +1 -0
  176. package/dist/lib/generated/index.js +2 -0
  177. package/dist/lib/generated/index.js.map +1 -0
  178. package/dist/lib/geometry/country-bounding-box.js +12 -0
  179. package/dist/lib/geometry/country-bounding-box.js.map +1 -0
  180. package/dist/lib/geometry/geometry.js +64 -0
  181. package/dist/lib/geometry/geometry.js.map +1 -0
  182. package/dist/lib/geometry/geometry.test.js +87 -0
  183. package/dist/lib/geometry/geometry.test.js.map +1 -0
  184. package/dist/lib/geometry/index.js +3 -0
  185. package/dist/lib/geometry/index.js.map +1 -0
  186. package/dist/lib/hooks/index.js +11 -0
  187. package/dist/lib/hooks/index.js.map +1 -0
  188. package/dist/lib/hooks/use-click-outside.js +32 -0
  189. package/dist/lib/hooks/use-click-outside.js.map +1 -0
  190. package/dist/lib/hooks/use-delegate-listen.js +10 -0
  191. package/dist/lib/hooks/use-delegate-listen.js.map +1 -0
  192. package/dist/lib/hooks/use-form-changes.js +27 -0
  193. package/dist/lib/hooks/use-form-changes.js.map +1 -0
  194. package/dist/lib/hooks/use-history.js +13 -0
  195. package/dist/lib/hooks/use-history.js.map +1 -0
  196. package/dist/lib/hooks/use-input.js +28 -0
  197. package/dist/lib/hooks/use-input.js.map +1 -0
  198. package/dist/lib/hooks/use-keyboard-focus.js +11 -0
  199. package/dist/lib/hooks/use-keyboard-focus.js.map +1 -0
  200. package/dist/lib/hooks/use-lazy.js +44 -0
  201. package/dist/lib/hooks/use-lazy.js.map +1 -0
  202. package/dist/lib/hooks/use-map-storage.js +14 -0
  203. package/dist/lib/hooks/use-map-storage.js.map +1 -0
  204. package/dist/lib/hooks/use-scroll-position.js +20 -0
  205. package/dist/lib/hooks/use-scroll-position.js.map +1 -0
  206. package/dist/lib/hooks/use-scroll-to.js +64 -0
  207. package/dist/lib/hooks/use-scroll-to.js.map +1 -0
  208. package/dist/lib/hooks/use-stylesheet.js +5 -0
  209. package/dist/lib/hooks/use-stylesheet.js.map +1 -0
  210. package/dist/lib/hooks/use-text.js +16 -0
  211. package/dist/lib/hooks/use-text.js.map +1 -0
  212. package/dist/lib/hooks/use-url-params.js +28 -0
  213. package/dist/lib/hooks/use-url-params.js.map +1 -0
  214. package/dist/lib/index.js +18 -0
  215. package/dist/lib/index.js.map +1 -0
  216. package/dist/lib/is-touch.js +30 -0
  217. package/dist/lib/is-touch.js.map +1 -0
  218. package/dist/lib/media-query/breakpoints.js +27 -0
  219. package/dist/lib/media-query/breakpoints.js.map +1 -0
  220. package/dist/lib/media-query/index.js +2 -0
  221. package/dist/lib/media-query/index.js.map +1 -0
  222. package/dist/lib/media-query/media-query.js +36 -0
  223. package/dist/lib/media-query/media-query.js.map +1 -0
  224. package/dist/lib/media-query/media-query.types.js +1 -0
  225. package/dist/lib/media-query/media-query.types.js.map +1 -0
  226. package/dist/lib/media-query/utils/index.js +32 -0
  227. package/dist/lib/media-query/utils/index.js.map +1 -0
  228. package/dist/lib/raf-throttle.js +22 -0
  229. package/dist/lib/raf-throttle.js.map +1 -0
  230. package/dist/lib/throttle.js +22 -0
  231. package/dist/lib/throttle.js.map +1 -0
  232. package/dist/lib/to-currency.js +24 -0
  233. package/dist/lib/to-currency.js.map +1 -0
  234. package/dist/types/api/http.d.ts +47 -0
  235. package/dist/types/api/index.d.ts +2 -0
  236. package/dist/types/api-utilities/api-utilities.d.ts +8 -0
  237. package/dist/types/api-utilities/api-utilities.test.d.ts +1 -0
  238. package/dist/types/api-utilities/api-utilities.types.d.ts +46 -0
  239. package/dist/types/api-utilities/compose-exclude-string.d.ts +3 -0
  240. package/dist/types/api-utilities/decimal-range/merge-decimal-range.d.ts +3 -0
  241. package/dist/types/api-utilities/decimal-range/merge-specification-range.d.ts +13 -0
  242. package/dist/types/api-utilities/district-status.d.ts +3 -0
  243. package/dist/types/api-utilities/find-filter.d.ts +32 -0
  244. package/dist/types/api-utilities/get/coordinates.d.ts +6 -0
  245. package/dist/types/api-utilities/get/layer-raster.d.ts +3 -0
  246. package/dist/types/api-utilities/index.d.ts +1 -0
  247. package/dist/types/api-utilities/show-mortgage-price.d.ts +3 -0
  248. package/dist/types/api-utilities/show-price.d.ts +7 -0
  249. package/dist/types/constants/index.d.ts +4 -0
  250. package/dist/types/date.d.ts +3 -0
  251. package/dist/types/debounce.d.ts +5 -0
  252. package/dist/types/dom/dom.d.ts +6 -0
  253. package/dist/types/dom/index.d.ts +1 -0
  254. package/dist/types/environment.d.ts +9 -0
  255. package/dist/types/extended-api-models/excluded-properties.d.ts +5 -0
  256. package/dist/types/extended-api-models/extended-area-projects.d.ts +3 -0
  257. package/dist/types/extended-api-models/extended-area.d.ts +13 -0
  258. package/dist/types/extended-api-models/index.d.ts +6 -0
  259. package/dist/types/extended-api-models/status/apartment-building-status.d.ts +3 -0
  260. package/dist/types/extended-api-models/status/construction-number-status.d.ts +3 -0
  261. package/dist/types/extended-api-models/status/property-type-status.d.ts +4 -0
  262. package/dist/types/extended-api-models/utilities/apartment-building-view.d.ts +4 -0
  263. package/dist/types/extended-api-models/utilities/extended-model-price-range.d.ts +4 -0
  264. package/dist/types/extended-api-models/utilities/find-extended-object.d.ts +4 -0
  265. package/dist/types/extended-api-models/utilities/is-apartment.d.ts +11 -0
  266. package/dist/types/function-is-true.d.ts +1 -0
  267. package/dist/types/generated/bpd-client.d.ts +808 -0
  268. package/dist/types/generated/index.d.ts +1 -0
  269. package/dist/types/geometry/country-bounding-box.d.ts +6 -0
  270. package/dist/types/geometry/geometry.d.ts +11 -0
  271. package/dist/types/geometry/geometry.test.d.ts +8 -0
  272. package/dist/types/geometry/index.d.ts +2 -0
  273. package/dist/types/hooks/index.d.ts +10 -0
  274. package/dist/types/hooks/use-click-outside.d.ts +6 -0
  275. package/dist/types/hooks/use-delegate-listen.d.ts +6 -0
  276. package/dist/types/hooks/use-form-changes.d.ts +12 -0
  277. package/dist/types/hooks/use-history.d.ts +4 -0
  278. package/dist/types/hooks/use-input.d.ts +41 -0
  279. package/dist/types/hooks/use-keyboard-focus.d.ts +6 -0
  280. package/dist/types/hooks/use-lazy.d.ts +21 -0
  281. package/dist/types/hooks/use-map-storage.d.ts +6 -0
  282. package/dist/types/hooks/use-scroll-position.d.ts +10 -0
  283. package/dist/types/hooks/use-scroll-to.d.ts +8 -0
  284. package/dist/types/hooks/use-stylesheet.d.ts +1 -0
  285. package/dist/types/hooks/use-text.d.ts +1 -0
  286. package/dist/types/hooks/use-url-params.d.ts +5 -0
  287. package/dist/types/index.d.ts +17 -0
  288. package/dist/types/is-touch.d.ts +8 -0
  289. package/dist/types/media-query/breakpoints.d.ts +26 -0
  290. package/dist/types/media-query/index.d.ts +1 -0
  291. package/dist/types/media-query/media-query.d.ts +13 -0
  292. package/dist/types/media-query/media-query.types.d.ts +14 -0
  293. package/dist/types/media-query/utils/index.d.ts +3 -0
  294. package/dist/types/raf-throttle.d.ts +4 -0
  295. package/dist/types/throttle.d.ts +2 -0
  296. package/dist/types/to-currency.d.ts +3 -0
  297. package/package.json +3 -3
@@ -0,0 +1,182 @@
1
+ import { getDistrictStatus } from '../api-utilities/district-status.js';
2
+ import { findPropertyType, findProjectPhase, filterConstructionNumbers, filterPropertyTypes } from '../api-utilities/find-filter.js';
3
+ import { composeExcludeString } from '../api-utilities/compose-exclude-string.js';
4
+ import { propertyTypeQuery, constructionNumberQuery, projectPhaseQuery, apartmentBuildingQuery, districtQuery, areaProjectGetById } from '../generated/bpd-client.js';
5
+ import { EXCLUDED_CONSTRUCTION_NUMBER_PROPERTIES, EXCLUDED_PROJECT_PHASE_PROPERTIES, EXCLUDED_PROPERTY_TYPE_PROPERTIES } from './excluded-properties.js';
6
+ import { getApartmentBuildingStatus } from './status/apartment-building-status.js';
7
+ import { constructionNumberStatus } from './status/construction-number-status.js';
8
+ import { getPropertyTypeStatus } from './status/property-type-status.js';
9
+
10
+ const ExtendedAreaModelsUtility = () => {
11
+ const areaState = {};
12
+ async function controller(areaId) {
13
+ let originalData;
14
+ if (hasSessionStorageData(areaId)) {
15
+ originalData = fetchSessionStorageData(areaId);
16
+ }
17
+ else {
18
+ originalData = await fetchData(areaId);
19
+ setSessionStorageData(areaId, originalData);
20
+ }
21
+ originalData = filterObjectsWithImages(originalData);
22
+ areaState[areaId].extendedData = extendModels(originalData);
23
+ setLoaded(areaId);
24
+ }
25
+ async function getData(areaId) {
26
+ if (!areaState[areaId]) {
27
+ areaState[areaId] = {
28
+ resolveArray: [],
29
+ };
30
+ controller(areaId);
31
+ }
32
+ const state = areaState[areaId];
33
+ if (!state.extendedData) {
34
+ return new Promise((res) => {
35
+ state.resolveArray.push(res);
36
+ });
37
+ }
38
+ else {
39
+ return state.extendedData;
40
+ }
41
+ }
42
+ function setLoaded(areaId) {
43
+ areaState[areaId].resolveArray.forEach((res) => {
44
+ res(areaState[areaId].extendedData);
45
+ });
46
+ }
47
+ function filterObjectsWithImages(data) {
48
+ return Object.assign(Object.assign({}, data), { constructionNumbers: data.constructionNumbers.filter(({ mainImage }) => !!(mainImage === null || mainImage === void 0 ? void 0 : mainImage.url)), propertyTypes: data.propertyTypes.filter(({ mainImage }) => !!(mainImage === null || mainImage === void 0 ? void 0 : mainImage.url)), apartmentBuildings: data.apartmentBuildings.filter(({ image }) => !!(image === null || image === void 0 ? void 0 : image.url)) });
49
+ }
50
+ function sessionStorageId(areaId) {
51
+ return `AreaObjects::${areaId}`;
52
+ }
53
+ function sessionStorageData(areaId) {
54
+ return sessionStorage.getItem(sessionStorageId(areaId));
55
+ }
56
+ function hasSessionStorageData(areaId) {
57
+ return !!sessionStorageData(areaId);
58
+ }
59
+ function fetchSessionStorageData(areaId) {
60
+ if (hasSessionStorageData(areaId)) {
61
+ return JSON.parse(sessionStorageData(areaId));
62
+ }
63
+ else {
64
+ return;
65
+ }
66
+ }
67
+ function setSessionStorageData(areaId, originalData) {
68
+ sessionStorage.setItem(sessionStorageId(areaId), JSON.stringify(originalData));
69
+ }
70
+ async function fetchData(areaId) {
71
+ const propertyTypes = propertyTypeQuery({
72
+ AreaProjectId: areaId,
73
+ exclude: composeExcludeString(EXCLUDED_PROPERTY_TYPE_PROPERTIES),
74
+ });
75
+ const constructionNumbers = constructionNumberQuery({
76
+ AreaProjectId: areaId,
77
+ exclude: composeExcludeString(EXCLUDED_CONSTRUCTION_NUMBER_PROPERTIES),
78
+ });
79
+ const projectPhases = projectPhaseQuery({
80
+ AreaProjectId: areaId,
81
+ exclude: composeExcludeString(EXCLUDED_PROJECT_PHASE_PROPERTIES),
82
+ });
83
+ const apartmentBuildings = apartmentBuildingQuery({
84
+ AreaProjectId: areaId,
85
+ });
86
+ const districts = districtQuery({
87
+ AreaProjectId: areaId,
88
+ });
89
+ const areaProject = areaProjectGetById(areaId);
90
+ return {
91
+ propertyTypes: await propertyTypes,
92
+ constructionNumbers: await constructionNumbers,
93
+ projectPhases: await projectPhases,
94
+ apartmentBuildings: await apartmentBuildings,
95
+ districts: await districts,
96
+ areaProject: await areaProject,
97
+ };
98
+ }
99
+ function extendModels(data) {
100
+ const { constructionNumbers, propertyTypes, apartmentBuildings, projectPhases, districts, areaProject, } = data;
101
+ constructionNumbers.forEach((constructionNumber) => {
102
+ const { propertyTypeId, projectPhaseId } = constructionNumber;
103
+ constructionNumber.areaProject = areaProject;
104
+ if (propertyTypeId) {
105
+ constructionNumber.propertyType = findPropertyType(propertyTypes, {
106
+ id: propertyTypeId,
107
+ });
108
+ }
109
+ if (projectPhaseId) {
110
+ constructionNumber.projectPhase = findProjectPhase(projectPhases, {
111
+ id: projectPhaseId,
112
+ });
113
+ }
114
+ constructionNumber.apartmentBuilding = apartmentBuildings.find((s) => { var _a; return (_a = s.constructionNumberIds) === null || _a === void 0 ? void 0 : _a.includes(constructionNumber.id); });
115
+ constructionNumber.status = constructionNumberStatus(constructionNumber);
116
+ constructionNumber.objectType = 'constructionNumber';
117
+ });
118
+ propertyTypes.forEach((propertyType) => {
119
+ const { projectPhaseId, id } = propertyType;
120
+ if (projectPhaseId) {
121
+ propertyType.projectPhase = findProjectPhase(projectPhases, {
122
+ id: projectPhaseId,
123
+ });
124
+ }
125
+ propertyType.constructionNumbers = filterConstructionNumbers(constructionNumbers, {
126
+ propertyTypeId: id,
127
+ });
128
+ if (propertyType.projectPhase) {
129
+ propertyType.status = getPropertyTypeStatus(propertyType.projectPhase, propertyType.constructionNumbers);
130
+ }
131
+ propertyType.apartmentBuildings = apartmentBuildings.filter((s) => { var _a; return (_a = s.propertyTypeIds) === null || _a === void 0 ? void 0 : _a.includes(propertyType.id); });
132
+ propertyType.objectType = 'propertyType';
133
+ });
134
+ projectPhases.forEach((projectPhase) => {
135
+ const { id } = projectPhase;
136
+ projectPhase.propertyTypes = filterPropertyTypes(propertyTypes, {
137
+ projectPhaseId: id,
138
+ });
139
+ projectPhase.constructionNumbers = filterConstructionNumbers(constructionNumbers, {
140
+ projectPhaseId: id,
141
+ });
142
+ projectPhase.objectType = 'projectPhase';
143
+ });
144
+ apartmentBuildings.forEach((apartmentBuilding) => {
145
+ const { propertyTypeIds, constructionNumberIds, projectPhaseId } = apartmentBuilding;
146
+ if (propertyTypeIds) {
147
+ apartmentBuilding.propertyTypes = propertyTypes.filter(({ id }) => propertyTypeIds === null || propertyTypeIds === void 0 ? void 0 : propertyTypeIds.includes(id));
148
+ }
149
+ if (constructionNumberIds) {
150
+ apartmentBuilding.constructionNumbers = constructionNumbers.filter(({ id }) => constructionNumberIds === null || constructionNumberIds === void 0 ? void 0 : constructionNumberIds.includes(id));
151
+ }
152
+ if (projectPhaseId) {
153
+ apartmentBuilding.projectPhase = findProjectPhase(projectPhases, {
154
+ id: projectPhaseId,
155
+ });
156
+ }
157
+ if (apartmentBuilding.projectPhase) {
158
+ apartmentBuilding.status = getApartmentBuildingStatus(apartmentBuilding.projectPhase, apartmentBuilding.constructionNumbers);
159
+ }
160
+ apartmentBuilding.objectType = 'apartmentBuilding';
161
+ });
162
+ districts.forEach((district) => {
163
+ district.status = getDistrictStatus(district, projectPhases);
164
+ district.objectType = 'district';
165
+ });
166
+ return {
167
+ constructionNumbers,
168
+ propertyTypes,
169
+ apartmentBuildings,
170
+ projectPhases,
171
+ districts,
172
+ areaProject,
173
+ };
174
+ }
175
+ return {
176
+ getData,
177
+ };
178
+ };
179
+ const extendedArea = ExtendedAreaModelsUtility();
180
+
181
+ export { extendedArea };
182
+ //# sourceMappingURL=extended-area.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extended-area.js","sources":["../../../src/extended-api-models/extended-area.ts"],"sourcesContent":["import {\n ExtendedApartmentBuilding,\n ExtendedAreaProject,\n ExtendedConstructionNumber,\n ExtendedDistrict,\n ExtendedProjectPhase,\n ExtendedPropertyType,\n filterConstructionNumbers,\n filterPropertyTypes,\n findProjectPhase,\n findPropertyType,\n getDistrictStatus,\n} from '../api-utilities';\nimport { composeExcludeString } from '../api-utilities/compose-exclude-string';\nimport {\n ApartmentBuildingModel,\n apartmentBuildingQuery,\n areaProjectGetById,\n AreaProjectModel,\n ConstructionNumberModel,\n constructionNumberQuery,\n DistrictModel,\n districtQuery,\n ProjectPhaseModel,\n projectPhaseQuery,\n PropertyTypeModel,\n propertyTypeQuery,\n} from '../generated';\nimport {\n EXCLUDED_CONSTRUCTION_NUMBER_PROPERTIES,\n EXCLUDED_PROJECT_PHASE_PROPERTIES,\n EXCLUDED_PROPERTY_TYPE_PROPERTIES,\n} from './excluded-properties';\nimport { getApartmentBuildingStatus } from './status/apartment-building-status';\nimport { constructionNumberStatus } from './status/construction-number-status';\nimport { getPropertyTypeStatus } from './status/property-type-status';\n\ninterface OriginalAreaModels {\n constructionNumbers: ConstructionNumberModel[];\n propertyTypes: PropertyTypeModel[];\n apartmentBuildings: ApartmentBuildingModel[];\n projectPhases: ProjectPhaseModel[];\n districts: DistrictModel[];\n areaProject: AreaProjectModel;\n}\n\ninterface ExtendedAreaModels {\n constructionNumbers: ExtendedConstructionNumber[];\n propertyTypes: ExtendedPropertyType[];\n apartmentBuildings: ExtendedApartmentBuilding[];\n projectPhases: ExtendedProjectPhase[];\n districts: ExtendedDistrict[];\n areaProject: ExtendedAreaProject;\n}\ninterface FilterFunctions {\n constructionNumber?: (constructionNumber: ConstructionNumberModel) => boolean;\n propertyType?: (propertyType: PropertyTypeModel) => boolean;\n apartmentBuilding?: (apartmentBuilding: ApartmentBuildingModel) => boolean;\n projectPhase?: (projectPhase: ProjectPhaseModel) => boolean;\n district?: (district: DistrictModel) => boolean;\n}\n\nconst ExtendedAreaModelsUtility = () => {\n const areaState: {\n [areaId: string]: {\n extendedData?: ExtendedAreaModels;\n resolveArray: Function[];\n filterFunctions?: FilterFunctions;\n };\n } = {};\n\n async function controller(areaId: string) {\n let originalData: OriginalAreaModels;\n\n if (hasSessionStorageData(areaId)) {\n originalData = fetchSessionStorageData(areaId)!;\n } else {\n originalData = await fetchData(areaId);\n setSessionStorageData(areaId, originalData);\n }\n\n // Objects without images, should not be shown on the website\n originalData = filterObjectsWithImages(originalData);\n\n areaState[areaId].extendedData = extendModels(originalData);\n\n setLoaded(areaId);\n }\n\n async function getData(areaId: string): Promise<ExtendedAreaModels> {\n if (!areaState[areaId]) {\n areaState[areaId] = {\n resolveArray: [],\n };\n\n // Controller handles fetching + extending of data\n controller(areaId);\n }\n\n const state = areaState[areaId];\n\n if (!state.extendedData) {\n /*\n if no extendedData is found, it means it's being fetched.\n Promises will be resolved after data is loaded\n */\n return new Promise((res) => {\n state.resolveArray.push(res);\n });\n } else {\n // if no extendedData is found, it comes from sessionStorage\n return state.extendedData;\n }\n }\n\n function setLoaded(areaId: string) {\n areaState[areaId].resolveArray.forEach((res) => {\n res(areaState[areaId].extendedData);\n });\n }\n\n function filterObjectsWithImages(data: OriginalAreaModels): OriginalAreaModels {\n return {\n ...data,\n constructionNumbers: data.constructionNumbers.filter(\n ({ mainImage }) => !!mainImage?.url,\n ),\n propertyTypes: data.propertyTypes.filter(({ mainImage }) => !!mainImage?.url),\n apartmentBuildings: data.apartmentBuildings.filter(({ image }) => !!image?.url),\n };\n }\n\n function sessionStorageId(areaId: string) {\n return `AreaObjects::${areaId}`;\n }\n\n function sessionStorageData(areaId: string) {\n return sessionStorage.getItem(sessionStorageId(areaId));\n }\n\n function hasSessionStorageData(areaId: string) {\n return !!sessionStorageData(areaId);\n }\n\n function fetchSessionStorageData(areaId: string) {\n if (hasSessionStorageData(areaId)) {\n return JSON.parse(sessionStorageData(areaId)!) as OriginalAreaModels;\n } else {\n return;\n }\n }\n\n function setSessionStorageData(areaId: string, originalData: OriginalAreaModels) {\n sessionStorage.setItem(sessionStorageId(areaId), JSON.stringify(originalData));\n }\n\n async function fetchData(areaId: string) {\n const propertyTypes = propertyTypeQuery({\n AreaProjectId: areaId,\n exclude: composeExcludeString(EXCLUDED_PROPERTY_TYPE_PROPERTIES),\n });\n const constructionNumbers = constructionNumberQuery({\n AreaProjectId: areaId,\n exclude: composeExcludeString(EXCLUDED_CONSTRUCTION_NUMBER_PROPERTIES),\n });\n const projectPhases = projectPhaseQuery({\n AreaProjectId: areaId,\n exclude: composeExcludeString(EXCLUDED_PROJECT_PHASE_PROPERTIES),\n });\n const apartmentBuildings = apartmentBuildingQuery({\n AreaProjectId: areaId,\n });\n const districts = districtQuery({\n AreaProjectId: areaId,\n });\n const areaProject = areaProjectGetById(areaId);\n\n return {\n propertyTypes: await propertyTypes,\n constructionNumbers: await constructionNumbers,\n projectPhases: await projectPhases,\n apartmentBuildings: await apartmentBuildings,\n districts: await districts,\n areaProject: await areaProject,\n };\n }\n\n function extendModels(data: OriginalAreaModels): ExtendedAreaModels {\n const {\n constructionNumbers,\n propertyTypes,\n apartmentBuildings,\n projectPhases,\n districts,\n areaProject,\n } = data as ExtendedAreaModels;\n\n /*\n Extend constructionNumbers object\n */\n constructionNumbers.forEach((constructionNumber) => {\n const { propertyTypeId, projectPhaseId } = constructionNumber;\n\n constructionNumber.areaProject = areaProject;\n\n if (propertyTypeId) {\n constructionNumber.propertyType = findPropertyType(propertyTypes, {\n id: propertyTypeId,\n });\n }\n\n if (projectPhaseId) {\n constructionNumber.projectPhase = findProjectPhase(projectPhases, {\n id: projectPhaseId,\n });\n }\n\n constructionNumber.apartmentBuilding = apartmentBuildings.find((s) =>\n s.constructionNumberIds?.includes(constructionNumber.id),\n );\n\n constructionNumber.status = constructionNumberStatus(constructionNumber);\n\n constructionNumber.objectType = 'constructionNumber';\n });\n\n /*\n Extend propertTypes object\n */\n propertyTypes.forEach((propertyType) => {\n const { projectPhaseId, id } = propertyType;\n\n if (projectPhaseId) {\n propertyType.projectPhase = findProjectPhase(projectPhases, {\n id: projectPhaseId,\n });\n }\n\n propertyType.constructionNumbers = filterConstructionNumbers(constructionNumbers, {\n propertyTypeId: id,\n });\n\n if (propertyType.projectPhase) {\n propertyType.status = getPropertyTypeStatus(\n propertyType.projectPhase,\n propertyType.constructionNumbers,\n );\n }\n\n propertyType.apartmentBuildings = apartmentBuildings.filter((s) =>\n s.propertyTypeIds?.includes(propertyType.id),\n );\n\n propertyType.objectType = 'propertyType';\n });\n\n /*\n Extend projectPhase object\n */\n projectPhases.forEach((projectPhase) => {\n const { id } = projectPhase;\n\n projectPhase.propertyTypes = filterPropertyTypes(propertyTypes, {\n projectPhaseId: id,\n });\n projectPhase.constructionNumbers = filterConstructionNumbers(constructionNumbers, {\n projectPhaseId: id,\n });\n\n projectPhase.objectType = 'projectPhase';\n });\n\n /*\n Extend apartmentBuilding object\n */\n apartmentBuildings.forEach((apartmentBuilding) => {\n const { propertyTypeIds, constructionNumberIds, projectPhaseId } = apartmentBuilding;\n\n if (propertyTypeIds) {\n apartmentBuilding.propertyTypes = propertyTypes.filter(({ id }) =>\n propertyTypeIds?.includes(id),\n );\n }\n\n if (constructionNumberIds) {\n apartmentBuilding.constructionNumbers = constructionNumbers.filter(({ id }) =>\n constructionNumberIds?.includes(id),\n );\n }\n\n if (projectPhaseId) {\n apartmentBuilding.projectPhase = findProjectPhase(projectPhases, {\n id: projectPhaseId,\n });\n }\n\n if (apartmentBuilding.projectPhase) {\n apartmentBuilding.status = getApartmentBuildingStatus(\n apartmentBuilding.projectPhase,\n apartmentBuilding.constructionNumbers,\n );\n }\n\n apartmentBuilding.objectType = 'apartmentBuilding';\n });\n\n /*\n Extend district object\n */\n districts.forEach((district) => {\n district.status = getDistrictStatus(district, projectPhases);\n district.objectType = 'district';\n });\n\n return {\n constructionNumbers,\n propertyTypes,\n apartmentBuildings,\n projectPhases,\n districts,\n areaProject,\n };\n }\n\n return {\n getData,\n };\n};\n\nconst extendedArea = ExtendedAreaModelsUtility();\n\nexport { extendedArea, ExtendedAreaModels };\n"],"names":[],"mappings":";;;;;;;;;AA8DA,MAAM,yBAAyB,GAAG;IAC9B,MAAM,SAAS,GAMX,EAAE,CAAC;IAEP,eAAe,UAAU,CAAC,MAAc;QACpC,IAAI,YAAgC,CAAC;QAErC,IAAI,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC/B,YAAY,GAAG,uBAAuB,CAAC,MAAM,CAAE,CAAC;SACnD;aAAM;YACH,YAAY,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,CAAC;YACvC,qBAAqB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;SAC/C;QAGD,YAAY,GAAG,uBAAuB,CAAC,YAAY,CAAC,CAAC;QAErD,SAAS,CAAC,MAAM,CAAC,CAAC,YAAY,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;QAE5D,SAAS,CAAC,MAAM,CAAC,CAAC;KACrB;IAED,eAAe,OAAO,CAAC,MAAc;QACjC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;YACpB,SAAS,CAAC,MAAM,CAAC,GAAG;gBAChB,YAAY,EAAE,EAAE;aACnB,CA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Q,CAAC,EAAE,CAAC,CACtC,CAAC;aACL;YAED,IAAI,cAAc,EAAE;gBAChB,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC,aAAa,EAAE;oBAC7D,EAAE,EAAE,cAAc;iBACrB,CAAC,CAAC;aACN;YAED,IAAI,iBAAiB,CAAC,YAAY,EAAE;gBAChC,iBAAiB,CAAC,MAAM,GAAG,0BAA0B,CACjD,iBAAiB,CAAC,YAAY,EAC9B,iBAAiB,CAAC,mBAAmB,CACxC,CAAC;aACL;YAED,iBAAiB,CAAC,UAAU,GAAG,mBAAmB,CAAC;SACtD,CAAC,CAAC;QAKH,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ;YACvB,QAAQ,CAAC,MAAM,GAAG,iBAAiB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;YAC7D,QAAQ,CAAC,UAAU,GAAG,UAAU,CAAC;SACpC,CAAC,CAAC;QAEH,OAAO;YACH,mBAAmB;YACnB,aAAa;YACb,kBAAkB;YAClB,aAAa;YACb,SAAS;YACT,WAAW;SACd,CAAC;KACL;IAED,OAAO;QACH,OAAO;KACV,CAAC;AACN,CAAC,CAAC;MAEI,YAAY,GAAG,yBAAyB;;;;"}
@@ -0,0 +1,60 @@
1
+ import { calculateDifferenceInDays, betweenDates } from '../../date.js';
2
+
3
+ const getApartmentBuildingStatus = (projectPhase, constructionNumbers) => {
4
+ const currentDate = new Date();
5
+ const saleStartDate = projectPhase.saleStartDate && new Date(projectPhase.saleStartDate);
6
+ const saleEndDate = projectPhase.saleEndDate && new Date(projectPhase.saleEndDate);
7
+ const allocationDate = projectPhase.allocationDate && new Date(projectPhase.allocationDate);
8
+ if (projectPhase.status === 'Sold')
9
+ return 'UnderConstruction';
10
+ if (projectPhase.status === 'Rented')
11
+ return 'Rented';
12
+ if (!(constructionNumbers === null || constructionNumbers === void 0 ? void 0 : constructionNumbers.length))
13
+ return getInPreparationStatus();
14
+ switch (projectPhase.status) {
15
+ case 'InPreparation':
16
+ return getInPreparationStatus();
17
+ case 'ForRent':
18
+ return 'ForRent';
19
+ case 'OnSale':
20
+ return getOnSaleStatus();
21
+ default:
22
+ return;
23
+ }
24
+ function getInPreparationStatus() {
25
+ if (projectPhase.isRental)
26
+ return 'InPreparation';
27
+ if (saleStartDate) {
28
+ const differenceInDays = calculateDifferenceInDays(saleStartDate, currentDate);
29
+ if (differenceInDays <= 30)
30
+ return 'SaleSoon';
31
+ }
32
+ return 'InPreparation';
33
+ }
34
+ function getOnSaleStatus() {
35
+ if (!saleStartDate || !saleEndDate || !allocationDate)
36
+ return;
37
+ const betweenSaleStartAndSaleEnd = betweenDates(saleStartDate, currentDate, saleEndDate);
38
+ const betweenSaleStartAndAllocation = betweenDates(saleStartDate, currentDate, allocationDate);
39
+ const afterAllocation = currentDate >= allocationDate;
40
+ if (betweenSaleStartAndSaleEnd)
41
+ return 'SaleStarted';
42
+ if (betweenSaleStartAndAllocation)
43
+ return 'AssigningOn';
44
+ if (afterAllocation) {
45
+ const constructionNumberStatusses = constructionNumbers.map(({ availabilityStatus }) => availabilityStatus);
46
+ const constructionNumbersAvailable = constructionNumberStatusses.filter((s) => s === 'Available');
47
+ const constructionNumbersInOption = constructionNumberStatusses.filter((s) => s === 'InOption');
48
+ if (constructionNumbersAvailable.length)
49
+ return 'AmountAvailable';
50
+ if (constructionNumbersInOption.length)
51
+ return 'InOption';
52
+ if (constructionNumberStatusses.indexOf('Sold') > -1)
53
+ return 'Sold';
54
+ }
55
+ return;
56
+ }
57
+ };
58
+
59
+ export { getApartmentBuildingStatus };
60
+ //# sourceMappingURL=apartment-building-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apartment-building-status.js","sources":["../../../../src/extended-api-models/status/apartment-building-status.ts"],"sourcesContent":["import {\n ApartmentBuildingStatus,\n ExtendedConstructionNumber,\n ExtendedProjectPhase,\n} from '../../api-utilities/api-utilities.types';\nimport { betweenDates, calculateDifferenceInDays } from '../../date';\n\nconst getApartmentBuildingStatus = (\n projectPhase: ExtendedProjectPhase,\n constructionNumbers?: ExtendedConstructionNumber[],\n): ApartmentBuildingStatus | undefined => {\n const currentDate = new Date();\n const saleStartDate = projectPhase.saleStartDate && new Date(projectPhase.saleStartDate);\n const saleEndDate = projectPhase.saleEndDate && new Date(projectPhase.saleEndDate);\n const allocationDate = projectPhase.allocationDate && new Date(projectPhase.allocationDate);\n\n if (projectPhase.status === 'Sold') return 'UnderConstruction';\n if (projectPhase.status === 'Rented') return 'Rented';\n\n if (!constructionNumbers?.length) return getInPreparationStatus();\n\n switch (projectPhase.status) {\n case 'InPreparation':\n return getInPreparationStatus();\n case 'ForRent':\n return 'ForRent';\n case 'OnSale':\n return getOnSaleStatus();\n default:\n return;\n }\n\n function getInPreparationStatus(): ApartmentBuildingStatus {\n if (projectPhase.isRental) return 'InPreparation';\n\n if (saleStartDate) {\n const differenceInDays = calculateDifferenceInDays(saleStartDate, currentDate);\n\n if (differenceInDays <= 30) return 'SaleSoon';\n }\n\n return 'InPreparation';\n }\n\n function getOnSaleStatus(): ApartmentBuildingStatus | undefined {\n if (!saleStartDate || !saleEndDate || !allocationDate) return;\n\n const betweenSaleStartAndSaleEnd = betweenDates(saleStartDate, currentDate, saleEndDate);\n const betweenSaleStartAndAllocation = betweenDates(\n saleStartDate,\n currentDate,\n allocationDate,\n );\n const afterAllocation = currentDate >= allocationDate;\n\n if (betweenSaleStartAndSaleEnd) return 'SaleStarted';\n\n if (betweenSaleStartAndAllocation) return 'AssigningOn';\n\n if (afterAllocation) {\n const constructionNumberStatusses = constructionNumbers!.map(\n ({ availabilityStatus }) => availabilityStatus,\n );\n const constructionNumbersAvailable = constructionNumberStatusses.filter(\n (s) => s === 'Available',\n );\n const constructionNumbersInOption = constructionNumberStatusses.filter(\n (s) => s === 'InOption',\n );\n\n if (constructionNumbersAvailable.length) return 'AmountAvailable';\n\n if (constructionNumbersInOption.length) return 'InOption';\n\n if (constructionNumberStatusses.indexOf('Sold') > -1) return 'Sold';\n }\n\n return;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AO;QAE9D,MAAM,0BAA0B,GAAG,YAAY,CAAC,aAAa,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;QACzF,MAAM,6BAA6B,GAAG,YAAY,CAC9C,aAAa,EACb,WAAW,EACX,cAAc,CACjB,CAAC;QACF,MAAM,eAAe,GAAG,WAAW,IAAI,cAAc,CAAC;QAEtD,IAAI,0BAA0B;YAAE,OAAO,aAAa,CAAC;QAErD,IAAI,6BAA6B;YAAE,OAAO,aAAa,CAAC;QAExD,IAAI,eAAe,EAAE;YACjB,MAAM,2BAA2B,GAAG,mBAAoB,CAAC,GAAG,CACxD,CAAC,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,CACjD,CAAC;YACF,MAAM,4BAA4B,GAAG,2BAA2B,CAAC,MAAM,CACnE,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW,CAC3B,CAAC;YACF,MAAM,2BAA2B,GAAG,2BAA2B,CAAC,MAAM,CAClE,CAAC,CAAC,KAAK,CAAC,KAAK,UAAU,CAC1B,CAAC;YAEF,IAAI,4BAA4B,CAAC,MAAM;gBAAE,OAAO,iBAAiB,CAAC;YAElE,IAAI,2BAA2B,CAAC,MAAM;gBAAE,OAAO,UAAU,CAAC;YAE1D,IAAI,2BAA2B,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAAE,OAAO,MAAM,CAAC;SACvE;QAED,OAAO;KACV;AACL;;;;"}
@@ -0,0 +1,20 @@
1
+ const constructionNumberStatus = (constructionNumber) => {
2
+ const { projectPhase, availabilityStatus } = constructionNumber;
3
+ const { isRental, status: projectPhaseStatus } = projectPhase || {};
4
+ if (projectPhaseStatus === 'InPreparation')
5
+ return 'InPreparation';
6
+ if (projectPhaseStatus === 'Sold')
7
+ return 'UnderConstruction';
8
+ switch (availabilityStatus) {
9
+ case 'InOption':
10
+ return 'InOption';
11
+ case 'Available':
12
+ return 'Available';
13
+ case 'Sold':
14
+ return isRental ? 'Rented' : 'Sold';
15
+ }
16
+ return;
17
+ };
18
+
19
+ export { constructionNumberStatus };
20
+ //# sourceMappingURL=construction-number-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"construction-number-status.js","sources":["../../../../src/extended-api-models/status/construction-number-status.ts"],"sourcesContent":["import {\n ExtendedConstructionNumber,\n GeneratedConstructionNumberStatus,\n} from '../../api-utilities/api-utilities.types';\n\nconst constructionNumberStatus = (\n constructionNumber: ExtendedConstructionNumber,\n): GeneratedConstructionNumberStatus | undefined => {\n const { projectPhase, availabilityStatus } = constructionNumber;\n\n const { isRental, status: projectPhaseStatus } = projectPhase || {};\n\n if (projectPhaseStatus === 'InPreparation') return 'InPreparation';\n if (projectPhaseStatus === 'Sold') return 'UnderConstruction';\n\n switch (availabilityStatus) {\n case 'InOption':\n return 'InOption';\n case 'Available':\n return 'Available';\n case 'Sold':\n return isRental ? 'Rented' : 'Sold';\n }\n\n return;\n};\n\nexport { constructionNumberStatus };\n"],"names":[],"mappings":"MAKM,wBAAwB,GAAG,CAC7B,kBAA8C;IAE9C,MAAM,EAAE,YAAY,EAAE,kBAAkB,EAAE,GAAG,kBAAkB,CAAC;IAEhE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,YAAY,IAAI,EAAE,CAAC;IAEpE,IAAI,kBAAkB,KAAK,eAAe;QAAE,OAAO,eAAe,CAAC;IACnE,IAAI,kBAAkB,KAAK,MAAM;QAAE,OAAO,mBAAmB,CAAC;IAE9D,QAAQ,kBAAkB;QACtB,KAAK,UAAU;YACX,OAAO,UAAU,CAAC;QACtB,KAAK,WAAW;YACZ,OAAO,WAAW,CAAC;QACvB,KAAK,MAAM;YACP,OAAO,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;KAC3C;IAED,OAAO;AACX;;;;"}
@@ -0,0 +1,60 @@
1
+ import { calculateDifferenceInDays, betweenDates } from '../../date.js';
2
+
3
+ const getPropertyTypeStatus = (projectPhase, constructionNumbers) => {
4
+ const currentDate = new Date();
5
+ const saleStartDate = projectPhase.saleStartDate && new Date(projectPhase.saleStartDate);
6
+ const saleEndDate = projectPhase.saleEndDate && new Date(projectPhase.saleEndDate);
7
+ const allocationDate = projectPhase.allocationDate && new Date(projectPhase.allocationDate);
8
+ if (projectPhase.status === 'Sold')
9
+ return 'UnderConstruction';
10
+ if (projectPhase.status === 'Rented')
11
+ return 'Rented';
12
+ if (!(constructionNumbers === null || constructionNumbers === void 0 ? void 0 : constructionNumbers.length))
13
+ return getInPreparationStatus();
14
+ switch (projectPhase.status) {
15
+ case 'InPreparation':
16
+ return getInPreparationStatus();
17
+ case 'ForRent':
18
+ return 'ForRent';
19
+ case 'OnSale':
20
+ return getOnSaleStatus();
21
+ default:
22
+ return;
23
+ }
24
+ function getInPreparationStatus() {
25
+ if (projectPhase.isRental)
26
+ return 'InPreparation';
27
+ if (saleStartDate) {
28
+ const differenceInDays = calculateDifferenceInDays(saleStartDate, currentDate);
29
+ if (differenceInDays <= 30)
30
+ return 'SaleSoon';
31
+ }
32
+ return 'InPreparation';
33
+ }
34
+ function getOnSaleStatus() {
35
+ if (!saleStartDate || !saleEndDate || !allocationDate)
36
+ return;
37
+ const betweenSaleStartAndSaleEnd = betweenDates(saleStartDate, currentDate, saleEndDate);
38
+ const betweenSaleStartAndAllocation = betweenDates(saleStartDate, currentDate, allocationDate);
39
+ const afterAllocation = currentDate >= allocationDate;
40
+ if (betweenSaleStartAndSaleEnd)
41
+ return 'SaleStarted';
42
+ if (betweenSaleStartAndAllocation)
43
+ return 'AssigningOn';
44
+ if (afterAllocation) {
45
+ const constructionNumberStatusses = constructionNumbers.map(({ availabilityStatus }) => availabilityStatus);
46
+ const constructionNumbersAvailable = constructionNumberStatusses.filter((s) => s === 'Available');
47
+ const constructionNumbersInOption = constructionNumberStatusses.filter((s) => s === 'InOption');
48
+ if (constructionNumbersAvailable.length)
49
+ return 'AmountAvailable';
50
+ if (constructionNumbersInOption.length)
51
+ return 'InOption';
52
+ if (constructionNumberStatusses.indexOf('Sold') > -1)
53
+ return 'Sold';
54
+ }
55
+ return;
56
+ }
57
+ };
58
+
59
+ export { getPropertyTypeStatus };
60
+ //# sourceMappingURL=property-type-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"property-type-status.js","sources":["../../../../src/extended-api-models/status/property-type-status.ts"],"sourcesContent":["import { PropertyTypeStatus } from '../../api-utilities/api-utilities.types';\nimport { betweenDates, calculateDifferenceInDays } from '../../date';\nimport { ConstructionNumberModel, ProjectPhaseModel } from '../../generated';\n\nconst getPropertyTypeStatus = (\n projectPhase: ProjectPhaseModel,\n constructionNumbers?: ConstructionNumberModel[],\n): PropertyTypeStatus | undefined => {\n const currentDate = new Date();\n const saleStartDate = projectPhase.saleStartDate && new Date(projectPhase.saleStartDate);\n const saleEndDate = projectPhase.saleEndDate && new Date(projectPhase.saleEndDate);\n const allocationDate = projectPhase.allocationDate && new Date(projectPhase.allocationDate);\n\n if (projectPhase.status === 'Sold') return 'UnderConstruction';\n if (projectPhase.status === 'Rented') return 'Rented';\n\n if (!constructionNumbers?.length) return getInPreparationStatus();\n\n switch (projectPhase.status) {\n case 'InPreparation':\n return getInPreparationStatus();\n case 'ForRent':\n return 'ForRent';\n case 'OnSale':\n return getOnSaleStatus();\n default:\n return;\n }\n\n function getInPreparationStatus(): PropertyTypeStatus {\n if (projectPhase.isRental) return 'InPreparation';\n\n if (saleStartDate) {\n const differenceInDays = calculateDifferenceInDays(saleStartDate, currentDate);\n\n if (differenceInDays <= 30) return 'SaleSoon';\n }\n\n return 'InPreparation';\n }\n\n function getOnSaleStatus(): PropertyTypeStatus | undefined {\n if (!saleStartDate || !saleEndDate || !allocationDate) return;\n\n const betweenSaleStartAndSaleEnd = betweenDates(saleStartDate, currentDate, saleEndDate);\n const betweenSaleStartAndAllocation = betweenDates(\n saleStartDate,\n currentDate,\n allocationDate,\n );\n const afterAllocation = currentDate >= allocationDate;\n\n if (betweenSaleStartAndSaleEnd) return 'SaleStarted';\n\n if (betweenSaleStartAndAllocation) return 'AssigningOn';\n\n if (afterAllocation) {\n const constructionNumberStatusses = constructionNumbers!.map(\n ({ availabilityStatus }) => availabilityStatus,\n );\n const constructionNumbersAvailable = constructionNumberStatusses.filter(\n (s) => s === 'Available',\n );\n const constructionNumbersInOption = constructionNumberStatusses.filter(\n (s) => s === 'InOption',\n );\n\n if (constructionNumbersAvailable.length) return 'AmountAvailable';\n\n if (constructionNumbersInOption.length) return 'InOption';\n\n if (constructionNumberStatusses.indexOf('Sold') > -1) return 'Sold';\n }\n\n return;\n }\n};\n\nexport { getPropertyTypeStatus };\n"],"names":[],"mappings":";;MAIM,qBAAqB,GAAG,CAC1B,YAA+B,EAC/B,mBAA+C;IAE/C,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC;IAC/B,MAAM,aAAa,GAAG,YAAY,CAAC,aAAa,IAAI,IAAI,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IACzF,MAAM,WAAW,GAAG,YAAY,CAAC,WAAW,IAAI,IAAI,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACnF,MAAM,cAAc,GAAG,YAAY,CAAC,cAAc,IAAI,IAAI,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IAE5F,IAAI,YAAY,CAAC,MAAM,KAAK,MAAM;QAAE,OAAO,mBAAmB,CAAC;IAC/D,IAAI,YAAY,CAAC,MAAM,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAEtD,IAAI,EAAC,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,MAAM,CAAA;QAAE,OAAO,sBAAsB,EAAE,CAAC;IAElE,QAAQ,YAAY,CAAC,MAAM;QACvB,KAAK,eAAe;YAChB,OAAO,sBAAsB,EAAE,CAAC;QACpC,KAAK,SAAS;YACV,OAAO,SAAS,CAAC;QACrB,KAAK,QAAQ;YACT,OAAO,eAAe,EAAE,CAAC;QAC7B;YACI,OAAO;KACd;IAED,SAAS,sBAAsB;QA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 const getApartmentBuildingView = (constructionNumber) => { var _a, _b; return (_b = (_a = constructionNumber.apartmentBuilding) === null || _a === void 0 ? void 0 : _a.views) === null || _b === void 0 ? void 0 : _b.find((s) => { var _a; return (_a = s.pointers) === null || _a === void 0 ? void 0 : _a.find((s) => s.constructionNumberId === constructionNumber.id); }); };
2
+ const getApartmentBuildingViewById = (constructionNumber, id) => { var _a, _b; return (_b = (_a = constructionNumber.apartmentBuilding) === null || _a === void 0 ? void 0 : _a.views) === null || _b === void 0 ? void 0 : _b.find((view) => view.id === id); };
3
+
4
+ export { getApartmentBuildingView, getApartmentBuildingViewById };
5
+ //# sourceMappingURL=apartment-building-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apartment-building-view.js","sources":["../../../../src/extended-api-models/utilities/apartment-building-view.ts"],"sourcesContent":["import { ExtendedConstructionNumber } from '../../api-utilities/api-utilities.types';\n\nconst getApartmentBuildingView = (constructionNumber: ExtendedConstructionNumber) =>\n constructionNumber.apartmentBuilding?.views?.find((s) =>\n s.pointers?.find((s) => s.constructionNumberId === constructionNumber.id),\n );\n\nconst getApartmentBuildingViewById = (constructionNumber: ExtendedConstructionNumber, id: string) =>\n constructionNumber.apartmentBuilding?.views?.find((view) => view.id === id);\n\nexport { getApartmentBuildingView, getApartmentBuildingViewById };\n"],"names":[],"mappings":"MAEM,wBAAwB,GAAG,CAAC,kBAA8C,sCAC5E,kBAAkB,CAAC,iBAAiB,0CAAE,KAAK,0CAAE,IAAI,CAAC,CAAC,CAAC,4BAChD,CAAC,CAAC,QAAQ,0CAAE,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,oBAAoB,KAAK,kBAAkB,CAAC,EAAE,IAAC,KAC3E;MAEA,4BAA4B,GAAG,CAAC,kBAA8C,EAAE,EAAU,sCAC5F,kBAAkB,CAAC,iBAAiB,0CAAE,KAAK,0CAAE,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE;;;;"}
@@ -0,0 +1,37 @@
1
+ import { mergeDecimalRange } from '../../api-utilities/decimal-range/merge-decimal-range.js';
2
+
3
+ const getExtendedModelPriceRange = (item) => {
4
+ const { constructionNumbers } = item;
5
+ let range;
6
+ if (!constructionNumbers || !constructionNumbers.length) {
7
+ if (!('propertyTypes' in item) || !item.propertyTypes || !item.propertyTypes.length)
8
+ return;
9
+ range = item.propertyTypes
10
+ .filter((propertyType) => propertyType.status !== 'Sold' && propertyType.status !== 'UnderConstruction')
11
+ .reduce((range, propertyType) => {
12
+ const { rentalPrice, salesPrice } = propertyType;
13
+ if ((rentalPrice === null || rentalPrice === void 0 ? void 0 : rentalPrice.amount) && rentalPrice.priceType !== 'PriceOnRequest')
14
+ return mergeDecimalRange(range, rentalPrice.amount);
15
+ if ((salesPrice === null || salesPrice === void 0 ? void 0 : salesPrice.amount) && salesPrice.priceType !== 'PriceOnRequest')
16
+ return mergeDecimalRange(range, salesPrice.amount);
17
+ return range;
18
+ }, {});
19
+ }
20
+ else {
21
+ range = constructionNumbers
22
+ .filter((constructionNumber) => constructionNumber.status !== 'Sold' &&
23
+ constructionNumber.status !== 'UnderConstruction')
24
+ .reduce((range, constructionNumber) => {
25
+ const { rentalPrice, salesPrice } = constructionNumber;
26
+ if ((rentalPrice === null || rentalPrice === void 0 ? void 0 : rentalPrice.amount) && rentalPrice.priceType !== 'PriceOnRequest')
27
+ return mergeDecimalRange(range, rentalPrice.amount);
28
+ if ((salesPrice === null || salesPrice === void 0 ? void 0 : salesPrice.amount) && salesPrice.priceType !== 'PriceOnRequest')
29
+ return mergeDecimalRange(range, salesPrice.amount);
30
+ return range;
31
+ }, {});
32
+ }
33
+ return range;
34
+ };
35
+
36
+ export { getExtendedModelPriceRange };
37
+ //# sourceMappingURL=extended-model-price-range.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extended-model-price-range.js","sources":["../../../../src/extended-api-models/utilities/extended-model-price-range.ts"],"sourcesContent":["import {\n ExtendedApartmentBuilding,\n ExtendedPropertyType,\n} from '../../api-utilities/api-utilities.types';\nimport { mergeDecimalRange } from '../../api-utilities/decimal-range/merge-decimal-range';\nimport { DecimalRange } from '../../generated';\n\nconst getExtendedModelPriceRange = (\n item: ExtendedApartmentBuilding | ExtendedPropertyType,\n): DecimalRange | undefined => {\n const { constructionNumbers } = item;\n let range: DecimalRange;\n\n if (!constructionNumbers || !constructionNumbers.length) {\n if (!('propertyTypes' in item) || !item.propertyTypes || !item.propertyTypes.length) return;\n\n range = item.propertyTypes\n .filter(\n (propertyType) =>\n propertyType.status !== 'Sold' && propertyType.status !== 'UnderConstruction',\n )\n .reduce<DecimalRange>((range, propertyType) => {\n const { rentalPrice, salesPrice } = propertyType;\n\n // Do not include PriceOnRequest price types\n if (rentalPrice?.amount && rentalPrice.priceType !== 'PriceOnRequest')\n return mergeDecimalRange(range, rentalPrice.amount);\n if (salesPrice?.amount && salesPrice.priceType !== 'PriceOnRequest')\n return mergeDecimalRange(range, salesPrice.amount);\n\n return range;\n }, {});\n } else {\n range = constructionNumbers\n .filter(\n (constructionNumber) =>\n constructionNumber.status !== 'Sold' &&\n constructionNumber.status !== 'UnderConstruction',\n )\n .reduce<DecimalRange>((range, constructionNumber) => {\n const { rentalPrice, salesPrice } = constructionNumber;\n\n // Do not include PriceOnRequest price types\n if (rentalPrice?.amount && rentalPrice.priceType !== 'PriceOnRequest')\n return mergeDecimalRange(range, rentalPrice.amount);\n if (salesPrice?.amount && salesPrice.priceType !== 'PriceOnRequest')\n return mergeDecimalRange(range, salesPrice.amount);\n\n return range;\n }, {});\n }\n\n return range;\n};\n\nexport { getExtendedModelPriceRange };\n"],"names":[],"mappings":";;MAOM,0BAA0B,GAAG,CAC/B,IAAsD;IAEtD,MAAM,EAAE,mBAAmB,EAAE,GAAG,IAAI,CAAC;IACrC,IAAI,KAAmB,CAAC;IAExB,IAAI,CAAC,mBAAmB,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE;QACrD,IAAI,EAAE,eAAe,IAAI,IAAI,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AAU,CAAC,SAAS,KAAK,gBAAgB;gBAC/D,OAAO,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;YAEvD,OAAO,KAAK,CAAC;SAChB,EAAE,EAAE,CAAC,CAAC;KACd;IAED,OAAO,KAAK,CAAC;AACjB;;;;"}
@@ -0,0 +1,23 @@
1
+ import { findConstructionNumber, findPropertyType, findApartmentBuilding, findProjectPhase } from '../../api-utilities/find-filter.js';
2
+
3
+ const findExtendedObjectById = ({ constructionNumbers, propertyTypes, apartmentBuildings, projectPhases, districts, }, id) => {
4
+ const constructionNumber = findConstructionNumber(constructionNumbers, { id });
5
+ if (constructionNumber)
6
+ return constructionNumber;
7
+ const propertyType = findPropertyType(propertyTypes, { id });
8
+ if (propertyType)
9
+ return propertyType;
10
+ const apartmentBuilding = findApartmentBuilding(apartmentBuildings, { id });
11
+ if (apartmentBuilding)
12
+ return apartmentBuilding;
13
+ const projectPhase = findProjectPhase(projectPhases, { id });
14
+ if (projectPhase)
15
+ return projectPhase;
16
+ const district = districts.find((district) => district.id === id);
17
+ if (district)
18
+ return district;
19
+ return;
20
+ };
21
+
22
+ export { findExtendedObjectById };
23
+ //# sourceMappingURL=find-extended-object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-extended-object.js","sources":["../../../../src/extended-api-models/utilities/find-extended-object.ts"],"sourcesContent":["import {\n ExtendedApartmentBuilding,\n ExtendedConstructionNumber,\n ExtendedDistrict,\n ExtendedProjectPhase,\n ExtendedPropertyType,\n findApartmentBuilding,\n findConstructionNumber,\n findProjectPhase,\n findPropertyType,\n} from '../../api-utilities';\nimport { ExtendedAreaModels } from '../extended-area';\n\n/**\n * @description Finds and returns the extended API Object with the set id.\n * @param {ExtendedAreaModels} { constructionNumbers, propertyTypes, apartmentBuildings, projectPhases }\n * @param {string} id\n * @return {*} {(ExtendedConstructionNumber\n * | ExtendedPropertyType\n * | ExtendedApartmentBuilding\n * | ExtendedProjectPhase\n * | ExtendedProjectPhase\n * | ExtendedDistrict\n * | undefined)}\n */\nconst findExtendedObjectById = (\n {\n constructionNumbers,\n propertyTypes,\n apartmentBuildings,\n projectPhases,\n districts,\n }: ExtendedAreaModels,\n id: string,\n):\n | ExtendedConstructionNumber\n | ExtendedPropertyType\n | ExtendedApartmentBuilding\n | ExtendedProjectPhase\n | ExtendedProjectPhase\n | ExtendedDistrict\n | undefined => {\n const constructionNumber = findConstructionNumber(constructionNumbers, { id });\n if (constructionNumber) return constructionNumber;\n\n const propertyType = findPropertyType(propertyTypes, { id });\n if (propertyType) return propertyType;\n\n const apartmentBuilding = findApartmentBuilding(apartmentBuildings, { id });\n if (apartmentBuilding) return apartmentBuilding;\n\n const projectPhase = findProjectPhase(projectPhases, { id });\n if (projectPhase) return projectPhase;\n\n const district = districts.find((district) => district.id === id);\n if (district) return district;\n\n return;\n};\n\nexport { findExtendedObjectById };\n"],"names":[],"mappings":";;MAyBM,sBAAsB,GAAG,CAC3B,EACI,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,SAAS,GACQ,EACrB,EAAU;IASV,MAAM,kBAAkB,GAAG,sBAAsB,CAAC,mBAAmB,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/E,IAAI,kBAAkB;QAAE,OAAO,kBAAkB,CAAC;IAElD,MAAM,YAAY,GAAG,gBAAgB,CAAC,aAAa,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7D,IAAI,YAAY;QAAE,OAAO,YAAY,CAAC;IAEtC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,kBAAkB,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5E,IAAI,iBAAiB;QAAE,OAAO,iBAAiB,CAAC;IAEhD,MAAM,YAAY,GAAG,gBAAgB,CAAC,aAAa,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7D,IAAI,YAAY;QAAE,OAAO,YAAY,CAAC;IAEtC,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAClE,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAE9B,OAAO;AACX;;;;"}
@@ -0,0 +1,14 @@
1
+ const isApartment = ({ constructionNumber, propertyType, }) => {
2
+ var _a;
3
+ let houseType;
4
+ if (propertyType) {
5
+ houseType = propertyType.houseType;
6
+ }
7
+ if (constructionNumber) {
8
+ houseType = (_a = constructionNumber.propertyType) === null || _a === void 0 ? void 0 : _a.houseType;
9
+ }
10
+ return ['Appartement', 'Loft', 'Maisonette', 'Studio'].includes(houseType || '');
11
+ };
12
+
13
+ export { isApartment };
14
+ //# sourceMappingURL=is-apartment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-apartment.js","sources":["../../../../src/extended-api-models/utilities/is-apartment.ts"],"sourcesContent":["import {\n ExtendedConstructionNumber,\n ExtendedPropertyType,\n} from '../../api-utilities/api-utilities.types';\n\ninterface IsApartment {\n (obj: { constructionNumber: ExtendedConstructionNumber }): boolean;\n (obj: { propertyType: ExtendedPropertyType }): boolean;\n}\n\nconst isApartment: IsApartment = ({\n constructionNumber,\n propertyType,\n}: {\n constructionNumber?: ExtendedConstructionNumber;\n propertyType?: ExtendedPropertyType;\n}): boolean => {\n let houseType: string | undefined | null;\n\n if (propertyType) {\n houseType = propertyType.houseType;\n }\n\n if (constructionNumber) {\n houseType = constructionNumber.propertyType?.houseType;\n }\n\n return ['Appartement', 'Loft', 'Maisonette', 'Studio'].includes(houseType || '');\n};\n\nexport { isApartment };\n"],"names":[],"mappings":"MAUM,WAAW,GAAgB,CAAC,EAC9B,kBAAkB,EAClB,YAAY,GAIf;;IACG,IAAI,SAAoC,CAAC;IAEzC,IAAI,YAAY,EAAE;QACd,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC;KACtC;IAED,IAAI,kBAAkB,EAAE;QACpB,SAAS,SAAG,kBAAkB,CAAC,YAAY,0CAAE,SAAS,CAAC;KAC1D;IAED,OAAO,CAAC,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;AACrF;;;;"}
@@ -0,0 +1,13 @@
1
+ const functionIsTrue = (fn) => {
2
+ return new Promise((resolve) => {
3
+ const interval = setInterval(() => {
4
+ if (fn()) {
5
+ clearInterval(interval);
6
+ resolve();
7
+ }
8
+ }, 50);
9
+ });
10
+ };
11
+
12
+ export { functionIsTrue };
13
+ //# sourceMappingURL=function-is-true.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function-is-true.js","sources":["../../src/function-is-true.ts"],"sourcesContent":["export const functionIsTrue = (fn: Function) => {\n return new Promise((resolve) => {\n const interval = setInterval(() => {\n if (fn()) {\n clearInterval(interval);\n resolve();\n }\n }, 50);\n });\n};\n"],"names":[],"mappings":"MAAa,cAAc,GAAG,CAAC,EAAY;IACvC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO;QACvB,MAAM,QAAQ,GAAG,WAAW,CAAC;YACzB,IAAI,EAAE,EAAE,EAAE;gBACN,aAAa,CAAC,QAAQ,CAAC,CAAC;gBACxB,OAAO,EAAE,CAAC;aACb;SACJ,EAAE,EAAE,CAAC,CAAC;KACV,CAAC,CAAC;AACP;;;;"}
@@ -0,0 +1,53 @@
1
+ import { APIClient } from '../api/index.js';
2
+
3
+ const apartmentBuildingQuery = (params, config) => APIClient.get(`/api/apartmentbuildings`, params, config).then((res) => res);
4
+ const apartmentBuildingUpdateApartmentBuilding = (nodeId, body, config) => APIClient.put(`/api/apartmentbuildings/${nodeId}`, body, config).then((res) => res);
5
+ const apartmentBuildingDeleteApartmentBuilding = (nodeId, body, config) => APIClient.delete(`/api/apartmentbuildings/${nodeId}`, body, config).then((res) => res);
6
+ const apartmentBuildingGetByExternalId = (nodeId, params, config) => APIClient.get(`/api/apartmentbuildings/${nodeId}`, params, config).then((res) => res);
7
+ const areaProjectGetById = (id, params, config) => APIClient.get(`/api/areaprojects/${id}`, params, config).then((res) => res);
8
+ const areaProjectQuery = (params, config) => APIClient.get(`/api/areaprojects`, params, config).then((res) => res);
9
+ const cityGetByName = (name, params, config) => APIClient.get(`/api/cities/name/${name}`, params, config).then((res) => res);
10
+ const cityGetById = (id, params, config) => APIClient.get(`/api/cities/${id}`, params, config).then((res) => res);
11
+ const cityQuery = (params, config) => APIClient.get(`/api/cities`, params, config).then((res) => res);
12
+ const communityRedirectAsset = (objectType, id, params, config) => APIClient.get(`/api/community/asset/${objectType}/${id}`, params, config).then((res) => res);
13
+ const constructionNumberGetById = (id, params, config) => APIClient.get(`/api/constructionnumbers/${id}`, params, config).then((res) => res);
14
+ const constructionNumberQuery = (params, config) => APIClient.get(`/api/constructionnumbers`, params, config).then((res) => res);
15
+ const countryGetByIsoCode = (isoCode, params, config) => APIClient.get(`/api/countries/isoCode/${isoCode}`, params, config).then((res) => res);
16
+ const countryGetById = (id, params, config) => APIClient.get(`/api/countries/${id}`, params, config).then((res) => res);
17
+ const countryQuery = (params, config) => APIClient.get(`/api/countries`, params, config).then((res) => res);
18
+ const districtGetById = (id, params, config) => APIClient.get(`/api/districts/${id}`, params, config).then((res) => res);
19
+ const districtQuery = (params, config) => APIClient.get(`/api/districts`, params, config).then((res) => res);
20
+ const formLead = (body, config) => APIClient.post(`/api/forms/lead`, body, config).then((res) => res);
21
+ const formCase = (body, config) => APIClient.post(`/api/forms/case`, body, config).then((res) => res);
22
+ const formDynamic = (body, config) => APIClient.post(`/api/forms/dynamic`, body, config).then((res) => res);
23
+ const fundaQuery = (params, config) => APIClient.get(`/api/Funda/query`, params, config).then((res) => res);
24
+ const fundaGet = (params, config) => APIClient.get(`/api/Funda`, params, config).then((res) => res);
25
+ const fundaSubmit = (body, config) => APIClient.post(`/api/Funda/submit`, body, config).then((res) => res);
26
+ const fundaValidate = (body, config) => APIClient.post(`/api/Funda/validate`, body, config).then((res) => res);
27
+ const fundaShowLastSubmittedProject = (params, config) => APIClient.get(`/api/Funda/ShowLastSubmittedProject`, params, config).then((res) => res);
28
+ const fundaShowConvertedFundaObject = (params, config) => APIClient.get(`/api/Funda/ShowConvertedFundaObject`, params, config).then((res) => res);
29
+ const fundaCompareFundaObjectRevisionChanges = (params, config) => APIClient.get(`/api/Funda/CompareFundaObjectRevisionChanges`, params, config).then((res) => res);
30
+ const fundaShowFundaProjectLogs = (params, config) => APIClient.get(`/api/Funda/ShowFundaProjectLogs`, params, config).then((res) => res);
31
+ const fundaExecuteFundaPublisher = (params, config) => APIClient.get(`/api/Funda/ExecuteFundaPublisher`, params, config).then((res) => res);
32
+ const fundaGetAllGwnVersionsByProjectId = (params, config) => APIClient.get(`/api/Funda/GetAllGwnVersionsByProjectId`, params, config).then((res) => res);
33
+ const fundaRemoveVersionFromGwn = (params, config) => APIClient.get(`/api/Funda/RemoveVersionFromGwn`, params, config).then((res) => res);
34
+ const fundaGetActiveBrokersInGateway = (params, config) => APIClient.get(`/api/Funda/GetActiveBrokersInGateway`, params, config).then((res) => res);
35
+ const geoFeatureUpsertGeoFeature = (areaId, objectId, body, config) => APIClient.put(`/api/geofeature/${areaId}/${objectId}`, body, config).then((res) => res);
36
+ const geoFeatureUpsertAreaFeatures = (areaId, body, config) => APIClient.put(`/api/geofeature/${areaId}`, body, config).then((res) => res);
37
+ const geoFeatureDeleteGeoFeature = (areaId, objectId, featureId, body, config) => APIClient.delete(`/api/geofeature/${areaId}/${objectId}/${featureId}`, body, config).then((res) => res);
38
+ const grantGetById = (id, params, config) => APIClient.get(`/api/grants/${id}`, params, config).then((res) => res);
39
+ const grantQuery = (params, config) => APIClient.get(`/api/grants`, params, config).then((res) => res);
40
+ const projectPhaseGetById = (id, params, config) => APIClient.get(`/api/projectphases/${id}`, params, config).then((res) => res);
41
+ const projectPhaseQuery = (params, config) => APIClient.get(`/api/projectphases`, params, config).then((res) => res);
42
+ const propertyTypeGetById = (id, params, config) => APIClient.get(`/api/propertytypes/${id}`, params, config).then((res) => res);
43
+ const propertyTypeQuery = (params, config) => APIClient.get(`/api/propertytypes`, params, config).then((res) => res);
44
+ const provinceGetByName = (name, params, config) => APIClient.get(`/api/provinces/name/${name}`, params, config).then((res) => res);
45
+ const provinceGetById = (id, params, config) => APIClient.get(`/api/provinces/${id}`, params, config).then((res) => res);
46
+ const provinceQuery = (params, config) => APIClient.get(`/api/provinces`, params, config).then((res) => res);
47
+ const regionGetById = (id, params, config) => APIClient.get(`/api/region/${id}`, params, config).then((res) => res);
48
+ const regionQuery = (params, config) => APIClient.get(`/api/region`, params, config).then((res) => res);
49
+ const resourceUpdateResource = (mediaId, body, config) => APIClient.put(`/api/resources/${mediaId}`, body, config).then((res) => res);
50
+ const resourceDeleteResource = (mediaId, body, config) => APIClient.delete(`/api/resources/${mediaId}`, body, config).then((res) => res);
51
+
52
+ export { apartmentBuildingDeleteApartmentBuilding, apartmentBuildingGetByExternalId, apartmentBuildingQuery, apartmentBuildingUpdateApartmentBuilding, areaProjectGetById, areaProjectQuery, cityGetById, cityGetByName, cityQuery, communityRedirectAsset, constructionNumberGetById, constructionNumberQuery, countryGetById, countryGetByIsoCode, countryQuery, districtGetById, districtQuery, formCase, formDynamic, formLead, fundaCompareFundaObjectRevisionChanges, fundaExecuteFundaPublisher, fundaGet, fundaGetActiveBrokersInGateway, fundaGetAllGwnVersionsByProjectId, fundaQuery, fundaRemoveVersionFromGwn, fundaShowConvertedFundaObject, fundaShowFundaProjectLogs, fundaShowLastSubmittedProject, fundaSubmit, fundaValidate, geoFeatureDeleteGeoFeature, geoFeatureUpsertAreaFeatures, geoFeatureUpsertGeoFeature, grantGetById, grantQuery, projectPhaseGetById, projectPhaseQuery, propertyTypeGetById, propertyTypeQuery, provinceGetById, provinceGetByName, provinceQuery, regionGetById, regionQuery, resourceDeleteResource, resourceUpdateResource };
53
+ //# sourceMappingURL=bpd-client.js.map