taxtank-core 0.12.2 → 0.13.0

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 (465) hide show
  1. package/bundles/taxtank-core.umd.js +460 -275
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/collection.js +42 -26
  4. package/esm2015/lib/collections/income-source.collection.js +1 -8
  5. package/esm2015/lib/collections/report/property/property-report-item-depreciation.collection.js +2 -2
  6. package/esm2015/lib/collections/report/property/property-report-item-transaction.collection.js +2 -2
  7. package/esm2015/lib/collections/subscription/service-subscription.collection.js +17 -0
  8. package/esm2015/lib/db/Enums/subscription/service-payment-status.enum.js +6 -0
  9. package/esm2015/lib/db/Enums/subscription/service-price-list.enum.js +5 -0
  10. package/esm2015/lib/db/Enums/{service-price-recurring-interval.enum.js → subscription/service-price-recurring-interval.enum.js} +1 -1
  11. package/esm2015/lib/db/Enums/subscription/service-price-type.enum.js +6 -0
  12. package/esm2015/lib/db/Enums/subscription/service-product-id.enum.js +10 -0
  13. package/esm2015/lib/db/Enums/subscription/service-product-status.enum.js +6 -0
  14. package/esm2015/lib/db/Enums/{service-subscription-status.enum.js → subscription/service-subscription-status.enum.js} +1 -1
  15. package/esm2015/lib/db/Models/abstract-model.js +7 -0
  16. package/esm2015/lib/db/Models/address.js +3 -2
  17. package/esm2015/lib/db/Models/bank/bank-account-balance.js +4 -0
  18. package/esm2015/lib/db/Models/bank/bank-account-property.js +4 -0
  19. package/esm2015/lib/db/Models/bank/bank-account.js +4 -0
  20. package/esm2015/lib/db/Models/bank/bank-connection.js +4 -0
  21. package/esm2015/lib/db/Models/bank/bank-transaction-import.js +4 -0
  22. package/esm2015/lib/db/Models/bank/bank-transaction.js +4 -0
  23. package/esm2015/lib/db/Models/bank/bank.js +4 -0
  24. package/esm2015/lib/db/Models/bank/basiq-job.js +4 -0
  25. package/esm2015/lib/db/Models/bank/financial-data-system.js +4 -0
  26. package/esm2015/lib/db/Models/chart-accounts/chart-accounts-depreciation.js +4 -0
  27. package/esm2015/lib/db/Models/chart-accounts/chart-accounts-heading.js +4 -0
  28. package/esm2015/lib/db/Models/chart-accounts/chart-accounts-metadata.js +4 -0
  29. package/esm2015/lib/db/Models/chart-accounts/chart-accounts-value.js +4 -0
  30. package/esm2015/lib/db/Models/chart-accounts/chart-accounts.js +4 -0
  31. package/esm2015/lib/db/Models/country.js +3 -2
  32. package/esm2015/lib/db/Models/depreciation/depreciation-capital-project.js +4 -0
  33. package/esm2015/lib/db/Models/depreciation/depreciation-forecast.js +4 -0
  34. package/esm2015/lib/db/Models/depreciation/depreciation-receipt.js +4 -0
  35. package/esm2015/lib/db/Models/depreciation/depreciation.js +4 -0
  36. package/esm2015/lib/db/Models/document/document-folder.js +4 -0
  37. package/esm2015/lib/db/Models/document/document.js +4 -0
  38. package/esm2015/lib/db/Models/document/property-document.js +10 -0
  39. package/esm2015/lib/db/Models/firm/accountant/tax-review.js +4 -0
  40. package/esm2015/lib/db/Models/firm/accountant/ticket.js +4 -0
  41. package/esm2015/lib/db/Models/firm/chat.js +4 -0
  42. package/esm2015/lib/db/Models/firm/client-invite.js +4 -0
  43. package/esm2015/lib/db/Models/firm/client-movement.js +4 -0
  44. package/esm2015/lib/db/Models/firm/employee-invite.js +4 -0
  45. package/esm2015/lib/db/Models/firm/firm.js +4 -0
  46. package/esm2015/lib/db/Models/firm/message-document.js +4 -0
  47. package/esm2015/lib/db/Models/firm/message.js +4 -0
  48. package/esm2015/lib/db/Models/incomeSource/income-source-forecast.js +4 -0
  49. package/esm2015/lib/db/Models/incomeSource/income-source-type.js +4 -0
  50. package/esm2015/lib/db/Models/incomeSource/income-source.js +4 -0
  51. package/esm2015/lib/db/Models/incomeSource/salary-forecast.js +4 -0
  52. package/esm2015/lib/db/Models/loan/borrowing-expense-loan.js +4 -0
  53. package/esm2015/lib/db/Models/loan/borrowing-expense.js +4 -0
  54. package/esm2015/lib/db/Models/loan/loan-payout.js +4 -0
  55. package/esm2015/lib/db/Models/loan/loan.js +4 -0
  56. package/esm2015/lib/db/Models/phone.js +3 -2
  57. package/esm2015/lib/db/Models/property/property-category-movement.js +3 -2
  58. package/esm2015/lib/db/Models/property/property-category.js +3 -2
  59. package/esm2015/lib/db/Models/property/property-forecast.js +3 -2
  60. package/esm2015/lib/db/Models/property/property-sale/property-sale-tax-exemption-metadata.js +3 -2
  61. package/esm2015/lib/db/Models/property/property-sale/property-sale.js +3 -2
  62. package/esm2015/lib/db/Models/property/property-sale/tax-exemption-metadata.js +3 -2
  63. package/esm2015/lib/db/Models/property/property-sale/tax-exemption.js +3 -2
  64. package/esm2015/lib/db/Models/property/property-share.js +3 -2
  65. package/esm2015/lib/db/Models/property/property-subscription.js +3 -2
  66. package/esm2015/lib/db/Models/property/property-valuation.js +3 -2
  67. package/esm2015/lib/db/Models/property/property.js +3 -2
  68. package/esm2015/lib/db/Models/service-notification.js +3 -2
  69. package/esm2015/lib/db/Models/sole/sole-forecast.js +4 -0
  70. package/esm2015/lib/db/Models/subscription/service-payment.js +4 -0
  71. package/esm2015/lib/db/Models/subscription/service-price.js +4 -0
  72. package/esm2015/lib/db/Models/subscription/service-product.js +4 -0
  73. package/esm2015/lib/db/Models/subscription/service-subscription-item.js +4 -0
  74. package/esm2015/lib/db/Models/subscription/service-subscription.js +4 -0
  75. package/esm2015/lib/db/Models/tax-return/tax-return-category.js +4 -0
  76. package/esm2015/lib/db/Models/tax-return/tax-return-item.js +4 -0
  77. package/esm2015/lib/db/Models/tax-return/tax-return.js +4 -0
  78. package/esm2015/lib/db/Models/transaction/transaction-allocation.js +4 -0
  79. package/esm2015/lib/db/Models/transaction/transaction-base.js +26 -0
  80. package/esm2015/lib/db/Models/transaction/transaction-metadata.js +4 -0
  81. package/esm2015/lib/db/Models/transaction/transaction-receipt.js +4 -0
  82. package/esm2015/lib/db/Models/transaction/transaction.js +4 -0
  83. package/esm2015/lib/db/Models/user/client-details.js +4 -0
  84. package/esm2015/lib/db/Models/user/client-income-types.js +4 -0
  85. package/esm2015/lib/db/Models/user/employee-details.js +4 -0
  86. package/esm2015/lib/db/Models/user/occupation.js +4 -0
  87. package/esm2015/lib/db/Models/user/registration-invite.js +4 -0
  88. package/esm2015/lib/db/Models/user/user-event-setting.js +4 -0
  89. package/esm2015/lib/db/Models/user/user-event-type-category.js +4 -0
  90. package/esm2015/lib/db/Models/user/user-event-type.js +4 -0
  91. package/esm2015/lib/db/Models/user/user-event.js +4 -0
  92. package/esm2015/lib/db/Models/user/user.js +4 -0
  93. package/esm2015/lib/db/Models/vehicle/vehicle-claim.js +4 -0
  94. package/esm2015/lib/db/Models/vehicle/vehicle-logbook.js +4 -0
  95. package/esm2015/lib/db/Models/vehicle/vehicle.js +4 -0
  96. package/esm2015/lib/interfaces/document.interface.js +1 -1
  97. package/esm2015/lib/models/bank/bank-account-property.js +2 -2
  98. package/esm2015/lib/models/bank/bank-account.js +3 -3
  99. package/esm2015/lib/models/bank/bank-connection.js +2 -2
  100. package/esm2015/lib/models/bank/bank-transaction.js +2 -2
  101. package/esm2015/lib/models/bank/bank.js +2 -2
  102. package/esm2015/lib/models/bank/basiq-job.js +2 -2
  103. package/esm2015/lib/models/borrowing-expense/borrowing-expense-loan.js +2 -2
  104. package/esm2015/lib/models/borrowing-expense/borrowing-expense.js +2 -2
  105. package/esm2015/lib/models/chart-accounts/chart-accounts-depreciation.js +2 -2
  106. package/esm2015/lib/models/chart-accounts/chart-accounts-heading.js +2 -2
  107. package/esm2015/lib/models/chart-accounts/chart-accounts-metadata.js +2 -2
  108. package/esm2015/lib/models/chart-accounts/chart-accounts-value.js +2 -2
  109. package/esm2015/lib/models/chart-accounts/chart-accounts.js +2 -2
  110. package/esm2015/lib/models/chat/chat.js +2 -2
  111. package/esm2015/lib/models/chat/message-document.js +2 -2
  112. package/esm2015/lib/models/chat/message.js +2 -2
  113. package/esm2015/lib/models/client/client-details.js +2 -2
  114. package/esm2015/lib/models/client/client-income-types.js +2 -2
  115. package/esm2015/lib/models/client/client-invite.js +2 -2
  116. package/esm2015/lib/models/client/client-movement.js +2 -2
  117. package/esm2015/lib/models/depreciation/depreciation-capital-project.js +2 -2
  118. package/esm2015/lib/models/depreciation/depreciation-forecast.js +2 -2
  119. package/esm2015/lib/models/depreciation/depreciation-receipt.js +2 -2
  120. package/esm2015/lib/models/depreciation/depreciation.js +2 -2
  121. package/esm2015/lib/models/document/document-folder.js +2 -2
  122. package/esm2015/lib/models/document/document.js +2 -2
  123. package/esm2015/lib/models/employee/employee-details.js +2 -2
  124. package/esm2015/lib/models/employee/employee-invite.js +2 -2
  125. package/esm2015/lib/models/firm/firm.js +2 -2
  126. package/esm2015/lib/models/income-source/income-source-forecast.js +2 -2
  127. package/esm2015/lib/models/income-source/income-source-type.js +2 -2
  128. package/esm2015/lib/models/income-source/income-source.js +2 -2
  129. package/esm2015/lib/models/income-source/salary-forecast.js +2 -2
  130. package/esm2015/lib/models/income-source/sole-forecast.js +2 -2
  131. package/esm2015/lib/models/loan/loan-payout.js +2 -2
  132. package/esm2015/lib/models/loan/loan.js +2 -2
  133. package/esm2015/lib/models/logbook/vehicle-claim.js +2 -2
  134. package/esm2015/lib/models/logbook/vehicle-logbook.js +2 -2
  135. package/esm2015/lib/models/logbook/vehicle.js +2 -2
  136. package/esm2015/lib/models/property/property-document.js +2 -2
  137. package/esm2015/lib/models/property/property.js +1 -1
  138. package/esm2015/lib/models/registration-invite/registration-invite.js +2 -2
  139. package/esm2015/lib/models/service-subscription/service-payment.js +2 -2
  140. package/esm2015/lib/models/service-subscription/service-price.js +2 -2
  141. package/esm2015/lib/models/service-subscription/service-product.js +14 -6
  142. package/esm2015/lib/models/service-subscription/service-subscription-item.js +12 -3
  143. package/esm2015/lib/models/service-subscription/service-subscription.js +29 -12
  144. package/esm2015/lib/models/tax-review/tax-review.js +2 -2
  145. package/esm2015/lib/models/tax-summary/report-item.js +1 -1
  146. package/esm2015/lib/models/transaction/transaction-allocation.js +2 -2
  147. package/esm2015/lib/models/transaction/transaction-metadata.js +2 -2
  148. package/esm2015/lib/models/transaction/transaction-receipt.js +2 -2
  149. package/esm2015/lib/models/transaction/transaction.js +2 -2
  150. package/esm2015/lib/models/user/occupation.js +2 -2
  151. package/esm2015/lib/models/user/user.js +2 -2
  152. package/esm2015/lib/models/user-event/user-event-setting.js +2 -2
  153. package/esm2015/lib/models/user-event/user-event-type-category.js +2 -2
  154. package/esm2015/lib/models/user-event/user-event-type.js +2 -2
  155. package/esm2015/lib/services/http/bank/bank-account/bank-account.service.js +1 -1
  156. package/esm2015/lib/services/http/bank/bank-connection/bank-connection.service.js +1 -1
  157. package/esm2015/lib/services/http/bank/bank-transaction/bank-transaction.service.js +1 -1
  158. package/esm2015/lib/services/http/bank/bank.service.js +1 -1
  159. package/esm2015/lib/services/http/bank/basiq/basiq.service.js +1 -1
  160. package/esm2015/lib/services/http/chart-accounts/chart-accounts-depreciations/chart-accounts-depreciations.service.js +1 -1
  161. package/esm2015/lib/services/http/chart-accounts/chart-accounts.service.js +1 -1
  162. package/esm2015/lib/services/http/chat/chat.service.js +1 -1
  163. package/esm2015/lib/services/http/chat/message/message.service.js +1 -1
  164. package/esm2015/lib/services/http/chat/message-document/message-document.service.js +1 -1
  165. package/esm2015/lib/services/http/depreciation/depreciation-capital-project/depreciation-capital-project.service.js +1 -1
  166. package/esm2015/lib/services/http/depreciation/depreciation.service.js +1 -1
  167. package/esm2015/lib/services/http/document/document-folder/document-folder.service.js +1 -1
  168. package/esm2015/lib/services/http/firm/client-income/client-income-types.service.js +1 -1
  169. package/esm2015/lib/services/http/firm/client-invite/client-invite.service.js +1 -1
  170. package/esm2015/lib/services/http/firm/client-movement/client-movement.service.js +1 -1
  171. package/esm2015/lib/services/http/firm/employee/employee.service.js +1 -1
  172. package/esm2015/lib/services/http/firm/employee-invite/employee-invite.service.js +1 -1
  173. package/esm2015/lib/services/http/firm/firm.service.js +1 -1
  174. package/esm2015/lib/services/http/income-source/income-source-forecast/income-source-forecast.service.js +1 -1
  175. package/esm2015/lib/services/http/income-source/income-source.service.js +1 -1
  176. package/esm2015/lib/services/http/income-source/salary-forecast/salary-forecast.service.js +1 -1
  177. package/esm2015/lib/services/http/income-source/sole-forecast/sole-forecast.service.js +1 -1
  178. package/esm2015/lib/services/http/loan/loan.service.js +1 -1
  179. package/esm2015/lib/services/http/property/property-document/property-document.service.js +1 -1
  180. package/esm2015/lib/services/http/rest/rest.service.js +2 -2
  181. package/esm2015/lib/services/http/subscription/service-price.service.js +24 -0
  182. package/esm2015/lib/services/http/subscription/subscription.service.js +5 -48
  183. package/esm2015/lib/services/http/tax-review/tax-review-history/tax-review-history.service.js +1 -1
  184. package/esm2015/lib/services/http/tax-review/tax-review.service.js +1 -1
  185. package/esm2015/lib/services/http/transaction/transaction-allocation/transaction-allocation.service.js +1 -1
  186. package/esm2015/lib/services/http/transaction/transaction.service.js +1 -1
  187. package/esm2015/lib/services/http/user/user-event-setting/user-event-setting.service.js +1 -1
  188. package/esm2015/lib/services/http/user/user-event-type/user-event-type.service.js +1 -1
  189. package/esm2015/lib/services/http/user/user.service.js +1 -1
  190. package/esm2015/lib/services/http/vehicle/vehicle-claim.service.js +1 -1
  191. package/esm2015/lib/services/http/vehicle/vehicle-logbook.service.js +1 -1
  192. package/esm2015/lib/services/http/vehicle/vehicle.service.js +1 -1
  193. package/esm2015/public-api.js +9 -8
  194. package/fesm2015/taxtank-core.js +219 -174
  195. package/fesm2015/taxtank-core.js.map +1 -1
  196. package/lib/collections/collection.d.ts +13 -10
  197. package/lib/collections/income-source.collection.d.ts +0 -5
  198. package/lib/collections/{service-subscription.collection.d.ts → subscription/service-subscription.collection.d.ts} +2 -2
  199. package/lib/db/Enums/{service-payment-status.enum.d.ts → subscription/service-payment-status.enum.d.ts} +0 -0
  200. package/lib/db/Enums/subscription/service-price-list.enum.d.ts +3 -0
  201. package/lib/db/Enums/{service-price-recurring-interval.enum.d.ts → subscription/service-price-recurring-interval.enum.d.ts} +0 -0
  202. package/lib/db/Enums/{service-price-type.enum.d.ts → subscription/service-price-type.enum.d.ts} +0 -0
  203. package/lib/db/Enums/subscription/service-product-id.enum.d.ts +8 -0
  204. package/lib/db/Enums/subscription/service-product-status.enum.d.ts +4 -0
  205. package/lib/db/Enums/{service-subscription-status.enum.d.ts → subscription/service-subscription-status.enum.d.ts} +0 -0
  206. package/lib/db/Models/abstract-model.d.ts +3 -0
  207. package/lib/db/Models/address.d.ts +2 -1
  208. package/lib/db/Models/{bank-account-balance.d.ts → bank/bank-account-balance.d.ts} +2 -1
  209. package/lib/db/Models/bank/bank-account-property.d.ts +9 -0
  210. package/lib/db/Models/{bank-account.d.ts → bank/bank-account.d.ts} +6 -5
  211. package/lib/db/Models/{bank-connection.d.ts → bank/bank-connection.d.ts} +4 -3
  212. package/lib/db/Models/{bank-transaction-import.d.ts → bank/bank-transaction-import.d.ts} +2 -1
  213. package/lib/db/Models/{bank-transaction.d.ts → bank/bank-transaction.d.ts} +4 -3
  214. package/lib/db/Models/{bank.d.ts → bank/bank.d.ts} +2 -1
  215. package/lib/db/Models/{basiq-job.d.ts → bank/basiq-job.d.ts} +2 -1
  216. package/lib/db/Models/{financial-data-system.d.ts → bank/financial-data-system.d.ts} +2 -1
  217. package/lib/db/Models/{chart-accounts-depreciation.d.ts → chart-accounts/chart-accounts-depreciation.d.ts} +2 -1
  218. package/lib/db/Models/{chart-accounts-heading.d.ts → chart-accounts/chart-accounts-heading.d.ts} +2 -1
  219. package/lib/db/Models/chart-accounts/chart-accounts-metadata.d.ts +12 -0
  220. package/lib/db/Models/{chart-accounts-value.d.ts → chart-accounts/chart-accounts-value.d.ts} +2 -1
  221. package/lib/db/Models/{chart-accounts.d.ts → chart-accounts/chart-accounts.d.ts} +5 -4
  222. package/lib/db/Models/country.d.ts +2 -1
  223. package/lib/db/Models/depreciation/depreciation-capital-project.d.ts +14 -0
  224. package/lib/db/Models/{depreciation-forecast.d.ts → depreciation/depreciation-forecast.d.ts} +3 -2
  225. package/lib/db/Models/{depreciation-receipt.d.ts → depreciation/depreciation-receipt.d.ts} +2 -1
  226. package/lib/db/Models/{depreciation.d.ts → depreciation/depreciation.d.ts} +9 -9
  227. package/lib/db/Models/{document-folder.d.ts → document/document-folder.d.ts} +3 -2
  228. package/lib/db/Models/{document.d.ts → document/document.d.ts} +2 -1
  229. package/lib/db/Models/document/property-document.d.ts +18 -0
  230. package/lib/db/Models/firm/accountant/tax-review.d.ts +14 -0
  231. package/lib/db/Models/firm/accountant/ticket.d.ts +20 -0
  232. package/lib/db/Models/{chat.d.ts → firm/chat.d.ts} +4 -3
  233. package/lib/db/Models/firm/client-invite.d.ts +17 -0
  234. package/lib/db/Models/firm/client-movement.d.ts +13 -0
  235. package/lib/db/Models/firm/employee-invite.d.ts +10 -0
  236. package/lib/db/Models/{firm.d.ts → firm/firm.d.ts} +7 -6
  237. package/lib/db/Models/{message-document.d.ts → firm/message-document.d.ts} +3 -2
  238. package/lib/db/Models/{message.d.ts → firm/message.d.ts} +4 -3
  239. package/lib/db/Models/{income-source-forecast.d.ts → incomeSource/income-source-forecast.d.ts} +2 -1
  240. package/lib/db/Models/{income-source-type.d.ts → incomeSource/income-source-type.d.ts} +3 -2
  241. package/lib/db/Models/{income-source.d.ts → incomeSource/income-source.d.ts} +5 -4
  242. package/lib/db/Models/{salary-forecast.d.ts → incomeSource/salary-forecast.d.ts} +3 -2
  243. package/lib/db/Models/{borrowing-expense-loan.d.ts → loan/borrowing-expense-loan.d.ts} +3 -2
  244. package/lib/db/Models/loan/borrowing-expense.d.ts +8 -0
  245. package/lib/db/Models/{loan-payout.d.ts → loan/loan-payout.d.ts} +3 -2
  246. package/lib/db/Models/{loan.d.ts → loan/loan.d.ts} +9 -8
  247. package/lib/db/Models/phone.d.ts +2 -1
  248. package/lib/db/Models/property/property-category-movement.d.ts +3 -2
  249. package/lib/db/Models/property/property-category.d.ts +3 -2
  250. package/lib/db/Models/property/property-forecast.d.ts +2 -1
  251. package/lib/db/Models/property/property-sale/property-sale-tax-exemption-metadata.d.ts +2 -1
  252. package/lib/db/Models/property/property-sale/property-sale.d.ts +2 -1
  253. package/lib/db/Models/property/property-sale/tax-exemption-metadata.d.ts +2 -1
  254. package/lib/db/Models/property/property-sale/tax-exemption.d.ts +2 -1
  255. package/lib/db/Models/property/property-share.d.ts +4 -3
  256. package/lib/db/Models/property/property-subscription.d.ts +3 -2
  257. package/lib/db/Models/property/property-valuation.d.ts +3 -2
  258. package/lib/db/Models/property/property.d.ts +6 -5
  259. package/lib/db/Models/service-notification.d.ts +4 -3
  260. package/lib/db/Models/sole/sole-forecast.d.ts +9 -0
  261. package/lib/db/Models/{service-payment.d.ts → subscription/service-payment.d.ts} +3 -2
  262. package/lib/db/Models/{service-price.d.ts → subscription/service-price.d.ts} +4 -3
  263. package/lib/db/Models/subscription/service-product.d.ts +19 -0
  264. package/lib/db/Models/{service-subscription-item.d.ts → subscription/service-subscription-item.d.ts} +2 -1
  265. package/lib/db/Models/{service-subscription.d.ts → subscription/service-subscription.d.ts} +4 -3
  266. package/lib/db/Models/{tax-return-category.d.ts → tax-return/tax-return-category.d.ts} +3 -2
  267. package/lib/db/Models/{tax-return-item.d.ts → tax-return/tax-return-item.d.ts} +2 -1
  268. package/lib/db/Models/{tax-return.d.ts → tax-return/tax-return.d.ts} +2 -1
  269. package/lib/db/Models/transaction/transaction-allocation.d.ts +9 -0
  270. package/lib/db/Models/{transaction-base.d.ts → transaction/transaction-base.d.ts} +4 -3
  271. package/lib/db/Models/{transaction-metadata.d.ts → transaction/transaction-metadata.d.ts} +3 -2
  272. package/lib/db/Models/{transaction-receipt.d.ts → transaction/transaction-receipt.d.ts} +2 -1
  273. package/lib/db/Models/{transaction.d.ts → transaction/transaction.d.ts} +9 -9
  274. package/lib/db/Models/{client-details.d.ts → user/client-details.d.ts} +7 -6
  275. package/lib/db/Models/{client-income-types.d.ts → user/client-income-types.d.ts} +2 -1
  276. package/lib/db/Models/user/employee-details.d.ts +8 -0
  277. package/lib/db/Models/user/occupation.d.ts +6 -0
  278. package/lib/db/Models/{registration-invite.d.ts → user/registration-invite.d.ts} +3 -2
  279. package/lib/db/Models/{user-event-setting.d.ts → user/user-event-setting.d.ts} +2 -1
  280. package/lib/db/Models/user/user-event-type-category.d.ts +5 -0
  281. package/lib/db/Models/{user-event-type.d.ts → user/user-event-type.d.ts} +3 -2
  282. package/lib/db/Models/{user-event.d.ts → user/user-event.d.ts} +3 -2
  283. package/lib/db/Models/{user.d.ts → user/user.d.ts} +14 -13
  284. package/lib/db/Models/vehicle/vehicle-claim.d.ts +14 -0
  285. package/lib/db/Models/{vehicle-logbook.d.ts → vehicle/vehicle-logbook.d.ts} +4 -3
  286. package/lib/db/Models/vehicle/vehicle.d.ts +11 -0
  287. package/lib/models/bank/bank-account-property.d.ts +1 -1
  288. package/lib/models/bank/bank-account.d.ts +2 -2
  289. package/lib/models/bank/bank-connection.d.ts +1 -1
  290. package/lib/models/bank/bank-transaction.d.ts +1 -1
  291. package/lib/models/bank/bank.d.ts +1 -1
  292. package/lib/models/bank/basiq-job.d.ts +1 -1
  293. package/lib/models/borrowing-expense/borrowing-expense-loan.d.ts +1 -1
  294. package/lib/models/borrowing-expense/borrowing-expense.d.ts +1 -1
  295. package/lib/models/chart-accounts/chart-accounts-depreciation.d.ts +1 -1
  296. package/lib/models/chart-accounts/chart-accounts-heading.d.ts +1 -1
  297. package/lib/models/chart-accounts/chart-accounts-metadata.d.ts +1 -1
  298. package/lib/models/chart-accounts/chart-accounts-value.d.ts +1 -1
  299. package/lib/models/chart-accounts/chart-accounts.d.ts +1 -1
  300. package/lib/models/chat/chat.d.ts +1 -1
  301. package/lib/models/chat/message-document.d.ts +1 -1
  302. package/lib/models/chat/message.d.ts +1 -1
  303. package/lib/models/client/client-details.d.ts +1 -1
  304. package/lib/models/client/client-income-types.d.ts +1 -1
  305. package/lib/models/client/client-invite.d.ts +1 -1
  306. package/lib/models/client/client-movement.d.ts +1 -1
  307. package/lib/models/depreciation/depreciation-capital-project.d.ts +1 -1
  308. package/lib/models/depreciation/depreciation-forecast.d.ts +1 -1
  309. package/lib/models/depreciation/depreciation-receipt.d.ts +1 -1
  310. package/lib/models/depreciation/depreciation.d.ts +3 -3
  311. package/lib/models/document/document-folder.d.ts +1 -1
  312. package/lib/models/document/document.d.ts +1 -1
  313. package/lib/models/employee/employee-details.d.ts +1 -1
  314. package/lib/models/employee/employee-invite.d.ts +1 -1
  315. package/lib/models/firm/firm.d.ts +1 -1
  316. package/lib/models/income-source/income-source-forecast.d.ts +1 -1
  317. package/lib/models/income-source/income-source-type.d.ts +1 -1
  318. package/lib/models/income-source/income-source.d.ts +1 -1
  319. package/lib/models/income-source/salary-forecast.d.ts +1 -1
  320. package/lib/models/income-source/sole-forecast.d.ts +1 -1
  321. package/lib/models/loan/loan-payout.d.ts +1 -1
  322. package/lib/models/loan/loan.d.ts +1 -1
  323. package/lib/models/logbook/vehicle-claim.d.ts +1 -1
  324. package/lib/models/logbook/vehicle-logbook.d.ts +1 -1
  325. package/lib/models/logbook/vehicle.d.ts +1 -1
  326. package/lib/models/property/property-document.d.ts +1 -1
  327. package/lib/models/property/property.d.ts +0 -2
  328. package/lib/models/registration-invite/registration-invite.d.ts +1 -1
  329. package/lib/models/service-subscription/service-payment.d.ts +1 -1
  330. package/lib/models/service-subscription/service-price.d.ts +1 -1
  331. package/lib/models/service-subscription/service-product.d.ts +5 -3
  332. package/lib/models/service-subscription/service-subscription-item.d.ts +1 -1
  333. package/lib/models/service-subscription/service-subscription.d.ts +13 -3
  334. package/lib/models/tax-review/tax-review.d.ts +1 -1
  335. package/lib/models/tax-summary/report-item.d.ts +1 -1
  336. package/lib/models/transaction/transaction-allocation.d.ts +1 -1
  337. package/lib/models/transaction/transaction-metadata.d.ts +1 -1
  338. package/lib/models/transaction/transaction-receipt.d.ts +1 -1
  339. package/lib/models/transaction/transaction.d.ts +1 -1
  340. package/lib/models/user/occupation.d.ts +1 -1
  341. package/lib/models/user/user.d.ts +1 -1
  342. package/lib/models/user-event/user-event-setting.d.ts +1 -1
  343. package/lib/models/user-event/user-event-type-category.d.ts +1 -1
  344. package/lib/models/user-event/user-event-type.d.ts +1 -1
  345. package/lib/services/http/bank/bank-account/bank-account.service.d.ts +1 -1
  346. package/lib/services/http/bank/bank-connection/bank-connection.service.d.ts +1 -1
  347. package/lib/services/http/bank/bank-transaction/bank-transaction.service.d.ts +1 -1
  348. package/lib/services/http/bank/bank.service.d.ts +1 -1
  349. package/lib/services/http/bank/basiq/basiq.service.d.ts +1 -1
  350. package/lib/services/http/chart-accounts/chart-accounts-depreciations/chart-accounts-depreciations.service.d.ts +1 -1
  351. package/lib/services/http/chat/chat.service.d.ts +1 -1
  352. package/lib/services/http/chat/message/message.service.d.ts +1 -1
  353. package/lib/services/http/depreciation/depreciation.service.d.ts +1 -1
  354. package/lib/services/http/document/document-folder/document-folder.service.d.ts +1 -1
  355. package/lib/services/http/firm/client-invite/client-invite.service.d.ts +1 -1
  356. package/lib/services/http/firm/client-movement/client-movement.service.d.ts +1 -1
  357. package/lib/services/http/firm/employee/employee.service.d.ts +1 -1
  358. package/lib/services/http/firm/employee-invite/employee-invite.service.d.ts +1 -1
  359. package/lib/services/http/income-source/income-source-forecast/income-source-forecast.service.d.ts +1 -1
  360. package/lib/services/http/income-source/income-source.service.d.ts +1 -1
  361. package/lib/services/http/income-source/salary-forecast/salary-forecast.service.d.ts +1 -1
  362. package/lib/services/http/income-source/sole-forecast/sole-forecast.service.d.ts +1 -1
  363. package/lib/services/http/loan/loan.service.d.ts +1 -1
  364. package/lib/services/http/property/property-document/property-document.service.d.ts +1 -1
  365. package/lib/services/http/rest/rest.service.d.ts +1 -1
  366. package/lib/services/http/subscription/service-price.service.d.ts +14 -0
  367. package/lib/services/http/subscription/subscription.service.d.ts +2 -9
  368. package/lib/services/http/tax-review/tax-review-history/tax-review-history.service.d.ts +1 -1
  369. package/lib/services/http/tax-review/tax-review.service.d.ts +1 -1
  370. package/lib/services/http/transaction/transaction-allocation/transaction-allocation.service.d.ts +1 -1
  371. package/lib/services/http/transaction/transaction.service.d.ts +1 -1
  372. package/lib/services/http/user/user-event-setting/user-event-setting.service.d.ts +1 -1
  373. package/lib/services/http/user/user-event-type/user-event-type.service.d.ts +1 -1
  374. package/lib/services/http/vehicle/vehicle-claim.service.d.ts +1 -1
  375. package/lib/services/http/vehicle/vehicle.service.d.ts +1 -1
  376. package/package.json +1 -1
  377. package/public-api.d.ts +8 -7
  378. package/esm2015/lib/collections/service-price.collection.js +0 -10
  379. package/esm2015/lib/collections/service-subscription.collection.js +0 -17
  380. package/esm2015/lib/db/Enums/service-payment-status.enum.js +0 -6
  381. package/esm2015/lib/db/Enums/service-price-type.enum.js +0 -6
  382. package/esm2015/lib/db/Models/bank-account-balance.js +0 -3
  383. package/esm2015/lib/db/Models/bank-account-property.js +0 -3
  384. package/esm2015/lib/db/Models/bank-account.js +0 -3
  385. package/esm2015/lib/db/Models/bank-connection.js +0 -3
  386. package/esm2015/lib/db/Models/bank-transaction-import.js +0 -3
  387. package/esm2015/lib/db/Models/bank-transaction.js +0 -3
  388. package/esm2015/lib/db/Models/bank.js +0 -3
  389. package/esm2015/lib/db/Models/basiq-job.js +0 -3
  390. package/esm2015/lib/db/Models/borrowing-expense-loan.js +0 -3
  391. package/esm2015/lib/db/Models/borrowing-expense.js +0 -3
  392. package/esm2015/lib/db/Models/chart-accounts-depreciation.js +0 -3
  393. package/esm2015/lib/db/Models/chart-accounts-heading.js +0 -3
  394. package/esm2015/lib/db/Models/chart-accounts-metadata.js +0 -3
  395. package/esm2015/lib/db/Models/chart-accounts-value.js +0 -3
  396. package/esm2015/lib/db/Models/chart-accounts.js +0 -3
  397. package/esm2015/lib/db/Models/chat.js +0 -3
  398. package/esm2015/lib/db/Models/client-details.js +0 -3
  399. package/esm2015/lib/db/Models/client-income-types.js +0 -3
  400. package/esm2015/lib/db/Models/client-invite.js +0 -3
  401. package/esm2015/lib/db/Models/client-movement.js +0 -3
  402. package/esm2015/lib/db/Models/depreciation-capital-project.js +0 -3
  403. package/esm2015/lib/db/Models/depreciation-forecast.js +0 -3
  404. package/esm2015/lib/db/Models/depreciation-receipt.js +0 -3
  405. package/esm2015/lib/db/Models/depreciation.js +0 -4
  406. package/esm2015/lib/db/Models/document-folder.js +0 -3
  407. package/esm2015/lib/db/Models/document.js +0 -3
  408. package/esm2015/lib/db/Models/employee-details.js +0 -3
  409. package/esm2015/lib/db/Models/employee-invite.js +0 -3
  410. package/esm2015/lib/db/Models/financial-data-system.js +0 -3
  411. package/esm2015/lib/db/Models/firm.js +0 -3
  412. package/esm2015/lib/db/Models/income-source-forecast.js +0 -3
  413. package/esm2015/lib/db/Models/income-source-type.js +0 -3
  414. package/esm2015/lib/db/Models/income-source.js +0 -3
  415. package/esm2015/lib/db/Models/loan-payout.js +0 -3
  416. package/esm2015/lib/db/Models/loan.js +0 -3
  417. package/esm2015/lib/db/Models/message-document.js +0 -3
  418. package/esm2015/lib/db/Models/message.js +0 -3
  419. package/esm2015/lib/db/Models/occupation.js +0 -3
  420. package/esm2015/lib/db/Models/property/property-document.js +0 -3
  421. package/esm2015/lib/db/Models/registration-invite.js +0 -3
  422. package/esm2015/lib/db/Models/salary-forecast.js +0 -3
  423. package/esm2015/lib/db/Models/service-payment.js +0 -3
  424. package/esm2015/lib/db/Models/service-price.js +0 -3
  425. package/esm2015/lib/db/Models/service-product.js +0 -3
  426. package/esm2015/lib/db/Models/service-subscription-item.js +0 -3
  427. package/esm2015/lib/db/Models/service-subscription.js +0 -3
  428. package/esm2015/lib/db/Models/sole-forecast.js +0 -3
  429. package/esm2015/lib/db/Models/tax-return-category.js +0 -3
  430. package/esm2015/lib/db/Models/tax-return-item.js +0 -3
  431. package/esm2015/lib/db/Models/tax-return.js +0 -3
  432. package/esm2015/lib/db/Models/tax-review.js +0 -3
  433. package/esm2015/lib/db/Models/ticket.js +0 -3
  434. package/esm2015/lib/db/Models/transaction-allocation.js +0 -3
  435. package/esm2015/lib/db/Models/transaction-base.js +0 -25
  436. package/esm2015/lib/db/Models/transaction-metadata.js +0 -3
  437. package/esm2015/lib/db/Models/transaction-receipt.js +0 -3
  438. package/esm2015/lib/db/Models/transaction.js +0 -4
  439. package/esm2015/lib/db/Models/user-event-setting.js +0 -3
  440. package/esm2015/lib/db/Models/user-event-type-category.js +0 -3
  441. package/esm2015/lib/db/Models/user-event-type.js +0 -3
  442. package/esm2015/lib/db/Models/user-event.js +0 -3
  443. package/esm2015/lib/db/Models/user.js +0 -3
  444. package/esm2015/lib/db/Models/vehicle-claim.js +0 -3
  445. package/esm2015/lib/db/Models/vehicle-logbook.js +0 -3
  446. package/esm2015/lib/db/Models/vehicle.js +0 -3
  447. package/lib/collections/service-price.collection.d.ts +0 -6
  448. package/lib/db/Models/bank-account-property.d.ts +0 -8
  449. package/lib/db/Models/borrowing-expense.d.ts +0 -7
  450. package/lib/db/Models/chart-accounts-metadata.d.ts +0 -11
  451. package/lib/db/Models/client-invite.d.ts +0 -16
  452. package/lib/db/Models/client-movement.d.ts +0 -12
  453. package/lib/db/Models/depreciation-capital-project.d.ts +0 -13
  454. package/lib/db/Models/employee-details.d.ts +0 -7
  455. package/lib/db/Models/employee-invite.d.ts +0 -9
  456. package/lib/db/Models/occupation.d.ts +0 -5
  457. package/lib/db/Models/property/property-document.d.ts +0 -13
  458. package/lib/db/Models/service-product.d.ts +0 -12
  459. package/lib/db/Models/sole-forecast.d.ts +0 -8
  460. package/lib/db/Models/tax-review.d.ts +0 -13
  461. package/lib/db/Models/ticket.d.ts +0 -19
  462. package/lib/db/Models/transaction-allocation.d.ts +0 -8
  463. package/lib/db/Models/user-event-type-category.d.ts +0 -4
  464. package/lib/db/Models/vehicle-claim.d.ts +0 -13
  465. package/lib/db/Models/vehicle.d.ts +0 -10
@@ -1272,10 +1272,53 @@
1272
1272
  if (items === void 0) { items = []; }
1273
1273
  return new this.constructor(items);
1274
1274
  };
1275
+ /**
1276
+ * Iterator that allow to iterate collection items
1277
+ */
1278
+ Collection.prototype[Symbol.iterator] = function () {
1279
+ return this.items.values();
1280
+ };
1281
+ Object.defineProperty(Collection.prototype, "first", {
1282
+ get: function () {
1283
+ return first__default["default"](this.items);
1284
+ },
1285
+ enumerable: false,
1286
+ configurable: true
1287
+ });
1288
+ Object.defineProperty(Collection.prototype, "last", {
1289
+ get: function () {
1290
+ return last__default["default"](this.items);
1291
+ },
1292
+ enumerable: false,
1293
+ configurable: true
1294
+ });
1295
+ Collection.prototype.push = function (item) {
1296
+ return this.items.push(item);
1297
+ };
1298
+ Collection.prototype.replaceBy = function (path, item) {
1299
+ var index = this.findIndexBy(path, get__default["default"](item, path));
1300
+ if (index >= 0) {
1301
+ this.items.splice(index, 1, item);
1302
+ }
1303
+ return this;
1304
+ };
1305
+ Collection.prototype.removeBy = function (path, item) {
1306
+ var index = this.findIndexBy(path, get__default["default"](item, path));
1307
+ if (index >= 0) {
1308
+ this.items.splice(index, 1);
1309
+ }
1310
+ return this;
1311
+ };
1312
+ Collection.prototype.toArray = function () {
1313
+ return __spreadArray([], __read(this.items));
1314
+ };
1275
1315
  Collection.prototype.groupBy = function (path) {
1276
1316
  if (path === void 0) { path = ''; }
1277
1317
  return new CollectionDictionary(this, path);
1278
1318
  };
1319
+ /**
1320
+ * @TODO remove and use dictionary instead
1321
+ */
1279
1322
  Collection.prototype.indexBy = function (path) {
1280
1323
  // Create empty initial object for groups
1281
1324
  var result = {};
@@ -1284,13 +1327,6 @@
1284
1327
  });
1285
1328
  return result;
1286
1329
  };
1287
- /**
1288
- * Iterator that allow to iterate collection items
1289
- */
1290
- Collection.prototype[Symbol.iterator] = function () {
1291
- // .values() returns Iterator instance for array
1292
- return this.items.values();
1293
- };
1294
1330
  Object.defineProperty(Collection.prototype, "length", {
1295
1331
  /**
1296
1332
  * get collection length
@@ -1307,30 +1343,24 @@
1307
1343
  Collection.prototype.getIds = function () {
1308
1344
  return this.items.map(function (item) { return item['id']; });
1309
1345
  };
1310
- Collection.prototype.findBy = function (path, value) {
1311
- return this.items.find(function (item) { return get__default["default"](item, path) === value; });
1312
- };
1313
1346
  Collection.prototype.getBy = function (path, value) {
1314
1347
  return this.create(this.items.filter(function (item) { return get__default["default"](item, path) === value; }));
1315
1348
  };
1316
- /**
1317
- * Get single item by id
1318
- */
1319
- Collection.prototype.getById = function (id) {
1320
- return this.items.find(function (item) { return item['id'] === id; });
1321
- };
1322
1349
  Collection.prototype.getByIds = function (ids) {
1323
1350
  return this.items.filter(function (item) { return ids.includes(item['id']); });
1324
1351
  };
1352
+ Collection.prototype.findBy = function (path, value) {
1353
+ return this.items.find(function (item) { return get__default["default"](item, path) === value; });
1354
+ };
1355
+ Collection.prototype.findIndexBy = function (path, value) {
1356
+ return this.items.findIndex(function (item) { return get__default["default"](item, path) === value; });
1357
+ };
1325
1358
  /**
1326
1359
  * Get total sum of items by field
1327
1360
  */
1328
1361
  Collection.prototype.sumBy = function (path) {
1329
1362
  return +this.items.reduce(function (sum, item) { return sum + Number(get__default["default"](item, path)); }, 0).toFixed(2);
1330
1363
  };
1331
- Collection.prototype.toArray = function () {
1332
- return __spreadArray([], __read(this.items));
1333
- };
1334
1364
  /**
1335
1365
  * Filter items by specific provided callback
1336
1366
  */
@@ -1345,20 +1375,6 @@
1345
1375
  if (isDesc === void 0) { isDesc = true; }
1346
1376
  sort(this.items, filed, isDesc);
1347
1377
  };
1348
- Object.defineProperty(Collection.prototype, "first", {
1349
- get: function () {
1350
- return first__default["default"](this.items);
1351
- },
1352
- enumerable: false,
1353
- configurable: true
1354
- });
1355
- Object.defineProperty(Collection.prototype, "last", {
1356
- get: function () {
1357
- return last__default["default"](this.items);
1358
- },
1359
- enumerable: false,
1360
- configurable: true
1361
- });
1362
1378
  Collection.prototype.getByDateRange = function (from, to, dateField) {
1363
1379
  if (dateField === void 0) { dateField = 'date'; }
1364
1380
  return this.create(this.items.filter(function (item) { return item[dateField] >= from && item[dateField] <= to; }));
@@ -2186,13 +2202,6 @@
2186
2202
  IncomeSourceCollection.prototype.filterByTypes = function (types) {
2187
2203
  return this.items.filter(function (incomeSource) { return types.includes(incomeSource.type); });
2188
2204
  };
2189
- /**
2190
- * Get income source by provided Id
2191
- * @param id
2192
- */
2193
- IncomeSourceCollection.prototype.getById = function (id) {
2194
- return this.items.find(function (incomeSource) { return incomeSource.id === id; });
2195
- };
2196
2205
  Object.defineProperty(IncomeSourceCollection.prototype, "forecasts", {
2197
2206
  /**
2198
2207
  * Get income sources list of forecasts
@@ -2555,8 +2564,20 @@
2555
2564
  ]
2556
2565
  };
2557
2566
 
2558
- var TransactionBase = /** @class */ (function () {
2567
+ var AbstractModel = /** @class */ (function () {
2568
+ function AbstractModel() {
2569
+ }
2570
+ AbstractModel.prototype.hasValue = function (value, path) {
2571
+ if (path === void 0) { path = 'id'; }
2572
+ return get__default["default"](path) === value;
2573
+ };
2574
+ return AbstractModel;
2575
+ }());
2576
+
2577
+ var TransactionBase = /** @class */ (function (_super) {
2578
+ __extends(TransactionBase, _super);
2559
2579
  function TransactionBase() {
2580
+ return _super !== null && _super.apply(this, arguments) || this;
2560
2581
  }
2561
2582
  /**
2562
2583
  * Check if current tank is Property
@@ -2580,7 +2601,7 @@
2580
2601
  return CHART_ACCOUNTS_CATEGORIES.sole.includes((_a = this.chartAccounts) === null || _a === void 0 ? void 0 : _a.category);
2581
2602
  };
2582
2603
  return TransactionBase;
2583
- }());
2604
+ }(AbstractModel));
2584
2605
 
2585
2606
  var Depreciation$1 = /** @class */ (function (_super) {
2586
2607
  __extends(Depreciation, _super);
@@ -2637,11 +2658,13 @@
2637
2658
  ChartAccountsListEnum[ChartAccountsListEnum["TAX_OFFSETS_N_R_A_S"] = 571] = "TAX_OFFSETS_N_R_A_S";
2638
2659
  })(exports.ChartAccountsListEnum || (exports.ChartAccountsListEnum = {}));
2639
2660
 
2640
- var DepreciationCapitalProject$1 = /** @class */ (function () {
2661
+ var DepreciationCapitalProject$1 = /** @class */ (function (_super) {
2662
+ __extends(DepreciationCapitalProject, _super);
2641
2663
  function DepreciationCapitalProject() {
2664
+ return _super !== null && _super.apply(this, arguments) || this;
2642
2665
  }
2643
2666
  return DepreciationCapitalProject;
2644
- }());
2667
+ }(AbstractModel));
2645
2668
 
2646
2669
  var DepreciationCapitalProject = /** @class */ (function (_super) {
2647
2670
  __extends(DepreciationCapitalProject, _super);
@@ -2654,11 +2677,13 @@
2654
2677
  classTransformer.Type(function () { return Date; })
2655
2678
  ], DepreciationCapitalProject.prototype, "effectiveDate", void 0);
2656
2679
 
2657
- var DepreciationForecast$1 = /** @class */ (function () {
2680
+ var DepreciationForecast$1 = /** @class */ (function (_super) {
2681
+ __extends(DepreciationForecast, _super);
2658
2682
  function DepreciationForecast() {
2683
+ return _super !== null && _super.apply(this, arguments) || this;
2659
2684
  }
2660
2685
  return DepreciationForecast;
2661
- }());
2686
+ }(AbstractModel));
2662
2687
 
2663
2688
  var DepreciationForecast = /** @class */ (function (_super) {
2664
2689
  __extends(DepreciationForecast, _super);
@@ -2720,17 +2745,21 @@
2720
2745
  return DepreciationForecast;
2721
2746
  }(DepreciationForecast$1));
2722
2747
 
2723
- var ChartAccounts$1 = /** @class */ (function () {
2748
+ var ChartAccounts$1 = /** @class */ (function (_super) {
2749
+ __extends(ChartAccounts, _super);
2724
2750
  function ChartAccounts() {
2751
+ return _super !== null && _super.apply(this, arguments) || this;
2725
2752
  }
2726
2753
  return ChartAccounts;
2727
- }());
2754
+ }(AbstractModel));
2728
2755
 
2729
- var ChartAccountsHeading$1 = /** @class */ (function () {
2756
+ var ChartAccountsHeading$1 = /** @class */ (function (_super) {
2757
+ __extends(ChartAccountsHeading, _super);
2730
2758
  function ChartAccountsHeading() {
2759
+ return _super !== null && _super.apply(this, arguments) || this;
2731
2760
  }
2732
2761
  return ChartAccountsHeading;
2733
- }());
2762
+ }(AbstractModel));
2734
2763
 
2735
2764
  var ChartAccountsHeading = /** @class */ (function (_super) {
2736
2765
  __extends(ChartAccountsHeading, _super);
@@ -2740,11 +2769,13 @@
2740
2769
  return ChartAccountsHeading;
2741
2770
  }(ChartAccountsHeading$1));
2742
2771
 
2743
- var ChartAccountsMetadata$1 = /** @class */ (function () {
2772
+ var ChartAccountsMetadata$1 = /** @class */ (function (_super) {
2773
+ __extends(ChartAccountsMetadata, _super);
2744
2774
  function ChartAccountsMetadata() {
2775
+ return _super !== null && _super.apply(this, arguments) || this;
2745
2776
  }
2746
2777
  return ChartAccountsMetadata;
2747
- }());
2778
+ }(AbstractModel));
2748
2779
 
2749
2780
  exports.ChartAccountsMetadataListEnum = void 0;
2750
2781
  (function (ChartAccountsMetadataListEnum) {
@@ -2930,11 +2961,13 @@
2930
2961
  classTransformer.Type(function () { return ChartAccountsMetadata; })
2931
2962
  ], ChartAccounts.prototype, "metadata", void 0);
2932
2963
 
2933
- var BankTransaction$1 = /** @class */ (function () {
2964
+ var BankTransaction$1 = /** @class */ (function (_super) {
2965
+ __extends(BankTransaction, _super);
2934
2966
  function BankTransaction() {
2967
+ return _super !== null && _super.apply(this, arguments) || this;
2935
2968
  }
2936
2969
  return BankTransaction;
2937
- }());
2970
+ }(AbstractModel));
2938
2971
 
2939
2972
  exports.BankTransactionTypeEnum = void 0;
2940
2973
  (function (BankTransactionTypeEnum) {
@@ -2962,23 +2995,29 @@
2962
2995
  TransactionTypeEnum[TransactionTypeEnum["CREDIT"] = 2] = "CREDIT";
2963
2996
  })(exports.TransactionTypeEnum || (exports.TransactionTypeEnum = {}));
2964
2997
 
2965
- var Property$1 = /** @class */ (function () {
2998
+ var Property$1 = /** @class */ (function (_super) {
2999
+ __extends(Property, _super);
2966
3000
  function Property() {
3001
+ return _super !== null && _super.apply(this, arguments) || this;
2967
3002
  }
2968
3003
  return Property;
2969
- }());
3004
+ }(AbstractModel));
2970
3005
 
2971
- var PropertySubscription$1 = /** @class */ (function () {
3006
+ var PropertySubscription$1 = /** @class */ (function (_super) {
3007
+ __extends(PropertySubscription, _super);
2972
3008
  function PropertySubscription() {
3009
+ return _super !== null && _super.apply(this, arguments) || this;
2973
3010
  }
2974
3011
  return PropertySubscription;
2975
- }());
3012
+ }(AbstractModel));
2976
3013
 
2977
- var User$1 = /** @class */ (function () {
3014
+ var User$1 = /** @class */ (function (_super) {
3015
+ __extends(User, _super);
2978
3016
  function User() {
3017
+ return _super !== null && _super.apply(this, arguments) || this;
2979
3018
  }
2980
3019
  return User;
2981
- }());
3020
+ }(AbstractModel));
2982
3021
 
2983
3022
  exports.UserStatusEnum = void 0;
2984
3023
  (function (UserStatusEnum) {
@@ -3002,17 +3041,21 @@
3002
3041
  UserRolesEnum["SWITCH_USER"] = "ROLE_PREVIOUS_ADMIN";
3003
3042
  })(exports.UserRolesEnum || (exports.UserRolesEnum = {}));
3004
3043
 
3005
- var Address$1 = /** @class */ (function () {
3044
+ var Address$1 = /** @class */ (function (_super) {
3045
+ __extends(Address, _super);
3006
3046
  function Address() {
3047
+ return _super !== null && _super.apply(this, arguments) || this;
3007
3048
  }
3008
3049
  return Address;
3009
- }());
3050
+ }(AbstractModel));
3010
3051
 
3011
- var Country$1 = /** @class */ (function () {
3052
+ var Country$1 = /** @class */ (function (_super) {
3053
+ __extends(Country, _super);
3012
3054
  function Country() {
3055
+ return _super !== null && _super.apply(this, arguments) || this;
3013
3056
  }
3014
3057
  return Country;
3015
- }());
3058
+ }(AbstractModel));
3016
3059
 
3017
3060
  var Country = /** @class */ (function (_super) {
3018
3061
  __extends(Country, _super);
@@ -3081,11 +3124,13 @@
3081
3124
  _a$4[exports.UserRolesEnum.FIRM_OWNER] = 'Firm Owner',
3082
3125
  _a$4);
3083
3126
 
3084
- var ClientDetails$1 = /** @class */ (function () {
3127
+ var ClientDetails$1 = /** @class */ (function (_super) {
3128
+ __extends(ClientDetails, _super);
3085
3129
  function ClientDetails() {
3130
+ return _super !== null && _super.apply(this, arguments) || this;
3086
3131
  }
3087
3132
  return ClientDetails;
3088
- }());
3133
+ }(AbstractModel));
3089
3134
 
3090
3135
  var ClientDetails = /** @class */ (function (_super) {
3091
3136
  __extends(ClientDetails, _super);
@@ -3095,23 +3140,29 @@
3095
3140
  return ClientDetails;
3096
3141
  }(ClientDetails$1));
3097
3142
 
3098
- var EmployeeDetails$1 = /** @class */ (function () {
3143
+ var EmployeeDetails$1 = /** @class */ (function (_super) {
3144
+ __extends(EmployeeDetails, _super);
3099
3145
  function EmployeeDetails() {
3146
+ return _super !== null && _super.apply(this, arguments) || this;
3100
3147
  }
3101
3148
  return EmployeeDetails;
3102
- }());
3149
+ }(AbstractModel));
3103
3150
 
3104
- var Firm$1 = /** @class */ (function () {
3151
+ var Firm$1 = /** @class */ (function (_super) {
3152
+ __extends(Firm, _super);
3105
3153
  function Firm() {
3154
+ return _super !== null && _super.apply(this, arguments) || this;
3106
3155
  }
3107
3156
  return Firm;
3108
- }());
3157
+ }(AbstractModel));
3109
3158
 
3110
- var Phone$1 = /** @class */ (function () {
3159
+ var Phone$1 = /** @class */ (function (_super) {
3160
+ __extends(Phone, _super);
3111
3161
  function Phone() {
3162
+ return _super !== null && _super.apply(this, arguments) || this;
3112
3163
  }
3113
3164
  return Phone;
3114
- }());
3165
+ }(AbstractModel));
3115
3166
 
3116
3167
  exports.PhoneTypeEnum = void 0;
3117
3168
  (function (PhoneTypeEnum) {
@@ -3172,40 +3223,70 @@
3172
3223
  classTransformer.Type(function () { return Firm; })
3173
3224
  ], EmployeeDetails.prototype, "firm", void 0);
3174
3225
 
3175
- var ServiceSubscription$1 = /** @class */ (function () {
3226
+ var ServiceSubscription$1 = /** @class */ (function (_super) {
3227
+ __extends(ServiceSubscription, _super);
3176
3228
  function ServiceSubscription() {
3229
+ return _super !== null && _super.apply(this, arguments) || this;
3177
3230
  }
3178
3231
  return ServiceSubscription;
3179
- }());
3232
+ }(AbstractModel));
3180
3233
 
3181
- var ServiceSubscriptionItem$1 = /** @class */ (function () {
3234
+ var ServiceSubscriptionItem$1 = /** @class */ (function (_super) {
3235
+ __extends(ServiceSubscriptionItem, _super);
3182
3236
  function ServiceSubscriptionItem() {
3237
+ return _super !== null && _super.apply(this, arguments) || this;
3183
3238
  }
3184
3239
  return ServiceSubscriptionItem;
3185
- }());
3240
+ }(AbstractModel));
3186
3241
 
3187
- var ServicePrice$1 = /** @class */ (function () {
3242
+ var ServicePrice$1 = /** @class */ (function (_super) {
3243
+ __extends(ServicePrice, _super);
3188
3244
  function ServicePrice() {
3245
+ return _super !== null && _super.apply(this, arguments) || this;
3189
3246
  }
3190
3247
  return ServicePrice;
3191
- }());
3248
+ }(AbstractModel));
3192
3249
 
3193
- var ServiceProduct$1 = /** @class */ (function () {
3250
+ var ServiceProduct$1 = /** @class */ (function (_super) {
3251
+ __extends(ServiceProduct, _super);
3194
3252
  function ServiceProduct() {
3253
+ return _super !== null && _super.apply(this, arguments) || this;
3195
3254
  }
3196
3255
  return ServiceProduct;
3197
- }());
3256
+ }(AbstractModel));
3257
+
3258
+ exports.ServiceProductStatusEnum = void 0;
3259
+ (function (ServiceProductStatusEnum) {
3260
+ ServiceProductStatusEnum[ServiceProductStatusEnum["ARCHIVED"] = 0] = "ARCHIVED";
3261
+ ServiceProductStatusEnum[ServiceProductStatusEnum["ACTIVE"] = 1] = "ACTIVE";
3262
+ })(exports.ServiceProductStatusEnum || (exports.ServiceProductStatusEnum = {}));
3263
+
3264
+ var ServiceProductIdEnum;
3265
+ (function (ServiceProductIdEnum) {
3266
+ ServiceProductIdEnum[ServiceProductIdEnum["WORK_TANK_OLD"] = 1] = "WORK_TANK_OLD";
3267
+ ServiceProductIdEnum[ServiceProductIdEnum["PROPERTY_OLD"] = 2] = "PROPERTY_OLD";
3268
+ ServiceProductIdEnum[ServiceProductIdEnum["PROPERTY_TANK"] = 3] = "PROPERTY_TANK";
3269
+ ServiceProductIdEnum[ServiceProductIdEnum["WORK_TANK"] = 4] = "WORK_TANK";
3270
+ ServiceProductIdEnum[ServiceProductIdEnum["PROPERTIES"] = 5] = "PROPERTIES";
3271
+ ServiceProductIdEnum[ServiceProductIdEnum["SOLE_TANK"] = 6] = "SOLE_TANK";
3272
+ })(ServiceProductIdEnum || (ServiceProductIdEnum = {}));
3198
3273
 
3199
3274
  var ServiceProduct = /** @class */ (function (_super) {
3200
3275
  __extends(ServiceProduct, _super);
3201
3276
  function ServiceProduct() {
3202
3277
  return _super !== null && _super.apply(this, arguments) || this;
3203
3278
  }
3204
- ServiceProduct.prototype.isProperty = function () {
3205
- return this.title === 'Property';
3279
+ ServiceProduct.prototype.isProperties = function () {
3280
+ return [ServiceProductIdEnum.PROPERTY_OLD, ServiceProductIdEnum.PROPERTIES].includes(this.id);
3281
+ };
3282
+ ServiceProduct.prototype.isWorkTank = function () {
3283
+ return [ServiceProductIdEnum.WORK_TANK_OLD, ServiceProductIdEnum.WORK_TANK].includes(this.id);
3284
+ };
3285
+ ServiceProduct.prototype.isSoleTank = function () {
3286
+ return this.id === ServiceProductIdEnum.SOLE_TANK;
3206
3287
  };
3207
- ServiceProduct.prototype.isWork = function () {
3208
- return this.title === 'Work Tank';
3288
+ ServiceProduct.prototype.isArchived = function () {
3289
+ return this.status === exports.ServiceProductStatusEnum.ARCHIVED;
3209
3290
  };
3210
3291
  return ServiceProduct;
3211
3292
  }(ServiceProduct$1));
@@ -3221,6 +3302,15 @@
3221
3302
  classTransformer.Type(function () { return ServiceProduct; })
3222
3303
  ], ServicePrice.prototype, "product", void 0);
3223
3304
 
3305
+ var ServicePriceListEnum;
3306
+ (function (ServicePriceListEnum) {
3307
+ ServicePriceListEnum[ServicePriceListEnum["PROPERTIES"] = 5] = "PROPERTIES";
3308
+ })(ServicePriceListEnum || (ServicePriceListEnum = {}));
3309
+
3310
+ /**
3311
+ * backend bd doesn't support dynamic prices, as far as we have just one product like that we keep it hardcoded
3312
+ */
3313
+ var PROPERTY_TANK_PRICE = 9;
3224
3314
  var ServiceSubscriptionItem = /** @class */ (function (_super) {
3225
3315
  __extends(ServiceSubscriptionItem, _super);
3226
3316
  function ServiceSubscriptionItem() {
@@ -3228,7 +3318,11 @@
3228
3318
  }
3229
3319
  Object.defineProperty(ServiceSubscriptionItem.prototype, "total", {
3230
3320
  get: function () {
3231
- return this.price.amount * this.quantity;
3321
+ var price = this.price.amount * this.quantity;
3322
+ if (this.price.id === ServicePriceListEnum.PROPERTIES) {
3323
+ price += PROPERTY_TANK_PRICE;
3324
+ }
3325
+ return price;
3232
3326
  },
3233
3327
  enumerable: false,
3234
3328
  configurable: true
@@ -3288,7 +3382,7 @@
3288
3382
  });
3289
3383
  Object.defineProperty(ServiceSubscription.prototype, "propertyQuantity", {
3290
3384
  get: function () {
3291
- return this.propertyTankItem ? this.propertyTankItem.quantity : 0;
3385
+ return this.propertiesItem ? this.propertiesItem.quantity : 0;
3292
3386
  },
3293
3387
  enumerable: false,
3294
3388
  configurable: true
@@ -3299,7 +3393,7 @@
3299
3393
  */
3300
3394
  get: function () {
3301
3395
  var workTankProduct = this.items.find(function (item) {
3302
- return item.price.product.isWork();
3396
+ return item.price.product.isWorkTank();
3303
3397
  });
3304
3398
  if (!this.workTankItem || !this.isActive) {
3305
3399
  return exports.SubscriptionTypeEnum.WITHOUT_SUBSCRIPTION;
@@ -3308,9 +3402,9 @@
3308
3402
  return exports.SubscriptionTypeEnum.INDIVIDUAL;
3309
3403
  }
3310
3404
  var propertyTankProduct = this.items.find(function (item) {
3311
- return item.price.product.isProperty();
3405
+ return item.price.product.isProperties();
3312
3406
  });
3313
- if (!!this.propertyTankItem && propertyTankProduct.quantity === PROPERTY_INVESTOR_MAX_PROPERTIES) {
3407
+ if (!!this.propertiesItem && propertyTankProduct.quantity === PROPERTY_INVESTOR_MAX_PROPERTIES) {
3314
3408
  return exports.SubscriptionTypeEnum.INVESTOR;
3315
3409
  }
3316
3410
  return exports.SubscriptionTypeEnum.INVESTOR_PLUS;
@@ -3338,20 +3432,6 @@
3338
3432
  enumerable: false,
3339
3433
  configurable: true
3340
3434
  });
3341
- Object.defineProperty(ServiceSubscription.prototype, "workTankItem", {
3342
- get: function () {
3343
- return this.items.find(function (item) { return item.price.product.isWork(); });
3344
- },
3345
- enumerable: false,
3346
- configurable: true
3347
- });
3348
- Object.defineProperty(ServiceSubscription.prototype, "propertyTankItem", {
3349
- get: function () {
3350
- return this.items.find(function (item) { return item.price.product.isProperty(); });
3351
- },
3352
- enumerable: false,
3353
- configurable: true
3354
- });
3355
3435
  Object.defineProperty(ServiceSubscription.prototype, "isActive", {
3356
3436
  /**
3357
3437
  * This check on getIsActive need for firm. Accountant has a endDate, but user has not endDate
@@ -3404,6 +3484,33 @@
3404
3484
  ServiceSubscription.prototype.isTrialExpiring = function () {
3405
3485
  return this.daysRemain > 0 && this.daysRemain <= this.lastTrialDays;
3406
3486
  };
3487
+ ServiceSubscription.prototype.isRenewable = function () {
3488
+ return !this.isTrial && !this.isArchived() && this.isActive;
3489
+ };
3490
+ Object.defineProperty(ServiceSubscription.prototype, "workTankItem", {
3491
+ /**
3492
+ * @TODO move to collection
3493
+ */
3494
+ get: function () {
3495
+ return this.items.find(function (item) { return item.price.product.isWorkTank(); });
3496
+ },
3497
+ enumerable: false,
3498
+ configurable: true
3499
+ });
3500
+ Object.defineProperty(ServiceSubscription.prototype, "soleTankItem", {
3501
+ get: function () {
3502
+ return this.items.find(function (item) { return item.price.product.isSoleTank(); });
3503
+ },
3504
+ enumerable: false,
3505
+ configurable: true
3506
+ });
3507
+ Object.defineProperty(ServiceSubscription.prototype, "propertiesItem", {
3508
+ get: function () {
3509
+ return this.items.find(function (item) { return item.price.product.isProperties(); });
3510
+ },
3511
+ enumerable: false,
3512
+ configurable: true
3513
+ });
3407
3514
  ServiceSubscription.prototype.hasPropertyTank = function () {
3408
3515
  return !!this.items.find(function (subscriptionItem) {
3409
3516
  return subscriptionItem.price.product.role.includes(exports.UserRolesEnum.PROPERTY_TANK);
@@ -3414,6 +3521,14 @@
3414
3521
  return subscriptionItem.price.product.role.includes(exports.UserRolesEnum.WORK_TANK);
3415
3522
  });
3416
3523
  };
3524
+ /**
3525
+ * bought before price updates, active for some time to let customer select a new plan
3526
+ * impossible to update, only prolong or buy new
3527
+ */
3528
+ ServiceSubscription.prototype.isArchived = function () {
3529
+ // subscription with at least one archived product considered as archived
3530
+ return !!this.items.map(function (item) { return item.price.product.isArchived(); }).length;
3531
+ };
3417
3532
  return ServiceSubscription;
3418
3533
  }(ServiceSubscription$1));
3419
3534
  __decorate([
@@ -3588,11 +3703,13 @@
3588
3703
  classTransformer.Type(function () { return User; })
3589
3704
  ], PropertySubscription.prototype, "user", void 0);
3590
3705
 
3591
- var PropertyCategory$1 = /** @class */ (function () {
3706
+ var PropertyCategory$1 = /** @class */ (function (_super) {
3707
+ __extends(PropertyCategory, _super);
3592
3708
  function PropertyCategory() {
3709
+ return _super !== null && _super.apply(this, arguments) || this;
3593
3710
  }
3594
3711
  return PropertyCategory;
3595
- }());
3712
+ }(AbstractModel));
3596
3713
 
3597
3714
  var PropertyCategory = /** @class */ (function (_super) {
3598
3715
  __extends(PropertyCategory, _super);
@@ -3609,17 +3726,27 @@
3609
3726
  return PropertyCategory;
3610
3727
  }(PropertyCategory$1));
3611
3728
 
3612
- var PropertyValuation$1 = /** @class */ (function () {
3729
+ var PropertyValuation$1 = /** @class */ (function (_super) {
3730
+ __extends(PropertyValuation, _super);
3613
3731
  function PropertyValuation() {
3732
+ return _super !== null && _super.apply(this, arguments) || this;
3614
3733
  }
3615
3734
  return PropertyValuation;
3616
- }());
3735
+ }(AbstractModel));
3617
3736
 
3618
- var PropertyDocument$1 = /** @class */ (function () {
3737
+ var PropertyDocument$1 = /** @class */ (function (_super) {
3738
+ __extends(PropertyDocument, _super);
3619
3739
  function PropertyDocument() {
3740
+ return _super !== null && _super.apply(this, arguments) || this;
3620
3741
  }
3742
+ PropertyDocument.prototype.getApiUrlPrefix = function () {
3743
+ return '';
3744
+ };
3745
+ PropertyDocument.prototype.getEntity = function () {
3746
+ return undefined;
3747
+ };
3621
3748
  return PropertyDocument;
3622
- }());
3749
+ }(AbstractModel));
3623
3750
 
3624
3751
  // @TODO this enum should come from backend
3625
3752
  /**
@@ -3688,11 +3815,13 @@
3688
3815
  classTransformer.Exclude()
3689
3816
  ], PropertyValuation.prototype, "documentFile", void 0);
3690
3817
 
3691
- var PropertyForecast$1 = /** @class */ (function () {
3818
+ var PropertyForecast$1 = /** @class */ (function (_super) {
3819
+ __extends(PropertyForecast, _super);
3692
3820
  function PropertyForecast() {
3821
+ return _super !== null && _super.apply(this, arguments) || this;
3693
3822
  }
3694
3823
  return PropertyForecast;
3695
- }());
3824
+ }(AbstractModel));
3696
3825
 
3697
3826
  var PropertyForecast = /** @class */ (function (_super) {
3698
3827
  __extends(PropertyForecast, _super);
@@ -3777,11 +3906,13 @@
3777
3906
  })
3778
3907
  ], PropertyForecast.prototype, "marketValue", void 0);
3779
3908
 
3780
- var PropertyCategoryMovement$1 = /** @class */ (function () {
3909
+ var PropertyCategoryMovement$1 = /** @class */ (function (_super) {
3910
+ __extends(PropertyCategoryMovement, _super);
3781
3911
  function PropertyCategoryMovement() {
3912
+ return _super !== null && _super.apply(this, arguments) || this;
3782
3913
  }
3783
3914
  return PropertyCategoryMovement;
3784
- }());
3915
+ }(AbstractModel));
3785
3916
 
3786
3917
  var PropertyCategoryMovement = /** @class */ (function (_super) {
3787
3918
  __extends(PropertyCategoryMovement, _super);
@@ -4126,11 +4257,13 @@
4126
4257
  classTransformer.Exclude()
4127
4258
  ], Property.prototype, "documentFile", void 0);
4128
4259
 
4129
- var TransactionReceipt$1 = /** @class */ (function () {
4260
+ var TransactionReceipt$1 = /** @class */ (function (_super) {
4261
+ __extends(TransactionReceipt, _super);
4130
4262
  function TransactionReceipt() {
4263
+ return _super !== null && _super.apply(this, arguments) || this;
4131
4264
  }
4132
4265
  return TransactionReceipt;
4133
- }());
4266
+ }(AbstractModel));
4134
4267
 
4135
4268
  var TransactionReceipt = /** @class */ (function (_super) {
4136
4269
  __extends(TransactionReceipt, _super);
@@ -4143,11 +4276,13 @@
4143
4276
  return TransactionReceipt;
4144
4277
  }(TransactionReceipt$1));
4145
4278
 
4146
- var IncomeSource$1 = /** @class */ (function () {
4279
+ var IncomeSource$1 = /** @class */ (function (_super) {
4280
+ __extends(IncomeSource, _super);
4147
4281
  function IncomeSource() {
4282
+ return _super !== null && _super.apply(this, arguments) || this;
4148
4283
  }
4149
4284
  return IncomeSource;
4150
- }());
4285
+ }(AbstractModel));
4151
4286
 
4152
4287
  exports.IncomeSourceTypeEnum = void 0;
4153
4288
  (function (IncomeSourceTypeEnum) {
@@ -4157,11 +4292,13 @@
4157
4292
  IncomeSourceTypeEnum[IncomeSourceTypeEnum["SOLE"] = 4] = "SOLE";
4158
4293
  })(exports.IncomeSourceTypeEnum || (exports.IncomeSourceTypeEnum = {}));
4159
4294
 
4160
- var SalaryForecast$1 = /** @class */ (function () {
4295
+ var SalaryForecast$1 = /** @class */ (function (_super) {
4296
+ __extends(SalaryForecast, _super);
4161
4297
  function SalaryForecast() {
4298
+ return _super !== null && _super.apply(this, arguments) || this;
4162
4299
  }
4163
4300
  return SalaryForecast;
4164
- }());
4301
+ }(AbstractModel));
4165
4302
 
4166
4303
  var SalaryForecast = /** @class */ (function (_super) {
4167
4304
  __extends(SalaryForecast, _super);
@@ -4181,11 +4318,13 @@
4181
4318
  classTransformer.Type(function () { return IncomeSource; })
4182
4319
  ], SalaryForecast.prototype, "incomeSource", void 0);
4183
4320
 
4184
- var SoleForecast$1 = /** @class */ (function () {
4321
+ var SoleForecast$1 = /** @class */ (function (_super) {
4322
+ __extends(SoleForecast, _super);
4185
4323
  function SoleForecast() {
4324
+ return _super !== null && _super.apply(this, arguments) || this;
4186
4325
  }
4187
4326
  return SoleForecast;
4188
- }());
4327
+ }(AbstractModel));
4189
4328
 
4190
4329
  var SoleForecast = /** @class */ (function (_super) {
4191
4330
  __extends(SoleForecast, _super);
@@ -4206,11 +4345,13 @@
4206
4345
  classTransformer.Type(function () { return IncomeSource; })
4207
4346
  ], SoleForecast.prototype, "incomeSource", void 0);
4208
4347
 
4209
- var IncomeSourceForecast$1 = /** @class */ (function () {
4348
+ var IncomeSourceForecast$1 = /** @class */ (function (_super) {
4349
+ __extends(IncomeSourceForecast, _super);
4210
4350
  function IncomeSourceForecast() {
4351
+ return _super !== null && _super.apply(this, arguments) || this;
4211
4352
  }
4212
4353
  return IncomeSourceForecast;
4213
- }());
4354
+ }(AbstractModel));
4214
4355
 
4215
4356
  exports.SalaryForecastFrequencyEnum = void 0;
4216
4357
  (function (SalaryForecastFrequencyEnum) {
@@ -4220,11 +4361,13 @@
4220
4361
  SalaryForecastFrequencyEnum[SalaryForecastFrequencyEnum["WEEKLY"] = 52] = "WEEKLY";
4221
4362
  })(exports.SalaryForecastFrequencyEnum || (exports.SalaryForecastFrequencyEnum = {}));
4222
4363
 
4223
- var IncomeSourceType$1 = /** @class */ (function () {
4364
+ var IncomeSourceType$1 = /** @class */ (function (_super) {
4365
+ __extends(IncomeSourceType, _super);
4224
4366
  function IncomeSourceType() {
4367
+ return _super !== null && _super.apply(this, arguments) || this;
4225
4368
  }
4226
4369
  return IncomeSourceType;
4227
- }());
4370
+ }(AbstractModel));
4228
4371
 
4229
4372
  exports.IncomeSourceTypeListSalaryEnum = void 0;
4230
4373
  (function (IncomeSourceTypeListSalaryEnum) {
@@ -4384,11 +4527,13 @@
4384
4527
  classTransformer.Type(function () { return Date; })
4385
4528
  ], IncomeSource.prototype, "dateTo", void 0);
4386
4529
 
4387
- var TransactionMetadata$1 = /** @class */ (function () {
4530
+ var TransactionMetadata$1 = /** @class */ (function (_super) {
4531
+ __extends(TransactionMetadata, _super);
4388
4532
  function TransactionMetadata() {
4533
+ return _super !== null && _super.apply(this, arguments) || this;
4389
4534
  }
4390
4535
  return TransactionMetadata;
4391
- }());
4536
+ }(AbstractModel));
4392
4537
 
4393
4538
  var TransactionMetadata = /** @class */ (function (_super) {
4394
4539
  __extends(TransactionMetadata, _super);
@@ -4401,11 +4546,13 @@
4401
4546
  classTransformer.Type(function () { return ChartAccountsMetadata; })
4402
4547
  ], TransactionMetadata.prototype, "metadata", void 0);
4403
4548
 
4404
- var Loan$1 = /** @class */ (function () {
4549
+ var Loan$1 = /** @class */ (function (_super) {
4550
+ __extends(Loan, _super);
4405
4551
  function Loan() {
4552
+ return _super !== null && _super.apply(this, arguments) || this;
4406
4553
  }
4407
4554
  return Loan;
4408
- }());
4555
+ }(AbstractModel));
4409
4556
 
4410
4557
  exports.LoanRepaymentTypeEnum = void 0;
4411
4558
  (function (LoanRepaymentTypeEnum) {
@@ -4433,11 +4580,13 @@
4433
4580
  classTransformer.Type(function () { return Date; })
4434
4581
  ], LoanPayment.prototype, "date", void 0);
4435
4582
 
4436
- var LoanPayout$1 = /** @class */ (function () {
4583
+ var LoanPayout$1 = /** @class */ (function (_super) {
4584
+ __extends(LoanPayout, _super);
4437
4585
  function LoanPayout() {
4586
+ return _super !== null && _super.apply(this, arguments) || this;
4438
4587
  }
4439
4588
  return LoanPayout;
4440
- }());
4589
+ }(AbstractModel));
4441
4590
 
4442
4591
  exports.LoanPayoutTypeEnum = void 0;
4443
4592
  (function (LoanPayoutTypeEnum) {
@@ -4492,11 +4641,13 @@
4492
4641
  classTransformer.Type(function () { return LoanPayout; })
4493
4642
  ], Loan.prototype, "payout", void 0);
4494
4643
 
4495
- var TransactionAllocation$1 = /** @class */ (function () {
4644
+ var TransactionAllocation$1 = /** @class */ (function (_super) {
4645
+ __extends(TransactionAllocation, _super);
4496
4646
  function TransactionAllocation() {
4647
+ return _super !== null && _super.apply(this, arguments) || this;
4497
4648
  }
4498
4649
  return TransactionAllocation;
4499
- }());
4650
+ }(AbstractModel));
4500
4651
 
4501
4652
  var TransactionAllocation = /** @class */ (function (_super) {
4502
4653
  __extends(TransactionAllocation, _super);
@@ -5171,7 +5322,7 @@
5171
5322
  properties.items.forEach(function (property) {
5172
5323
  var transactionsDictionary = new CollectionDictionary(transactions.getByPropertiesIds([property.id]), 'chartAccounts.id');
5173
5324
  transactionsDictionary.keys.map(function (chartAccountId) {
5174
- _this.items.push(new PropertyReportItemTransaction(transactionsDictionary.get(chartAccountId), property, chartAccounts.getById(+chartAccountId)));
5325
+ _this.items.push(new PropertyReportItemTransaction(transactionsDictionary.get(chartAccountId), property, chartAccounts.findBy('id', +chartAccountId)));
5175
5326
  });
5176
5327
  });
5177
5328
  };
@@ -5215,35 +5366,13 @@
5215
5366
  properties.items.forEach(function (property) {
5216
5367
  var depreciationsByType = new CollectionDictionary(depreciations, 'type');
5217
5368
  depreciationsByType.keys.map(function (type) {
5218
- _this.items.push(new PropertyReportItemDepreciation(depreciationsByType.get(type), property, chartAccounts.getById(depreciationsByType.get(type).first.chartAccounts.id)));
5369
+ _this.items.push(new PropertyReportItemDepreciation(depreciationsByType.get(type), property, chartAccounts.findBy('id', depreciationsByType.get(type).first.chartAccounts.id)));
5219
5370
  });
5220
5371
  });
5221
5372
  };
5222
5373
  return PropertyReportItemDepreciationCollection;
5223
5374
  }(PropertyReportItemCollection));
5224
5375
 
5225
- var ServicePriceCollection = /** @class */ (function (_super) {
5226
- __extends(ServicePriceCollection, _super);
5227
- function ServicePriceCollection() {
5228
- return _super !== null && _super.apply(this, arguments) || this;
5229
- }
5230
- Object.defineProperty(ServicePriceCollection.prototype, "work", {
5231
- get: function () {
5232
- return this.items.filter(function (price) { return price.product.isWork(); })[0];
5233
- },
5234
- enumerable: false,
5235
- configurable: true
5236
- });
5237
- Object.defineProperty(ServicePriceCollection.prototype, "property", {
5238
- get: function () {
5239
- return this.items.filter(function (price) { return price.product.isProperty(); })[0];
5240
- },
5241
- enumerable: false,
5242
- configurable: true
5243
- });
5244
- return ServicePriceCollection;
5245
- }(Collection));
5246
-
5247
5376
  var ServiceSubscriptionCollection = /** @class */ (function (_super) {
5248
5377
  __extends(ServiceSubscriptionCollection, _super);
5249
5378
  function ServiceSubscriptionCollection() {
@@ -6220,11 +6349,13 @@
6220
6349
  return AccountSetupItem;
6221
6350
  }());
6222
6351
 
6223
- var Bank$1 = /** @class */ (function () {
6352
+ var Bank$1 = /** @class */ (function (_super) {
6353
+ __extends(Bank, _super);
6224
6354
  function Bank() {
6355
+ return _super !== null && _super.apply(this, arguments) || this;
6225
6356
  }
6226
6357
  return Bank;
6227
- }());
6358
+ }(AbstractModel));
6228
6359
 
6229
6360
  var Bank = /** @class */ (function (_super) {
6230
6361
  __extends(Bank, _super);
@@ -6243,23 +6374,29 @@
6243
6374
  return Bank;
6244
6375
  }(Bank$1));
6245
6376
 
6246
- var BankAccount$1 = /** @class */ (function () {
6377
+ var BankAccount$1 = /** @class */ (function (_super) {
6378
+ __extends(BankAccount, _super);
6247
6379
  function BankAccount() {
6380
+ return _super !== null && _super.apply(this, arguments) || this;
6248
6381
  }
6249
6382
  return BankAccount;
6250
- }());
6383
+ }(AbstractModel));
6251
6384
 
6252
- var BankAccountBalance = /** @class */ (function () {
6385
+ var BankAccountBalance = /** @class */ (function (_super) {
6386
+ __extends(BankAccountBalance, _super);
6253
6387
  function BankAccountBalance() {
6388
+ return _super !== null && _super.apply(this, arguments) || this;
6254
6389
  }
6255
6390
  return BankAccountBalance;
6256
- }());
6391
+ }(AbstractModel));
6257
6392
 
6258
- var BankAccountProperty$1 = /** @class */ (function () {
6393
+ var BankAccountProperty$1 = /** @class */ (function (_super) {
6394
+ __extends(BankAccountProperty, _super);
6259
6395
  function BankAccountProperty() {
6396
+ return _super !== null && _super.apply(this, arguments) || this;
6260
6397
  }
6261
6398
  return BankAccountProperty;
6262
- }());
6399
+ }(AbstractModel));
6263
6400
 
6264
6401
  var BankAccountProperty = /** @class */ (function (_super) {
6265
6402
  __extends(BankAccountProperty, _super);
@@ -6272,17 +6409,21 @@
6272
6409
  classTransformer.Type(function () { return Property; })
6273
6410
  ], BankAccountProperty.prototype, "property", void 0);
6274
6411
 
6275
- var BankConnection$1 = /** @class */ (function () {
6412
+ var BankConnection$1 = /** @class */ (function (_super) {
6413
+ __extends(BankConnection, _super);
6276
6414
  function BankConnection() {
6415
+ return _super !== null && _super.apply(this, arguments) || this;
6277
6416
  }
6278
6417
  return BankConnection;
6279
- }());
6418
+ }(AbstractModel));
6280
6419
 
6281
- var BasiqJob$1 = /** @class */ (function () {
6420
+ var BasiqJob$1 = /** @class */ (function (_super) {
6421
+ __extends(BasiqJob, _super);
6282
6422
  function BasiqJob() {
6423
+ return _super !== null && _super.apply(this, arguments) || this;
6283
6424
  }
6284
6425
  return BasiqJob;
6285
- }());
6426
+ }(AbstractModel));
6286
6427
 
6287
6428
  var BasiqJob = /** @class */ (function (_super) {
6288
6429
  __extends(BasiqJob, _super);
@@ -6664,11 +6805,13 @@
6664
6805
  return BasiqToken;
6665
6806
  }());
6666
6807
 
6667
- var BorrowingExpense$1 = /** @class */ (function () {
6808
+ var BorrowingExpense$1 = /** @class */ (function (_super) {
6809
+ __extends(BorrowingExpense, _super);
6668
6810
  function BorrowingExpense() {
6811
+ return _super !== null && _super.apply(this, arguments) || this;
6669
6812
  }
6670
6813
  return BorrowingExpense;
6671
- }());
6814
+ }(AbstractModel));
6672
6815
 
6673
6816
  var BorrowingExpense = /** @class */ (function (_super) {
6674
6817
  __extends(BorrowingExpense, _super);
@@ -6678,11 +6821,13 @@
6678
6821
  return BorrowingExpense;
6679
6822
  }(BorrowingExpense$1));
6680
6823
 
6681
- var BorrowingExpenseLoan$1 = /** @class */ (function () {
6824
+ var BorrowingExpenseLoan$1 = /** @class */ (function (_super) {
6825
+ __extends(BorrowingExpenseLoan, _super);
6682
6826
  function BorrowingExpenseLoan() {
6827
+ return _super !== null && _super.apply(this, arguments) || this;
6683
6828
  }
6684
6829
  return BorrowingExpenseLoan;
6685
- }());
6830
+ }(AbstractModel));
6686
6831
 
6687
6832
  var BorrowingExpenseLoan = /** @class */ (function (_super) {
6688
6833
  __extends(BorrowingExpenseLoan, _super);
@@ -6715,11 +6860,13 @@
6715
6860
  classTransformer.Type(function () { return ChartSerie; })
6716
6861
  ], ChartData.prototype, "data", void 0);
6717
6862
 
6718
- var ChartAccountsDepreciation$1 = /** @class */ (function () {
6863
+ var ChartAccountsDepreciation$1 = /** @class */ (function (_super) {
6864
+ __extends(ChartAccountsDepreciation, _super);
6719
6865
  function ChartAccountsDepreciation() {
6866
+ return _super !== null && _super.apply(this, arguments) || this;
6720
6867
  }
6721
6868
  return ChartAccountsDepreciation;
6722
- }());
6869
+ }(AbstractModel));
6723
6870
 
6724
6871
  var ChartAccountsDepreciation = /** @class */ (function (_super) {
6725
6872
  __extends(ChartAccountsDepreciation, _super);
@@ -6751,11 +6898,13 @@
6751
6898
  ChartAccountsTaxLabelsEnum["TAX_DEDUCTED"] = "Tax Deducted";
6752
6899
  })(exports.ChartAccountsTaxLabelsEnum || (exports.ChartAccountsTaxLabelsEnum = {}));
6753
6900
 
6754
- var ChartAccountsValue$1 = /** @class */ (function () {
6901
+ var ChartAccountsValue$1 = /** @class */ (function (_super) {
6902
+ __extends(ChartAccountsValue, _super);
6755
6903
  function ChartAccountsValue() {
6904
+ return _super !== null && _super.apply(this, arguments) || this;
6756
6905
  }
6757
6906
  return ChartAccountsValue;
6758
- }());
6907
+ }(AbstractModel));
6759
6908
 
6760
6909
  var ChartAccountsValue = /** @class */ (function (_super) {
6761
6910
  __extends(ChartAccountsValue, _super);
@@ -6765,11 +6914,13 @@
6765
6914
  return ChartAccountsValue;
6766
6915
  }(ChartAccountsValue$1));
6767
6916
 
6768
- var Chat$1 = /** @class */ (function () {
6917
+ var Chat$1 = /** @class */ (function (_super) {
6918
+ __extends(Chat, _super);
6769
6919
  function Chat() {
6920
+ return _super !== null && _super.apply(this, arguments) || this;
6770
6921
  }
6771
6922
  return Chat;
6772
- }());
6923
+ }(AbstractModel));
6773
6924
 
6774
6925
  var Chat = /** @class */ (function (_super) {
6775
6926
  __extends(Chat, _super);
@@ -6800,17 +6951,21 @@
6800
6951
  ChatViewTypeEnum[ChatViewTypeEnum["ATTACHMENTS"] = 1] = "ATTACHMENTS";
6801
6952
  })(exports.ChatViewTypeEnum || (exports.ChatViewTypeEnum = {}));
6802
6953
 
6803
- var Message$1 = /** @class */ (function () {
6954
+ var Message$1 = /** @class */ (function (_super) {
6955
+ __extends(Message, _super);
6804
6956
  function Message() {
6957
+ return _super !== null && _super.apply(this, arguments) || this;
6805
6958
  }
6806
6959
  return Message;
6807
- }());
6960
+ }(AbstractModel));
6808
6961
 
6809
- var MessageDocument$1 = /** @class */ (function () {
6962
+ var MessageDocument$1 = /** @class */ (function (_super) {
6963
+ __extends(MessageDocument, _super);
6810
6964
  function MessageDocument() {
6965
+ return _super !== null && _super.apply(this, arguments) || this;
6811
6966
  }
6812
6967
  return MessageDocument;
6813
- }());
6968
+ }(AbstractModel));
6814
6969
 
6815
6970
  var MessageDocument = /** @class */ (function (_super) {
6816
6971
  __extends(MessageDocument, _super);
@@ -6868,11 +7023,13 @@
6868
7023
  classTransformer.Expose()
6869
7024
  ], Message.prototype, "documents", void 0);
6870
7025
 
6871
- var ClientIncomeTypes$1 = /** @class */ (function () {
7026
+ var ClientIncomeTypes$1 = /** @class */ (function (_super) {
7027
+ __extends(ClientIncomeTypes, _super);
6872
7028
  function ClientIncomeTypes() {
7029
+ return _super !== null && _super.apply(this, arguments) || this;
6873
7030
  }
6874
7031
  return ClientIncomeTypes;
6875
- }());
7032
+ }(AbstractModel));
6876
7033
 
6877
7034
  var ClientIncomeTypes = /** @class */ (function (_super) {
6878
7035
  __extends(ClientIncomeTypes, _super);
@@ -6892,17 +7049,21 @@
6892
7049
  return ClientIncomeTypes;
6893
7050
  }(ClientIncomeTypes$1));
6894
7051
 
6895
- var ClientInvite$1 = /** @class */ (function () {
7052
+ var ClientInvite$1 = /** @class */ (function (_super) {
7053
+ __extends(ClientInvite, _super);
6896
7054
  function ClientInvite() {
7055
+ return _super !== null && _super.apply(this, arguments) || this;
6897
7056
  }
6898
7057
  return ClientInvite;
6899
- }());
7058
+ }(AbstractModel));
6900
7059
 
6901
- var RegistrationInvite$1 = /** @class */ (function () {
7060
+ var RegistrationInvite$1 = /** @class */ (function (_super) {
7061
+ __extends(RegistrationInvite, _super);
6902
7062
  function RegistrationInvite() {
7063
+ return _super !== null && _super.apply(this, arguments) || this;
6903
7064
  }
6904
7065
  return RegistrationInvite;
6905
- }());
7066
+ }(AbstractModel));
6906
7067
 
6907
7068
  var RegistrationInvite = /** @class */ (function (_super) {
6908
7069
  __extends(RegistrationInvite, _super);
@@ -6990,11 +7151,13 @@
6990
7151
  classTransformer.Type(function () { return RegistrationInvite; })
6991
7152
  ], ClientInvite.prototype, "registrationInvite", void 0);
6992
7153
 
6993
- var ClientMovement$1 = /** @class */ (function () {
7154
+ var ClientMovement$1 = /** @class */ (function (_super) {
7155
+ __extends(ClientMovement, _super);
6994
7156
  function ClientMovement() {
7157
+ return _super !== null && _super.apply(this, arguments) || this;
6995
7158
  }
6996
7159
  return ClientMovement;
6997
- }());
7160
+ }(AbstractModel));
6998
7161
 
6999
7162
  var ClientMovement = /** @class */ (function (_super) {
7000
7163
  __extends(ClientMovement, _super);
@@ -7187,11 +7350,13 @@
7187
7350
  },
7188
7351
  _a$1);
7189
7352
 
7190
- var DepreciationReceipt$1 = /** @class */ (function () {
7353
+ var DepreciationReceipt$1 = /** @class */ (function (_super) {
7354
+ __extends(DepreciationReceipt, _super);
7191
7355
  function DepreciationReceipt() {
7356
+ return _super !== null && _super.apply(this, arguments) || this;
7192
7357
  }
7193
7358
  return DepreciationReceipt;
7194
- }());
7359
+ }(AbstractModel));
7195
7360
 
7196
7361
  var DepreciationReceipt = /** @class */ (function (_super) {
7197
7362
  __extends(DepreciationReceipt, _super);
@@ -7204,11 +7369,13 @@
7204
7369
  return DepreciationReceipt;
7205
7370
  }(DepreciationReceipt$1));
7206
7371
 
7207
- var Document$1 = /** @class */ (function () {
7372
+ var Document$1 = /** @class */ (function (_super) {
7373
+ __extends(Document, _super);
7208
7374
  function Document() {
7375
+ return _super !== null && _super.apply(this, arguments) || this;
7209
7376
  }
7210
7377
  return Document;
7211
- }());
7378
+ }(AbstractModel));
7212
7379
 
7213
7380
  /**
7214
7381
  * Enum with document types which used to API url prefix
@@ -7265,11 +7432,13 @@
7265
7432
  ]
7266
7433
  };
7267
7434
 
7268
- var DocumentFolder$1 = /** @class */ (function () {
7435
+ var DocumentFolder$1 = /** @class */ (function (_super) {
7436
+ __extends(DocumentFolder, _super);
7269
7437
  function DocumentFolder() {
7438
+ return _super !== null && _super.apply(this, arguments) || this;
7270
7439
  }
7271
7440
  return DocumentFolder;
7272
- }());
7441
+ }(AbstractModel));
7273
7442
 
7274
7443
  var DocumentFolder = /** @class */ (function (_super) {
7275
7444
  __extends(DocumentFolder, _super);
@@ -7282,11 +7451,13 @@
7282
7451
  classTransformer.Type(function () { return Document; })
7283
7452
  ], DocumentFolder.prototype, "documents", void 0);
7284
7453
 
7285
- var EmployeeInvite$1 = /** @class */ (function () {
7454
+ var EmployeeInvite$1 = /** @class */ (function (_super) {
7455
+ __extends(EmployeeInvite, _super);
7286
7456
  function EmployeeInvite() {
7457
+ return _super !== null && _super.apply(this, arguments) || this;
7287
7458
  }
7288
7459
  return EmployeeInvite;
7289
- }());
7460
+ }(AbstractModel));
7290
7461
 
7291
7462
  var EmployeeInvite = /** @class */ (function (_super) {
7292
7463
  __extends(EmployeeInvite, _super);
@@ -7465,17 +7636,21 @@
7465
7636
  { label: 'Personal', value: exports.VehicleLogbookPurposeEnum.PERSONAL }
7466
7637
  ];
7467
7638
 
7468
- var Vehicle$1 = /** @class */ (function () {
7639
+ var Vehicle$1 = /** @class */ (function (_super) {
7640
+ __extends(Vehicle, _super);
7469
7641
  function Vehicle() {
7642
+ return _super !== null && _super.apply(this, arguments) || this;
7470
7643
  }
7471
7644
  return Vehicle;
7472
- }());
7645
+ }(AbstractModel));
7473
7646
 
7474
- var VehicleLogbook$1 = /** @class */ (function () {
7647
+ var VehicleLogbook$1 = /** @class */ (function (_super) {
7648
+ __extends(VehicleLogbook, _super);
7475
7649
  function VehicleLogbook() {
7650
+ return _super !== null && _super.apply(this, arguments) || this;
7476
7651
  }
7477
7652
  return VehicleLogbook;
7478
- }());
7653
+ }(AbstractModel));
7479
7654
 
7480
7655
  var VehicleLogbook = /** @class */ (function (_super) {
7481
7656
  __extends(VehicleLogbook, _super);
@@ -7517,11 +7692,13 @@
7517
7692
  classTransformer.Type(function () { return VehicleLogbook; })
7518
7693
  ], Vehicle.prototype, "logbook", void 0);
7519
7694
 
7520
- var VehicleClaim$1 = /** @class */ (function () {
7695
+ var VehicleClaim$1 = /** @class */ (function (_super) {
7696
+ __extends(VehicleClaim, _super);
7521
7697
  function VehicleClaim() {
7698
+ return _super !== null && _super.apply(this, arguments) || this;
7522
7699
  }
7523
7700
  return VehicleClaim;
7524
- }());
7701
+ }(AbstractModel));
7525
7702
 
7526
7703
  var WEEKS_IN_YEAR = 52;
7527
7704
  var VehicleClaim = /** @class */ (function (_super) {
@@ -7614,11 +7791,13 @@
7614
7791
  return VehicleClaim;
7615
7792
  }(VehicleClaim$1));
7616
7793
 
7617
- var ServiceNotification = /** @class */ (function () {
7794
+ var ServiceNotification = /** @class */ (function (_super) {
7795
+ __extends(ServiceNotification, _super);
7618
7796
  function ServiceNotification() {
7797
+ return _super !== null && _super.apply(this, arguments) || this;
7619
7798
  }
7620
7799
  return ServiceNotification;
7621
- }());
7800
+ }(AbstractModel));
7622
7801
 
7623
7802
  var Notification = /** @class */ (function (_super) {
7624
7803
  __extends(Notification, _super);
@@ -7962,11 +8141,13 @@
7962
8141
  return PropertyEquityChartData;
7963
8142
  }());
7964
8143
 
7965
- var PropertyShare$1 = /** @class */ (function () {
8144
+ var PropertyShare$1 = /** @class */ (function (_super) {
8145
+ __extends(PropertyShare, _super);
7966
8146
  function PropertyShare() {
8147
+ return _super !== null && _super.apply(this, arguments) || this;
7967
8148
  }
7968
8149
  return PropertyShare;
7969
- }());
8150
+ }(AbstractModel));
7970
8151
 
7971
8152
  var PropertyShare = /** @class */ (function (_super) {
7972
8153
  __extends(PropertyShare, _super);
@@ -8025,17 +8206,21 @@
8025
8206
  })
8026
8207
  ], PropertyShare.prototype, "email", void 0);
8027
8208
 
8028
- var PropertySale$1 = /** @class */ (function () {
8209
+ var PropertySale$1 = /** @class */ (function (_super) {
8210
+ __extends(PropertySale, _super);
8029
8211
  function PropertySale() {
8212
+ return _super !== null && _super.apply(this, arguments) || this;
8030
8213
  }
8031
8214
  return PropertySale;
8032
- }());
8215
+ }(AbstractModel));
8033
8216
 
8034
- var PropertySaleTaxExemptionMetadata$1 = /** @class */ (function () {
8217
+ var PropertySaleTaxExemptionMetadata$1 = /** @class */ (function (_super) {
8218
+ __extends(PropertySaleTaxExemptionMetadata, _super);
8035
8219
  function PropertySaleTaxExemptionMetadata() {
8220
+ return _super !== null && _super.apply(this, arguments) || this;
8036
8221
  }
8037
8222
  return PropertySaleTaxExemptionMetadata;
8038
- }());
8223
+ }(AbstractModel));
8039
8224
 
8040
8225
  var PropertySale = /** @class */ (function (_super) {
8041
8226
  __extends(PropertySale, _super);
@@ -8061,11 +8246,13 @@
8061
8246
  classTransformer.Type(function () { return PropertySaleTaxExemptionMetadata$1; })
8062
8247
  ], PropertySale.prototype, "taxExemptionMetadata", void 0);
8063
8248
 
8064
- var TaxExemption$1 = /** @class */ (function () {
8249
+ var TaxExemption$1 = /** @class */ (function (_super) {
8250
+ __extends(TaxExemption, _super);
8065
8251
  function TaxExemption() {
8252
+ return _super !== null && _super.apply(this, arguments) || this;
8066
8253
  }
8067
8254
  return TaxExemption;
8068
- }());
8255
+ }(AbstractModel));
8069
8256
 
8070
8257
  var TaxExemption = /** @class */ (function (_super) {
8071
8258
  __extends(TaxExemption, _super);
@@ -8075,11 +8262,13 @@
8075
8262
  return TaxExemption;
8076
8263
  }(TaxExemption$1));
8077
8264
 
8078
- var TaxExemptionMetadata$1 = /** @class */ (function () {
8265
+ var TaxExemptionMetadata$1 = /** @class */ (function (_super) {
8266
+ __extends(TaxExemptionMetadata, _super);
8079
8267
  function TaxExemptionMetadata() {
8268
+ return _super !== null && _super.apply(this, arguments) || this;
8080
8269
  }
8081
8270
  return TaxExemptionMetadata;
8082
- }());
8271
+ }(AbstractModel));
8083
8272
 
8084
8273
  var TaxExemptionMetadata = /** @class */ (function (_super) {
8085
8274
  __extends(TaxExemptionMetadata, _super);
@@ -8109,11 +8298,13 @@
8109
8298
  myAccount: '/client/my-account/subscription'
8110
8299
  };
8111
8300
 
8112
- var ServicePayment$1 = /** @class */ (function () {
8301
+ var ServicePayment$1 = /** @class */ (function (_super) {
8302
+ __extends(ServicePayment, _super);
8113
8303
  function ServicePayment() {
8304
+ return _super !== null && _super.apply(this, arguments) || this;
8114
8305
  }
8115
8306
  return ServicePayment;
8116
- }());
8307
+ }(AbstractModel));
8117
8308
 
8118
8309
  var ServicePayment = /** @class */ (function (_super) {
8119
8310
  __extends(ServicePayment, _super);
@@ -8126,11 +8317,13 @@
8126
8317
  classTransformer.Type(function () { return ServiceSubscription; })
8127
8318
  ], ServicePayment.prototype, "subscription", void 0);
8128
8319
 
8129
- var TaxReview$1 = /** @class */ (function () {
8320
+ var TaxReview$1 = /** @class */ (function (_super) {
8321
+ __extends(TaxReview, _super);
8130
8322
  function TaxReview() {
8323
+ return _super !== null && _super.apply(this, arguments) || this;
8131
8324
  }
8132
8325
  return TaxReview;
8133
- }());
8326
+ }(AbstractModel));
8134
8327
 
8135
8328
  var TaxReview = /** @class */ (function (_super) {
8136
8329
  __extends(TaxReview, _super);
@@ -8434,11 +8627,13 @@
8434
8627
  MyAccountHistoryTypeEnum[MyAccountHistoryTypeEnum["UPLOAD_DOCUMENT"] = 2] = "UPLOAD_DOCUMENT";
8435
8628
  })(exports.MyAccountHistoryTypeEnum || (exports.MyAccountHistoryTypeEnum = {}));
8436
8629
 
8437
- var Occupation$1 = /** @class */ (function () {
8630
+ var Occupation$1 = /** @class */ (function (_super) {
8631
+ __extends(Occupation, _super);
8438
8632
  function Occupation() {
8633
+ return _super !== null && _super.apply(this, arguments) || this;
8439
8634
  }
8440
8635
  return Occupation;
8441
- }());
8636
+ }(AbstractModel));
8442
8637
 
8443
8638
  var Occupation = /** @class */ (function (_super) {
8444
8639
  __extends(Occupation, _super);
@@ -8469,11 +8664,13 @@
8469
8664
  return UserToRegister;
8470
8665
  }());
8471
8666
 
8472
- var UserEventTypeCategory$1 = /** @class */ (function () {
8667
+ var UserEventTypeCategory$1 = /** @class */ (function (_super) {
8668
+ __extends(UserEventTypeCategory, _super);
8473
8669
  function UserEventTypeCategory() {
8670
+ return _super !== null && _super.apply(this, arguments) || this;
8474
8671
  }
8475
8672
  return UserEventTypeCategory;
8476
- }());
8673
+ }(AbstractModel));
8477
8674
 
8478
8675
  var UserEventTypeCategory = /** @class */ (function (_super) {
8479
8676
  __extends(UserEventTypeCategory, _super);
@@ -8483,17 +8680,21 @@
8483
8680
  return UserEventTypeCategory;
8484
8681
  }(UserEventTypeCategory$1));
8485
8682
 
8486
- var UserEventSetting$1 = /** @class */ (function () {
8683
+ var UserEventSetting$1 = /** @class */ (function (_super) {
8684
+ __extends(UserEventSetting, _super);
8487
8685
  function UserEventSetting() {
8686
+ return _super !== null && _super.apply(this, arguments) || this;
8488
8687
  }
8489
8688
  return UserEventSetting;
8490
- }());
8689
+ }(AbstractModel));
8491
8690
 
8492
- var UserEventType$1 = /** @class */ (function () {
8691
+ var UserEventType$1 = /** @class */ (function (_super) {
8692
+ __extends(UserEventType, _super);
8493
8693
  function UserEventType() {
8694
+ return _super !== null && _super.apply(this, arguments) || this;
8494
8695
  }
8495
8696
  return UserEventType;
8496
- }());
8697
+ }(AbstractModel));
8497
8698
 
8498
8699
  var UserEventType = /** @class */ (function (_super) {
8499
8700
  __extends(UserEventType, _super);
@@ -8755,7 +8956,7 @@
8755
8956
  * get instance by id from cache
8756
8957
  * @param id ID of required item
8757
8958
  */
8758
- RestService.prototype.getById = function (id) {
8959
+ RestService.prototype.findById = function (id) {
8759
8960
  return this.get()
8760
8961
  .pipe(operators.map(function (items) {
8761
8962
  return items.find(function (item) { return item['id'] === id; });
@@ -12535,60 +12736,21 @@
12535
12736
  }
12536
12737
  return this.serviceSubscriptionSubject.asObservable();
12537
12738
  };
12538
- /**
12539
- * @TODO right now we have only monthly prices, the function should be refactored to support other options in future
12540
- *
12541
- * create available subscription plans based on existing products
12542
- */
12543
- SubscriptionService.prototype.getSubscriptionPlans = function () {
12544
- var _this = this;
12545
- if (!this._serviceSubscriptions) {
12546
- this.http.get(this.environment.apiV2 + "/service-prices")
12547
- .pipe(operators.map(function (response) {
12548
- return new ServicePriceCollection(response['hydra:member'].map(function (item) { return classTransformer.plainToClass(ServicePrice, item); }));
12549
- }))
12550
- .subscribe(function (prices) {
12551
- _this._serviceSubscriptions = new ServiceSubscriptionCollection([
12552
- classTransformer.plainToClass(ServiceSubscription, { items: [] }),
12553
- classTransformer.plainToClass(ServiceSubscription, {
12554
- items: [classTransformer.plainToClass(ServiceSubscriptionItem, {
12555
- price: prices.property,
12556
- quantity: 2
12557
- })]
12558
- }),
12559
- classTransformer.plainToClass(ServiceSubscription, {
12560
- items: [classTransformer.plainToClass(ServiceSubscriptionItem, {
12561
- price: prices.property,
12562
- quantity: 3
12563
- })]
12564
- })
12565
- ]);
12566
- _this._serviceSubscriptions.items.forEach(function (subscription) {
12567
- subscription.items.push(classTransformer.plainToClass(ServiceSubscriptionItem, { price: prices.work, quantity: 1 }));
12568
- });
12569
- _this.serviceSubscriptionsSubject.next(_this._serviceSubscriptions);
12570
- });
12571
- }
12572
- return this.serviceSubscriptionsSubject.asObservable();
12573
- };
12574
12739
  /**
12575
12740
  * redirect to stripe payment page
12576
12741
  */
12577
- SubscriptionService.prototype.checkoutRedirect = function (subscription, successUrl, cancelUrl) {
12742
+ SubscriptionService.prototype.checkoutRedirect = function (subscription) {
12578
12743
  return __awaiter(this, void 0, void 0, function () {
12579
- var stripe, lineItems;
12744
+ var stripe;
12580
12745
  return __generator(this, function (_a) {
12581
12746
  switch (_a.label) {
12582
12747
  case 0: return [4 /*yield*/, stripeJs.loadStripe(this.environment.stripePk)];
12583
12748
  case 1:
12584
12749
  stripe = _a.sent();
12585
- lineItems = subscription.items.map(function (item) {
12586
- return { servicePriceId: item.price.id, quantity: item.quantity };
12587
- });
12588
12750
  this.http.post(this.environment.apiV2 + "/stripe/checkout-session", {
12589
- lineItems: lineItems,
12590
- successUrl: successUrl,
12591
- cancelUrl: cancelUrl
12751
+ items: subscription.items,
12752
+ successUrl: window.location.href,
12753
+ cancelUrl: window.location.href
12592
12754
  })
12593
12755
  .subscribe(function (session) {
12594
12756
  // @Todo remove user TRIAL status
@@ -12659,6 +12821,29 @@
12659
12821
  }] }];
12660
12822
  } });
12661
12823
 
12824
+ /**
12825
+ * Service that handling banks logic
12826
+ */
12827
+ var ServicePriceService = /** @class */ (function (_super) {
12828
+ __extends(ServicePriceService, _super);
12829
+ function ServicePriceService() {
12830
+ var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
12831
+ _this.modelClass = ServicePrice;
12832
+ _this.url = 'service-prices';
12833
+ _this.isHydra = true;
12834
+ return _this;
12835
+ }
12836
+ return ServicePriceService;
12837
+ }(RestService));
12838
+ ServicePriceService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ServicePriceService, deps: null, target: i0__namespace.ɵɵFactoryTarget.Injectable });
12839
+ ServicePriceService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ServicePriceService, providedIn: 'root' });
12840
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ServicePriceService, decorators: [{
12841
+ type: i0.Injectable,
12842
+ args: [{
12843
+ providedIn: 'root'
12844
+ }]
12845
+ }] });
12846
+
12662
12847
  /**
12663
12848
  * Service to work with tax review
12664
12849
  */
@@ -13844,7 +14029,7 @@
13844
14029
  exports.ServiceNotificationService = ServiceNotificationService;
13845
14030
  exports.ServicePayment = ServicePayment;
13846
14031
  exports.ServicePrice = ServicePrice;
13847
- exports.ServicePriceCollection = ServicePriceCollection;
14032
+ exports.ServicePriceService = ServicePriceService;
13848
14033
  exports.ServiceProduct = ServiceProduct;
13849
14034
  exports.ServiceSubscription = ServiceSubscription;
13850
14035
  exports.ServiceSubscriptionCollection = ServiceSubscriptionCollection;