taxtank-core 0.12.4 → 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 (472) hide show
  1. package/bundles/taxtank-core.umd.js +464 -325
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/collection.js +44 -28
  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/Enums/user-roles.enum.js +1 -2
  16. package/esm2015/lib/db/Models/abstract-model.js +7 -0
  17. package/esm2015/lib/db/Models/address.js +3 -2
  18. package/esm2015/lib/db/Models/bank/bank-account-balance.js +4 -0
  19. package/esm2015/lib/db/Models/bank/bank-account-property.js +4 -0
  20. package/esm2015/lib/db/Models/bank/bank-account.js +4 -0
  21. package/esm2015/lib/db/Models/bank/bank-connection.js +4 -0
  22. package/esm2015/lib/db/Models/bank/bank-transaction-import.js +4 -0
  23. package/esm2015/lib/db/Models/bank/bank-transaction.js +4 -0
  24. package/esm2015/lib/db/Models/bank/bank.js +4 -0
  25. package/esm2015/lib/db/Models/bank/basiq-job.js +4 -0
  26. package/esm2015/lib/db/Models/bank/financial-data-system.js +4 -0
  27. package/esm2015/lib/db/Models/chart-accounts/chart-accounts-depreciation.js +4 -0
  28. package/esm2015/lib/db/Models/chart-accounts/chart-accounts-heading.js +4 -0
  29. package/esm2015/lib/db/Models/chart-accounts/chart-accounts-metadata.js +4 -0
  30. package/esm2015/lib/db/Models/chart-accounts/chart-accounts-value.js +4 -0
  31. package/esm2015/lib/db/Models/chart-accounts/chart-accounts.js +4 -0
  32. package/esm2015/lib/db/Models/country.js +3 -2
  33. package/esm2015/lib/db/Models/depreciation/depreciation-capital-project.js +4 -0
  34. package/esm2015/lib/db/Models/depreciation/depreciation-forecast.js +4 -0
  35. package/esm2015/lib/db/Models/depreciation/depreciation-receipt.js +4 -0
  36. package/esm2015/lib/db/Models/depreciation/depreciation.js +4 -0
  37. package/esm2015/lib/db/Models/document/document-folder.js +4 -0
  38. package/esm2015/lib/db/Models/document/document.js +4 -0
  39. package/esm2015/lib/db/Models/document/property-document.js +10 -0
  40. package/esm2015/lib/db/Models/firm/accountant/tax-review.js +4 -0
  41. package/esm2015/lib/db/Models/firm/accountant/ticket.js +4 -0
  42. package/esm2015/lib/db/Models/firm/chat.js +4 -0
  43. package/esm2015/lib/db/Models/firm/client-invite.js +4 -0
  44. package/esm2015/lib/db/Models/firm/client-movement.js +4 -0
  45. package/esm2015/lib/db/Models/firm/employee-invite.js +4 -0
  46. package/esm2015/lib/db/Models/firm/firm.js +4 -0
  47. package/esm2015/lib/db/Models/firm/message-document.js +4 -0
  48. package/esm2015/lib/db/Models/firm/message.js +4 -0
  49. package/esm2015/lib/db/Models/incomeSource/income-source-forecast.js +4 -0
  50. package/esm2015/lib/db/Models/incomeSource/income-source-type.js +4 -0
  51. package/esm2015/lib/db/Models/incomeSource/income-source.js +4 -0
  52. package/esm2015/lib/db/Models/incomeSource/salary-forecast.js +4 -0
  53. package/esm2015/lib/db/Models/loan/borrowing-expense-loan.js +4 -0
  54. package/esm2015/lib/db/Models/loan/borrowing-expense.js +4 -0
  55. package/esm2015/lib/db/Models/loan/loan-payout.js +4 -0
  56. package/esm2015/lib/db/Models/loan/loan.js +4 -0
  57. package/esm2015/lib/db/Models/phone.js +3 -2
  58. package/esm2015/lib/db/Models/property/property-category-movement.js +3 -2
  59. package/esm2015/lib/db/Models/property/property-category.js +3 -2
  60. package/esm2015/lib/db/Models/property/property-forecast.js +3 -2
  61. package/esm2015/lib/db/Models/property/property-sale/property-sale-tax-exemption-metadata.js +3 -2
  62. package/esm2015/lib/db/Models/property/property-sale/property-sale.js +3 -2
  63. package/esm2015/lib/db/Models/property/property-sale/tax-exemption-metadata.js +3 -2
  64. package/esm2015/lib/db/Models/property/property-sale/tax-exemption.js +3 -2
  65. package/esm2015/lib/db/Models/property/property-share.js +3 -2
  66. package/esm2015/lib/db/Models/property/property-subscription.js +3 -2
  67. package/esm2015/lib/db/Models/property/property-valuation.js +3 -2
  68. package/esm2015/lib/db/Models/property/property.js +3 -2
  69. package/esm2015/lib/db/Models/service-notification.js +3 -2
  70. package/esm2015/lib/db/Models/sole/sole-forecast.js +4 -0
  71. package/esm2015/lib/db/Models/subscription/service-payment.js +4 -0
  72. package/esm2015/lib/db/Models/subscription/service-price.js +4 -0
  73. package/esm2015/lib/db/Models/subscription/service-product.js +4 -0
  74. package/esm2015/lib/db/Models/subscription/service-subscription-item.js +4 -0
  75. package/esm2015/lib/db/Models/subscription/service-subscription.js +4 -0
  76. package/esm2015/lib/db/Models/tax-return/tax-return-category.js +4 -0
  77. package/esm2015/lib/db/Models/tax-return/tax-return-item.js +4 -0
  78. package/esm2015/lib/db/Models/tax-return/tax-return.js +4 -0
  79. package/esm2015/lib/db/Models/transaction/transaction-allocation.js +4 -0
  80. package/esm2015/lib/db/Models/transaction/transaction-base.js +26 -0
  81. package/esm2015/lib/db/Models/transaction/transaction-metadata.js +4 -0
  82. package/esm2015/lib/db/Models/transaction/transaction-receipt.js +4 -0
  83. package/esm2015/lib/db/Models/transaction/transaction.js +4 -0
  84. package/esm2015/lib/db/Models/user/client-details.js +4 -0
  85. package/esm2015/lib/db/Models/user/client-income-types.js +4 -0
  86. package/esm2015/lib/db/Models/user/employee-details.js +4 -0
  87. package/esm2015/lib/db/Models/user/occupation.js +4 -0
  88. package/esm2015/lib/db/Models/user/registration-invite.js +4 -0
  89. package/esm2015/lib/db/Models/user/user-event-setting.js +4 -0
  90. package/esm2015/lib/db/Models/user/user-event-type-category.js +4 -0
  91. package/esm2015/lib/db/Models/user/user-event-type.js +4 -0
  92. package/esm2015/lib/db/Models/user/user-event.js +4 -0
  93. package/esm2015/lib/db/Models/user/user.js +4 -0
  94. package/esm2015/lib/db/Models/vehicle/vehicle-claim.js +4 -0
  95. package/esm2015/lib/db/Models/vehicle/vehicle-logbook.js +4 -0
  96. package/esm2015/lib/db/Models/vehicle/vehicle.js +4 -0
  97. package/esm2015/lib/interfaces/document.interface.js +1 -1
  98. package/esm2015/lib/models/bank/bank-account-property.js +2 -2
  99. package/esm2015/lib/models/bank/bank-account.js +3 -3
  100. package/esm2015/lib/models/bank/bank-connection.js +2 -2
  101. package/esm2015/lib/models/bank/bank-transaction.js +2 -2
  102. package/esm2015/lib/models/bank/bank.js +2 -2
  103. package/esm2015/lib/models/bank/basiq-job.js +2 -2
  104. package/esm2015/lib/models/borrowing-expense/borrowing-expense-loan.js +2 -2
  105. package/esm2015/lib/models/borrowing-expense/borrowing-expense.js +2 -2
  106. package/esm2015/lib/models/chart-accounts/chart-accounts-depreciation.js +2 -2
  107. package/esm2015/lib/models/chart-accounts/chart-accounts-heading.js +2 -2
  108. package/esm2015/lib/models/chart-accounts/chart-accounts-metadata.js +2 -2
  109. package/esm2015/lib/models/chart-accounts/chart-accounts-value.js +2 -2
  110. package/esm2015/lib/models/chart-accounts/chart-accounts.js +2 -2
  111. package/esm2015/lib/models/chat/chat.js +2 -2
  112. package/esm2015/lib/models/chat/message-document.js +2 -2
  113. package/esm2015/lib/models/chat/message.js +2 -2
  114. package/esm2015/lib/models/client/client-details.js +2 -2
  115. package/esm2015/lib/models/client/client-income-types.js +2 -2
  116. package/esm2015/lib/models/client/client-invite.js +2 -2
  117. package/esm2015/lib/models/client/client-movement.js +2 -2
  118. package/esm2015/lib/models/depreciation/depreciation-capital-project.js +2 -2
  119. package/esm2015/lib/models/depreciation/depreciation-forecast.js +2 -2
  120. package/esm2015/lib/models/depreciation/depreciation-receipt.js +2 -2
  121. package/esm2015/lib/models/depreciation/depreciation.js +2 -2
  122. package/esm2015/lib/models/document/document-folder.js +2 -2
  123. package/esm2015/lib/models/document/document.js +2 -2
  124. package/esm2015/lib/models/employee/employee-details.js +2 -2
  125. package/esm2015/lib/models/employee/employee-invite.js +2 -2
  126. package/esm2015/lib/models/firm/firm.js +2 -2
  127. package/esm2015/lib/models/income-source/income-source-forecast.js +2 -2
  128. package/esm2015/lib/models/income-source/income-source-type.js +2 -2
  129. package/esm2015/lib/models/income-source/income-source.js +2 -2
  130. package/esm2015/lib/models/income-source/salary-forecast.js +2 -2
  131. package/esm2015/lib/models/income-source/sole-forecast.js +2 -2
  132. package/esm2015/lib/models/loan/loan-payout.js +2 -2
  133. package/esm2015/lib/models/loan/loan.js +2 -2
  134. package/esm2015/lib/models/logbook/vehicle-claim.js +2 -2
  135. package/esm2015/lib/models/logbook/vehicle-logbook.js +2 -2
  136. package/esm2015/lib/models/logbook/vehicle.js +2 -2
  137. package/esm2015/lib/models/property/property-document.js +2 -2
  138. package/esm2015/lib/models/property/property.js +1 -1
  139. package/esm2015/lib/models/registration-invite/registration-invite.js +2 -2
  140. package/esm2015/lib/models/service-subscription/service-payment.js +2 -2
  141. package/esm2015/lib/models/service-subscription/service-price.js +2 -2
  142. package/esm2015/lib/models/service-subscription/service-product.js +14 -6
  143. package/esm2015/lib/models/service-subscription/service-subscription-item.js +12 -3
  144. package/esm2015/lib/models/service-subscription/service-subscription.js +29 -12
  145. package/esm2015/lib/models/tax-review/tax-review.js +2 -2
  146. package/esm2015/lib/models/tax-summary/report-item.js +1 -1
  147. package/esm2015/lib/models/transaction/transaction-allocation.js +2 -2
  148. package/esm2015/lib/models/transaction/transaction-metadata.js +2 -2
  149. package/esm2015/lib/models/transaction/transaction-receipt.js +2 -2
  150. package/esm2015/lib/models/transaction/transaction.js +2 -2
  151. package/esm2015/lib/models/user/occupation.js +2 -2
  152. package/esm2015/lib/models/user/user-roles.const.js +1 -2
  153. package/esm2015/lib/models/user/user.js +2 -2
  154. package/esm2015/lib/models/user-event/user-event-setting.js +2 -2
  155. package/esm2015/lib/models/user-event/user-event-type-category.js +2 -2
  156. package/esm2015/lib/models/user-event/user-event-type.js +2 -2
  157. package/esm2015/lib/services/http/bank/bank-account/bank-account.service.js +1 -1
  158. package/esm2015/lib/services/http/bank/bank-connection/bank-connection.service.js +1 -1
  159. package/esm2015/lib/services/http/bank/bank-transaction/bank-transaction.service.js +1 -1
  160. package/esm2015/lib/services/http/bank/bank.service.js +1 -1
  161. package/esm2015/lib/services/http/bank/basiq/basiq.service.js +1 -1
  162. package/esm2015/lib/services/http/chart-accounts/chart-accounts-depreciations/chart-accounts-depreciations.service.js +1 -1
  163. package/esm2015/lib/services/http/chart-accounts/chart-accounts.service.js +1 -1
  164. package/esm2015/lib/services/http/chat/chat.service.js +1 -1
  165. package/esm2015/lib/services/http/chat/message/message.service.js +1 -1
  166. package/esm2015/lib/services/http/chat/message-document/message-document.service.js +1 -1
  167. package/esm2015/lib/services/http/depreciation/depreciation-capital-project/depreciation-capital-project.service.js +1 -1
  168. package/esm2015/lib/services/http/depreciation/depreciation.service.js +1 -1
  169. package/esm2015/lib/services/http/document/document-folder/document-folder.service.js +1 -1
  170. package/esm2015/lib/services/http/firm/client-income/client-income-types.service.js +1 -1
  171. package/esm2015/lib/services/http/firm/client-invite/client-invite.service.js +1 -1
  172. package/esm2015/lib/services/http/firm/client-movement/client-movement.service.js +1 -1
  173. package/esm2015/lib/services/http/firm/employee/employee.service.js +1 -1
  174. package/esm2015/lib/services/http/firm/employee-invite/employee-invite.service.js +1 -1
  175. package/esm2015/lib/services/http/firm/firm.service.js +1 -1
  176. package/esm2015/lib/services/http/income-source/income-source-forecast/income-source-forecast.service.js +1 -1
  177. package/esm2015/lib/services/http/income-source/income-source.service.js +1 -1
  178. package/esm2015/lib/services/http/income-source/salary-forecast/salary-forecast.service.js +1 -1
  179. package/esm2015/lib/services/http/income-source/sole-forecast/sole-forecast.service.js +1 -1
  180. package/esm2015/lib/services/http/loan/loan.service.js +1 -1
  181. package/esm2015/lib/services/http/property/property-document/property-document.service.js +1 -1
  182. package/esm2015/lib/services/http/rest/rest.service.js +2 -2
  183. package/esm2015/lib/services/http/subscription/service-price.service.js +24 -0
  184. package/esm2015/lib/services/http/subscription/subscription.service.js +5 -48
  185. package/esm2015/lib/services/http/tax-review/tax-review-history/tax-review-history.service.js +1 -1
  186. package/esm2015/lib/services/http/tax-review/tax-review.service.js +1 -1
  187. package/esm2015/lib/services/http/transaction/transaction-allocation/transaction-allocation.service.js +2 -8
  188. package/esm2015/lib/services/http/transaction/transaction.service.js +1 -1
  189. package/esm2015/lib/services/http/user/user-event-setting/user-event-setting.service.js +1 -1
  190. package/esm2015/lib/services/http/user/user-event-type/user-event-type.service.js +1 -1
  191. package/esm2015/lib/services/http/user/user.service.js +1 -1
  192. package/esm2015/lib/services/http/vehicle/vehicle-claim.service.js +1 -1
  193. package/esm2015/lib/services/http/vehicle/vehicle-logbook.service.js +1 -1
  194. package/esm2015/lib/services/http/vehicle/vehicle.service.js +1 -1
  195. package/esm2015/public-api.js +9 -10
  196. package/fesm2015/taxtank-core.js +222 -216
  197. package/fesm2015/taxtank-core.js.map +1 -1
  198. package/lib/collections/collection.d.ts +14 -11
  199. package/lib/collections/income-source.collection.d.ts +0 -5
  200. package/lib/collections/{service-subscription.collection.d.ts → subscription/service-subscription.collection.d.ts} +2 -2
  201. package/lib/db/Enums/{service-payment-status.enum.d.ts → subscription/service-payment-status.enum.d.ts} +0 -0
  202. package/lib/db/Enums/subscription/service-price-list.enum.d.ts +3 -0
  203. package/lib/db/Enums/{service-price-recurring-interval.enum.d.ts → subscription/service-price-recurring-interval.enum.d.ts} +0 -0
  204. package/lib/db/Enums/{service-price-type.enum.d.ts → subscription/service-price-type.enum.d.ts} +0 -0
  205. package/lib/db/Enums/subscription/service-product-id.enum.d.ts +8 -0
  206. package/lib/db/Enums/subscription/service-product-status.enum.d.ts +4 -0
  207. package/lib/db/Enums/{service-subscription-status.enum.d.ts → subscription/service-subscription-status.enum.d.ts} +0 -0
  208. package/lib/db/Enums/user-roles.enum.d.ts +0 -1
  209. package/lib/db/Models/abstract-model.d.ts +3 -0
  210. package/lib/db/Models/address.d.ts +2 -1
  211. package/lib/db/Models/{bank-account-balance.d.ts → bank/bank-account-balance.d.ts} +2 -1
  212. package/lib/db/Models/bank/bank-account-property.d.ts +9 -0
  213. package/lib/db/Models/{bank-account.d.ts → bank/bank-account.d.ts} +6 -5
  214. package/lib/db/Models/{bank-connection.d.ts → bank/bank-connection.d.ts} +4 -3
  215. package/lib/db/Models/{bank-transaction-import.d.ts → bank/bank-transaction-import.d.ts} +2 -1
  216. package/lib/db/Models/{bank-transaction.d.ts → bank/bank-transaction.d.ts} +4 -3
  217. package/lib/db/Models/{bank.d.ts → bank/bank.d.ts} +2 -1
  218. package/lib/db/Models/{basiq-job.d.ts → bank/basiq-job.d.ts} +2 -1
  219. package/lib/db/Models/{financial-data-system.d.ts → bank/financial-data-system.d.ts} +2 -1
  220. package/lib/db/Models/{chart-accounts-depreciation.d.ts → chart-accounts/chart-accounts-depreciation.d.ts} +2 -1
  221. package/lib/db/Models/{chart-accounts-heading.d.ts → chart-accounts/chart-accounts-heading.d.ts} +2 -1
  222. package/lib/db/Models/chart-accounts/chart-accounts-metadata.d.ts +12 -0
  223. package/lib/db/Models/{chart-accounts-value.d.ts → chart-accounts/chart-accounts-value.d.ts} +2 -1
  224. package/lib/db/Models/{chart-accounts.d.ts → chart-accounts/chart-accounts.d.ts} +5 -4
  225. package/lib/db/Models/country.d.ts +2 -1
  226. package/lib/db/Models/depreciation/depreciation-capital-project.d.ts +14 -0
  227. package/lib/db/Models/{depreciation-forecast.d.ts → depreciation/depreciation-forecast.d.ts} +3 -2
  228. package/lib/db/Models/{depreciation-receipt.d.ts → depreciation/depreciation-receipt.d.ts} +2 -1
  229. package/lib/db/Models/{depreciation.d.ts → depreciation/depreciation.d.ts} +9 -9
  230. package/lib/db/Models/{document-folder.d.ts → document/document-folder.d.ts} +3 -2
  231. package/lib/db/Models/{document.d.ts → document/document.d.ts} +2 -1
  232. package/lib/db/Models/document/property-document.d.ts +18 -0
  233. package/lib/db/Models/firm/accountant/tax-review.d.ts +14 -0
  234. package/lib/db/Models/firm/accountant/ticket.d.ts +20 -0
  235. package/lib/db/Models/{chat.d.ts → firm/chat.d.ts} +4 -3
  236. package/lib/db/Models/firm/client-invite.d.ts +17 -0
  237. package/lib/db/Models/firm/client-movement.d.ts +13 -0
  238. package/lib/db/Models/firm/employee-invite.d.ts +10 -0
  239. package/lib/db/Models/{firm.d.ts → firm/firm.d.ts} +7 -6
  240. package/lib/db/Models/{message-document.d.ts → firm/message-document.d.ts} +3 -2
  241. package/lib/db/Models/{message.d.ts → firm/message.d.ts} +4 -3
  242. package/lib/db/Models/{income-source-forecast.d.ts → incomeSource/income-source-forecast.d.ts} +2 -1
  243. package/lib/db/Models/{income-source-type.d.ts → incomeSource/income-source-type.d.ts} +3 -2
  244. package/lib/db/Models/{income-source.d.ts → incomeSource/income-source.d.ts} +5 -4
  245. package/lib/db/Models/{salary-forecast.d.ts → incomeSource/salary-forecast.d.ts} +3 -2
  246. package/lib/db/Models/{borrowing-expense-loan.d.ts → loan/borrowing-expense-loan.d.ts} +3 -2
  247. package/lib/db/Models/loan/borrowing-expense.d.ts +8 -0
  248. package/lib/db/Models/{loan-payout.d.ts → loan/loan-payout.d.ts} +3 -2
  249. package/lib/db/Models/{loan.d.ts → loan/loan.d.ts} +9 -8
  250. package/lib/db/Models/phone.d.ts +2 -1
  251. package/lib/db/Models/property/property-category-movement.d.ts +3 -2
  252. package/lib/db/Models/property/property-category.d.ts +3 -2
  253. package/lib/db/Models/property/property-forecast.d.ts +2 -1
  254. package/lib/db/Models/property/property-sale/property-sale-tax-exemption-metadata.d.ts +2 -1
  255. package/lib/db/Models/property/property-sale/property-sale.d.ts +2 -1
  256. package/lib/db/Models/property/property-sale/tax-exemption-metadata.d.ts +2 -1
  257. package/lib/db/Models/property/property-sale/tax-exemption.d.ts +2 -1
  258. package/lib/db/Models/property/property-share.d.ts +4 -3
  259. package/lib/db/Models/property/property-subscription.d.ts +3 -2
  260. package/lib/db/Models/property/property-valuation.d.ts +3 -2
  261. package/lib/db/Models/property/property.d.ts +6 -5
  262. package/lib/db/Models/service-notification.d.ts +4 -3
  263. package/lib/db/Models/sole/sole-forecast.d.ts +9 -0
  264. package/lib/db/Models/{service-payment.d.ts → subscription/service-payment.d.ts} +3 -2
  265. package/lib/db/Models/{service-price.d.ts → subscription/service-price.d.ts} +4 -3
  266. package/lib/db/Models/subscription/service-product.d.ts +19 -0
  267. package/lib/db/Models/{service-subscription-item.d.ts → subscription/service-subscription-item.d.ts} +2 -1
  268. package/lib/db/Models/{service-subscription.d.ts → subscription/service-subscription.d.ts} +4 -3
  269. package/lib/db/Models/{tax-return-category.d.ts → tax-return/tax-return-category.d.ts} +3 -2
  270. package/lib/db/Models/{tax-return-item.d.ts → tax-return/tax-return-item.d.ts} +2 -1
  271. package/lib/db/Models/{tax-return.d.ts → tax-return/tax-return.d.ts} +2 -1
  272. package/lib/db/Models/transaction/transaction-allocation.d.ts +9 -0
  273. package/lib/db/Models/{transaction-base.d.ts → transaction/transaction-base.d.ts} +4 -3
  274. package/lib/db/Models/{transaction-metadata.d.ts → transaction/transaction-metadata.d.ts} +3 -2
  275. package/lib/db/Models/{transaction-receipt.d.ts → transaction/transaction-receipt.d.ts} +2 -1
  276. package/lib/db/Models/{transaction.d.ts → transaction/transaction.d.ts} +9 -9
  277. package/lib/db/Models/{client-details.d.ts → user/client-details.d.ts} +7 -6
  278. package/lib/db/Models/{client-income-types.d.ts → user/client-income-types.d.ts} +2 -1
  279. package/lib/db/Models/user/employee-details.d.ts +8 -0
  280. package/lib/db/Models/user/occupation.d.ts +6 -0
  281. package/lib/db/Models/{registration-invite.d.ts → user/registration-invite.d.ts} +3 -2
  282. package/lib/db/Models/{user-event-setting.d.ts → user/user-event-setting.d.ts} +2 -1
  283. package/lib/db/Models/user/user-event-type-category.d.ts +5 -0
  284. package/lib/db/Models/{user-event-type.d.ts → user/user-event-type.d.ts} +3 -2
  285. package/lib/db/Models/{user-event.d.ts → user/user-event.d.ts} +3 -2
  286. package/lib/db/Models/{user.d.ts → user/user.d.ts} +14 -13
  287. package/lib/db/Models/vehicle/vehicle-claim.d.ts +14 -0
  288. package/lib/db/Models/{vehicle-logbook.d.ts → vehicle/vehicle-logbook.d.ts} +4 -3
  289. package/lib/db/Models/vehicle/vehicle.d.ts +11 -0
  290. package/lib/models/bank/bank-account-property.d.ts +1 -1
  291. package/lib/models/bank/bank-account.d.ts +2 -2
  292. package/lib/models/bank/bank-connection.d.ts +1 -1
  293. package/lib/models/bank/bank-transaction.d.ts +1 -1
  294. package/lib/models/bank/bank.d.ts +1 -1
  295. package/lib/models/bank/basiq-job.d.ts +1 -1
  296. package/lib/models/borrowing-expense/borrowing-expense-loan.d.ts +1 -1
  297. package/lib/models/borrowing-expense/borrowing-expense.d.ts +1 -1
  298. package/lib/models/chart-accounts/chart-accounts-depreciation.d.ts +1 -1
  299. package/lib/models/chart-accounts/chart-accounts-heading.d.ts +1 -1
  300. package/lib/models/chart-accounts/chart-accounts-metadata.d.ts +1 -1
  301. package/lib/models/chart-accounts/chart-accounts-value.d.ts +1 -1
  302. package/lib/models/chart-accounts/chart-accounts.d.ts +1 -1
  303. package/lib/models/chat/chat.d.ts +1 -1
  304. package/lib/models/chat/message-document.d.ts +1 -1
  305. package/lib/models/chat/message.d.ts +1 -1
  306. package/lib/models/client/client-details.d.ts +1 -1
  307. package/lib/models/client/client-income-types.d.ts +1 -1
  308. package/lib/models/client/client-invite.d.ts +1 -1
  309. package/lib/models/client/client-movement.d.ts +1 -1
  310. package/lib/models/depreciation/depreciation-capital-project.d.ts +1 -1
  311. package/lib/models/depreciation/depreciation-forecast.d.ts +1 -1
  312. package/lib/models/depreciation/depreciation-receipt.d.ts +1 -1
  313. package/lib/models/depreciation/depreciation.d.ts +3 -3
  314. package/lib/models/document/document-folder.d.ts +1 -1
  315. package/lib/models/document/document.d.ts +1 -1
  316. package/lib/models/employee/employee-details.d.ts +1 -1
  317. package/lib/models/employee/employee-invite.d.ts +1 -1
  318. package/lib/models/firm/firm.d.ts +1 -1
  319. package/lib/models/income-source/income-source-forecast.d.ts +1 -1
  320. package/lib/models/income-source/income-source-type.d.ts +1 -1
  321. package/lib/models/income-source/income-source.d.ts +1 -1
  322. package/lib/models/income-source/salary-forecast.d.ts +1 -1
  323. package/lib/models/income-source/sole-forecast.d.ts +1 -1
  324. package/lib/models/loan/loan-payout.d.ts +1 -1
  325. package/lib/models/loan/loan.d.ts +1 -1
  326. package/lib/models/logbook/vehicle-claim.d.ts +1 -1
  327. package/lib/models/logbook/vehicle-logbook.d.ts +1 -1
  328. package/lib/models/logbook/vehicle.d.ts +1 -1
  329. package/lib/models/property/property-document.d.ts +1 -1
  330. package/lib/models/property/property.d.ts +0 -2
  331. package/lib/models/registration-invite/registration-invite.d.ts +1 -1
  332. package/lib/models/service-subscription/service-payment.d.ts +1 -1
  333. package/lib/models/service-subscription/service-price.d.ts +1 -1
  334. package/lib/models/service-subscription/service-product.d.ts +5 -3
  335. package/lib/models/service-subscription/service-subscription-item.d.ts +1 -1
  336. package/lib/models/service-subscription/service-subscription.d.ts +13 -3
  337. package/lib/models/tax-review/tax-review.d.ts +1 -1
  338. package/lib/models/tax-summary/report-item.d.ts +1 -1
  339. package/lib/models/transaction/transaction-allocation.d.ts +1 -1
  340. package/lib/models/transaction/transaction-metadata.d.ts +1 -1
  341. package/lib/models/transaction/transaction-receipt.d.ts +1 -1
  342. package/lib/models/transaction/transaction.d.ts +1 -1
  343. package/lib/models/user/occupation.d.ts +1 -1
  344. package/lib/models/user/user.d.ts +1 -1
  345. package/lib/models/user-event/user-event-setting.d.ts +1 -1
  346. package/lib/models/user-event/user-event-type-category.d.ts +1 -1
  347. package/lib/models/user-event/user-event-type.d.ts +1 -1
  348. package/lib/services/http/bank/bank-account/bank-account.service.d.ts +1 -1
  349. package/lib/services/http/bank/bank-connection/bank-connection.service.d.ts +1 -1
  350. package/lib/services/http/bank/bank-transaction/bank-transaction.service.d.ts +1 -1
  351. package/lib/services/http/bank/bank.service.d.ts +1 -1
  352. package/lib/services/http/bank/basiq/basiq.service.d.ts +1 -1
  353. package/lib/services/http/chart-accounts/chart-accounts-depreciations/chart-accounts-depreciations.service.d.ts +1 -1
  354. package/lib/services/http/chat/chat.service.d.ts +1 -1
  355. package/lib/services/http/chat/message/message.service.d.ts +1 -1
  356. package/lib/services/http/depreciation/depreciation.service.d.ts +1 -1
  357. package/lib/services/http/document/document-folder/document-folder.service.d.ts +1 -1
  358. package/lib/services/http/firm/client-invite/client-invite.service.d.ts +1 -1
  359. package/lib/services/http/firm/client-movement/client-movement.service.d.ts +1 -1
  360. package/lib/services/http/firm/employee/employee.service.d.ts +1 -1
  361. package/lib/services/http/firm/employee-invite/employee-invite.service.d.ts +1 -1
  362. package/lib/services/http/income-source/income-source-forecast/income-source-forecast.service.d.ts +1 -1
  363. package/lib/services/http/income-source/income-source.service.d.ts +1 -1
  364. package/lib/services/http/income-source/salary-forecast/salary-forecast.service.d.ts +1 -1
  365. package/lib/services/http/income-source/sole-forecast/sole-forecast.service.d.ts +1 -1
  366. package/lib/services/http/loan/loan.service.d.ts +1 -1
  367. package/lib/services/http/property/property-document/property-document.service.d.ts +1 -1
  368. package/lib/services/http/rest/rest.service.d.ts +1 -1
  369. package/lib/services/http/subscription/service-price.service.d.ts +14 -0
  370. package/lib/services/http/subscription/subscription.service.d.ts +2 -9
  371. package/lib/services/http/tax-review/tax-review-history/tax-review-history.service.d.ts +1 -1
  372. package/lib/services/http/tax-review/tax-review.service.d.ts +1 -1
  373. package/lib/services/http/transaction/transaction-allocation/transaction-allocation.service.d.ts +1 -1
  374. package/lib/services/http/transaction/transaction.service.d.ts +1 -1
  375. package/lib/services/http/user/user-event-setting/user-event-setting.service.d.ts +1 -1
  376. package/lib/services/http/user/user-event-type/user-event-type.service.d.ts +1 -1
  377. package/lib/services/http/vehicle/vehicle-claim.service.d.ts +1 -1
  378. package/lib/services/http/vehicle/vehicle.service.d.ts +1 -1
  379. package/package.json +1 -1
  380. package/public-api.d.ts +8 -9
  381. package/esm2015/lib/collections/report/vehicle-expense/vehicle-expense.collection.js +0 -20
  382. package/esm2015/lib/collections/service-price.collection.js +0 -10
  383. package/esm2015/lib/collections/service-subscription.collection.js +0 -17
  384. package/esm2015/lib/db/Enums/service-payment-status.enum.js +0 -6
  385. package/esm2015/lib/db/Enums/service-price-type.enum.js +0 -6
  386. package/esm2015/lib/db/Models/bank-account-balance.js +0 -3
  387. package/esm2015/lib/db/Models/bank-account-property.js +0 -3
  388. package/esm2015/lib/db/Models/bank-account.js +0 -3
  389. package/esm2015/lib/db/Models/bank-connection.js +0 -3
  390. package/esm2015/lib/db/Models/bank-transaction-import.js +0 -3
  391. package/esm2015/lib/db/Models/bank-transaction.js +0 -3
  392. package/esm2015/lib/db/Models/bank.js +0 -3
  393. package/esm2015/lib/db/Models/basiq-job.js +0 -3
  394. package/esm2015/lib/db/Models/borrowing-expense-loan.js +0 -3
  395. package/esm2015/lib/db/Models/borrowing-expense.js +0 -3
  396. package/esm2015/lib/db/Models/chart-accounts-depreciation.js +0 -3
  397. package/esm2015/lib/db/Models/chart-accounts-heading.js +0 -3
  398. package/esm2015/lib/db/Models/chart-accounts-metadata.js +0 -3
  399. package/esm2015/lib/db/Models/chart-accounts-value.js +0 -3
  400. package/esm2015/lib/db/Models/chart-accounts.js +0 -3
  401. package/esm2015/lib/db/Models/chat.js +0 -3
  402. package/esm2015/lib/db/Models/client-details.js +0 -3
  403. package/esm2015/lib/db/Models/client-income-types.js +0 -3
  404. package/esm2015/lib/db/Models/client-invite.js +0 -3
  405. package/esm2015/lib/db/Models/client-movement.js +0 -3
  406. package/esm2015/lib/db/Models/depreciation-capital-project.js +0 -3
  407. package/esm2015/lib/db/Models/depreciation-forecast.js +0 -3
  408. package/esm2015/lib/db/Models/depreciation-receipt.js +0 -3
  409. package/esm2015/lib/db/Models/depreciation.js +0 -4
  410. package/esm2015/lib/db/Models/document-folder.js +0 -3
  411. package/esm2015/lib/db/Models/document.js +0 -3
  412. package/esm2015/lib/db/Models/employee-details.js +0 -3
  413. package/esm2015/lib/db/Models/employee-invite.js +0 -3
  414. package/esm2015/lib/db/Models/financial-data-system.js +0 -3
  415. package/esm2015/lib/db/Models/firm.js +0 -3
  416. package/esm2015/lib/db/Models/income-source-forecast.js +0 -3
  417. package/esm2015/lib/db/Models/income-source-type.js +0 -3
  418. package/esm2015/lib/db/Models/income-source.js +0 -3
  419. package/esm2015/lib/db/Models/loan-payout.js +0 -3
  420. package/esm2015/lib/db/Models/loan.js +0 -3
  421. package/esm2015/lib/db/Models/message-document.js +0 -3
  422. package/esm2015/lib/db/Models/message.js +0 -3
  423. package/esm2015/lib/db/Models/occupation.js +0 -3
  424. package/esm2015/lib/db/Models/property/property-document.js +0 -3
  425. package/esm2015/lib/db/Models/registration-invite.js +0 -3
  426. package/esm2015/lib/db/Models/salary-forecast.js +0 -3
  427. package/esm2015/lib/db/Models/service-payment.js +0 -3
  428. package/esm2015/lib/db/Models/service-price.js +0 -3
  429. package/esm2015/lib/db/Models/service-product.js +0 -3
  430. package/esm2015/lib/db/Models/service-subscription-item.js +0 -3
  431. package/esm2015/lib/db/Models/service-subscription.js +0 -3
  432. package/esm2015/lib/db/Models/sole-forecast.js +0 -3
  433. package/esm2015/lib/db/Models/tax-return-category.js +0 -3
  434. package/esm2015/lib/db/Models/tax-return-item.js +0 -3
  435. package/esm2015/lib/db/Models/tax-return.js +0 -3
  436. package/esm2015/lib/db/Models/tax-review.js +0 -3
  437. package/esm2015/lib/db/Models/ticket.js +0 -3
  438. package/esm2015/lib/db/Models/transaction-allocation.js +0 -3
  439. package/esm2015/lib/db/Models/transaction-base.js +0 -25
  440. package/esm2015/lib/db/Models/transaction-metadata.js +0 -3
  441. package/esm2015/lib/db/Models/transaction-receipt.js +0 -3
  442. package/esm2015/lib/db/Models/transaction.js +0 -4
  443. package/esm2015/lib/db/Models/user-event-setting.js +0 -3
  444. package/esm2015/lib/db/Models/user-event-type-category.js +0 -3
  445. package/esm2015/lib/db/Models/user-event-type.js +0 -3
  446. package/esm2015/lib/db/Models/user-event.js +0 -3
  447. package/esm2015/lib/db/Models/user.js +0 -3
  448. package/esm2015/lib/db/Models/vehicle-claim.js +0 -3
  449. package/esm2015/lib/db/Models/vehicle-logbook.js +0 -3
  450. package/esm2015/lib/db/Models/vehicle.js +0 -3
  451. package/esm2015/lib/models/report/vehicle-expense/vehicle-expense.js +0 -14
  452. package/lib/collections/report/vehicle-expense/vehicle-expense.collection.d.ts +0 -9
  453. package/lib/collections/service-price.collection.d.ts +0 -6
  454. package/lib/db/Models/bank-account-property.d.ts +0 -8
  455. package/lib/db/Models/borrowing-expense.d.ts +0 -7
  456. package/lib/db/Models/chart-accounts-metadata.d.ts +0 -11
  457. package/lib/db/Models/client-invite.d.ts +0 -16
  458. package/lib/db/Models/client-movement.d.ts +0 -12
  459. package/lib/db/Models/depreciation-capital-project.d.ts +0 -13
  460. package/lib/db/Models/employee-details.d.ts +0 -7
  461. package/lib/db/Models/employee-invite.d.ts +0 -9
  462. package/lib/db/Models/occupation.d.ts +0 -5
  463. package/lib/db/Models/property/property-document.d.ts +0 -13
  464. package/lib/db/Models/service-product.d.ts +0 -12
  465. package/lib/db/Models/sole-forecast.d.ts +0 -8
  466. package/lib/db/Models/tax-review.d.ts +0 -13
  467. package/lib/db/Models/ticket.d.ts +0 -19
  468. package/lib/db/Models/transaction-allocation.d.ts +0 -8
  469. package/lib/db/Models/user-event-type-category.d.ts +0 -4
  470. package/lib/db/Models/vehicle-claim.d.ts +0 -13
  471. package/lib/db/Models/vehicle.d.ts +0 -10
  472. package/lib/models/report/vehicle-expense/vehicle-expense.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
  */
@@ -1340,25 +1370,11 @@
1340
1370
  /**
1341
1371
  * Sort collection items by provided field
1342
1372
  */
1343
- Collection.prototype.sortBy = function (field, isDesc) {
1344
- if (field === void 0) { field = 'id'; }
1373
+ Collection.prototype.sortBy = function (filed, isDesc) {
1374
+ if (filed === void 0) { filed = 'id'; }
1345
1375
  if (isDesc === void 0) { isDesc = true; }
1346
- sort(this.items, field, isDesc);
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) {
@@ -2999,21 +3038,24 @@
2999
3038
  UserRolesEnum["SUBSCRIPTION"] = "ROLE_USER_SUBSCRIPTION";
3000
3039
  UserRolesEnum["WORK_TANK"] = "ROLE_USER_WORK";
3001
3040
  UserRolesEnum["PROPERTY_TANK"] = "ROLE_USER_PROPERTY";
3002
- UserRolesEnum["SOLE_TANK"] = "ROLE_USER_SOLE";
3003
3041
  UserRolesEnum["SWITCH_USER"] = "ROLE_PREVIOUS_ADMIN";
3004
3042
  })(exports.UserRolesEnum || (exports.UserRolesEnum = {}));
3005
3043
 
3006
- var Address$1 = /** @class */ (function () {
3044
+ var Address$1 = /** @class */ (function (_super) {
3045
+ __extends(Address, _super);
3007
3046
  function Address() {
3047
+ return _super !== null && _super.apply(this, arguments) || this;
3008
3048
  }
3009
3049
  return Address;
3010
- }());
3050
+ }(AbstractModel));
3011
3051
 
3012
- var Country$1 = /** @class */ (function () {
3052
+ var Country$1 = /** @class */ (function (_super) {
3053
+ __extends(Country, _super);
3013
3054
  function Country() {
3055
+ return _super !== null && _super.apply(this, arguments) || this;
3014
3056
  }
3015
3057
  return Country;
3016
- }());
3058
+ }(AbstractModel));
3017
3059
 
3018
3060
  var Country = /** @class */ (function (_super) {
3019
3061
  __extends(Country, _super);
@@ -3082,11 +3124,13 @@
3082
3124
  _a$4[exports.UserRolesEnum.FIRM_OWNER] = 'Firm Owner',
3083
3125
  _a$4);
3084
3126
 
3085
- var ClientDetails$1 = /** @class */ (function () {
3127
+ var ClientDetails$1 = /** @class */ (function (_super) {
3128
+ __extends(ClientDetails, _super);
3086
3129
  function ClientDetails() {
3130
+ return _super !== null && _super.apply(this, arguments) || this;
3087
3131
  }
3088
3132
  return ClientDetails;
3089
- }());
3133
+ }(AbstractModel));
3090
3134
 
3091
3135
  var ClientDetails = /** @class */ (function (_super) {
3092
3136
  __extends(ClientDetails, _super);
@@ -3096,23 +3140,29 @@
3096
3140
  return ClientDetails;
3097
3141
  }(ClientDetails$1));
3098
3142
 
3099
- var EmployeeDetails$1 = /** @class */ (function () {
3143
+ var EmployeeDetails$1 = /** @class */ (function (_super) {
3144
+ __extends(EmployeeDetails, _super);
3100
3145
  function EmployeeDetails() {
3146
+ return _super !== null && _super.apply(this, arguments) || this;
3101
3147
  }
3102
3148
  return EmployeeDetails;
3103
- }());
3149
+ }(AbstractModel));
3104
3150
 
3105
- var Firm$1 = /** @class */ (function () {
3151
+ var Firm$1 = /** @class */ (function (_super) {
3152
+ __extends(Firm, _super);
3106
3153
  function Firm() {
3154
+ return _super !== null && _super.apply(this, arguments) || this;
3107
3155
  }
3108
3156
  return Firm;
3109
- }());
3157
+ }(AbstractModel));
3110
3158
 
3111
- var Phone$1 = /** @class */ (function () {
3159
+ var Phone$1 = /** @class */ (function (_super) {
3160
+ __extends(Phone, _super);
3112
3161
  function Phone() {
3162
+ return _super !== null && _super.apply(this, arguments) || this;
3113
3163
  }
3114
3164
  return Phone;
3115
- }());
3165
+ }(AbstractModel));
3116
3166
 
3117
3167
  exports.PhoneTypeEnum = void 0;
3118
3168
  (function (PhoneTypeEnum) {
@@ -3173,40 +3223,70 @@
3173
3223
  classTransformer.Type(function () { return Firm; })
3174
3224
  ], EmployeeDetails.prototype, "firm", void 0);
3175
3225
 
3176
- var ServiceSubscription$1 = /** @class */ (function () {
3226
+ var ServiceSubscription$1 = /** @class */ (function (_super) {
3227
+ __extends(ServiceSubscription, _super);
3177
3228
  function ServiceSubscription() {
3229
+ return _super !== null && _super.apply(this, arguments) || this;
3178
3230
  }
3179
3231
  return ServiceSubscription;
3180
- }());
3232
+ }(AbstractModel));
3181
3233
 
3182
- var ServiceSubscriptionItem$1 = /** @class */ (function () {
3234
+ var ServiceSubscriptionItem$1 = /** @class */ (function (_super) {
3235
+ __extends(ServiceSubscriptionItem, _super);
3183
3236
  function ServiceSubscriptionItem() {
3237
+ return _super !== null && _super.apply(this, arguments) || this;
3184
3238
  }
3185
3239
  return ServiceSubscriptionItem;
3186
- }());
3240
+ }(AbstractModel));
3187
3241
 
3188
- var ServicePrice$1 = /** @class */ (function () {
3242
+ var ServicePrice$1 = /** @class */ (function (_super) {
3243
+ __extends(ServicePrice, _super);
3189
3244
  function ServicePrice() {
3245
+ return _super !== null && _super.apply(this, arguments) || this;
3190
3246
  }
3191
3247
  return ServicePrice;
3192
- }());
3248
+ }(AbstractModel));
3193
3249
 
3194
- var ServiceProduct$1 = /** @class */ (function () {
3250
+ var ServiceProduct$1 = /** @class */ (function (_super) {
3251
+ __extends(ServiceProduct, _super);
3195
3252
  function ServiceProduct() {
3253
+ return _super !== null && _super.apply(this, arguments) || this;
3196
3254
  }
3197
3255
  return ServiceProduct;
3198
- }());
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 = {}));
3199
3273
 
3200
3274
  var ServiceProduct = /** @class */ (function (_super) {
3201
3275
  __extends(ServiceProduct, _super);
3202
3276
  function ServiceProduct() {
3203
3277
  return _super !== null && _super.apply(this, arguments) || this;
3204
3278
  }
3205
- ServiceProduct.prototype.isProperty = function () {
3206
- 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);
3207
3284
  };
3208
- ServiceProduct.prototype.isWork = function () {
3209
- return this.title === 'Work Tank';
3285
+ ServiceProduct.prototype.isSoleTank = function () {
3286
+ return this.id === ServiceProductIdEnum.SOLE_TANK;
3287
+ };
3288
+ ServiceProduct.prototype.isArchived = function () {
3289
+ return this.status === exports.ServiceProductStatusEnum.ARCHIVED;
3210
3290
  };
3211
3291
  return ServiceProduct;
3212
3292
  }(ServiceProduct$1));
@@ -3222,6 +3302,15 @@
3222
3302
  classTransformer.Type(function () { return ServiceProduct; })
3223
3303
  ], ServicePrice.prototype, "product", void 0);
3224
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;
3225
3314
  var ServiceSubscriptionItem = /** @class */ (function (_super) {
3226
3315
  __extends(ServiceSubscriptionItem, _super);
3227
3316
  function ServiceSubscriptionItem() {
@@ -3229,7 +3318,11 @@
3229
3318
  }
3230
3319
  Object.defineProperty(ServiceSubscriptionItem.prototype, "total", {
3231
3320
  get: function () {
3232
- 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;
3233
3326
  },
3234
3327
  enumerable: false,
3235
3328
  configurable: true
@@ -3289,7 +3382,7 @@
3289
3382
  });
3290
3383
  Object.defineProperty(ServiceSubscription.prototype, "propertyQuantity", {
3291
3384
  get: function () {
3292
- return this.propertyTankItem ? this.propertyTankItem.quantity : 0;
3385
+ return this.propertiesItem ? this.propertiesItem.quantity : 0;
3293
3386
  },
3294
3387
  enumerable: false,
3295
3388
  configurable: true
@@ -3300,7 +3393,7 @@
3300
3393
  */
3301
3394
  get: function () {
3302
3395
  var workTankProduct = this.items.find(function (item) {
3303
- return item.price.product.isWork();
3396
+ return item.price.product.isWorkTank();
3304
3397
  });
3305
3398
  if (!this.workTankItem || !this.isActive) {
3306
3399
  return exports.SubscriptionTypeEnum.WITHOUT_SUBSCRIPTION;
@@ -3309,9 +3402,9 @@
3309
3402
  return exports.SubscriptionTypeEnum.INDIVIDUAL;
3310
3403
  }
3311
3404
  var propertyTankProduct = this.items.find(function (item) {
3312
- return item.price.product.isProperty();
3405
+ return item.price.product.isProperties();
3313
3406
  });
3314
- if (!!this.propertyTankItem && propertyTankProduct.quantity === PROPERTY_INVESTOR_MAX_PROPERTIES) {
3407
+ if (!!this.propertiesItem && propertyTankProduct.quantity === PROPERTY_INVESTOR_MAX_PROPERTIES) {
3315
3408
  return exports.SubscriptionTypeEnum.INVESTOR;
3316
3409
  }
3317
3410
  return exports.SubscriptionTypeEnum.INVESTOR_PLUS;
@@ -3339,20 +3432,6 @@
3339
3432
  enumerable: false,
3340
3433
  configurable: true
3341
3434
  });
3342
- Object.defineProperty(ServiceSubscription.prototype, "workTankItem", {
3343
- get: function () {
3344
- return this.items.find(function (item) { return item.price.product.isWork(); });
3345
- },
3346
- enumerable: false,
3347
- configurable: true
3348
- });
3349
- Object.defineProperty(ServiceSubscription.prototype, "propertyTankItem", {
3350
- get: function () {
3351
- return this.items.find(function (item) { return item.price.product.isProperty(); });
3352
- },
3353
- enumerable: false,
3354
- configurable: true
3355
- });
3356
3435
  Object.defineProperty(ServiceSubscription.prototype, "isActive", {
3357
3436
  /**
3358
3437
  * This check on getIsActive need for firm. Accountant has a endDate, but user has not endDate
@@ -3405,6 +3484,33 @@
3405
3484
  ServiceSubscription.prototype.isTrialExpiring = function () {
3406
3485
  return this.daysRemain > 0 && this.daysRemain <= this.lastTrialDays;
3407
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
+ });
3408
3514
  ServiceSubscription.prototype.hasPropertyTank = function () {
3409
3515
  return !!this.items.find(function (subscriptionItem) {
3410
3516
  return subscriptionItem.price.product.role.includes(exports.UserRolesEnum.PROPERTY_TANK);
@@ -3415,6 +3521,14 @@
3415
3521
  return subscriptionItem.price.product.role.includes(exports.UserRolesEnum.WORK_TANK);
3416
3522
  });
3417
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
+ };
3418
3532
  return ServiceSubscription;
3419
3533
  }(ServiceSubscription$1));
3420
3534
  __decorate([
@@ -3589,11 +3703,13 @@
3589
3703
  classTransformer.Type(function () { return User; })
3590
3704
  ], PropertySubscription.prototype, "user", void 0);
3591
3705
 
3592
- var PropertyCategory$1 = /** @class */ (function () {
3706
+ var PropertyCategory$1 = /** @class */ (function (_super) {
3707
+ __extends(PropertyCategory, _super);
3593
3708
  function PropertyCategory() {
3709
+ return _super !== null && _super.apply(this, arguments) || this;
3594
3710
  }
3595
3711
  return PropertyCategory;
3596
- }());
3712
+ }(AbstractModel));
3597
3713
 
3598
3714
  var PropertyCategory = /** @class */ (function (_super) {
3599
3715
  __extends(PropertyCategory, _super);
@@ -3610,17 +3726,27 @@
3610
3726
  return PropertyCategory;
3611
3727
  }(PropertyCategory$1));
3612
3728
 
3613
- var PropertyValuation$1 = /** @class */ (function () {
3729
+ var PropertyValuation$1 = /** @class */ (function (_super) {
3730
+ __extends(PropertyValuation, _super);
3614
3731
  function PropertyValuation() {
3732
+ return _super !== null && _super.apply(this, arguments) || this;
3615
3733
  }
3616
3734
  return PropertyValuation;
3617
- }());
3735
+ }(AbstractModel));
3618
3736
 
3619
- var PropertyDocument$1 = /** @class */ (function () {
3737
+ var PropertyDocument$1 = /** @class */ (function (_super) {
3738
+ __extends(PropertyDocument, _super);
3620
3739
  function PropertyDocument() {
3740
+ return _super !== null && _super.apply(this, arguments) || this;
3621
3741
  }
3742
+ PropertyDocument.prototype.getApiUrlPrefix = function () {
3743
+ return '';
3744
+ };
3745
+ PropertyDocument.prototype.getEntity = function () {
3746
+ return undefined;
3747
+ };
3622
3748
  return PropertyDocument;
3623
- }());
3749
+ }(AbstractModel));
3624
3750
 
3625
3751
  // @TODO this enum should come from backend
3626
3752
  /**
@@ -3689,11 +3815,13 @@
3689
3815
  classTransformer.Exclude()
3690
3816
  ], PropertyValuation.prototype, "documentFile", void 0);
3691
3817
 
3692
- var PropertyForecast$1 = /** @class */ (function () {
3818
+ var PropertyForecast$1 = /** @class */ (function (_super) {
3819
+ __extends(PropertyForecast, _super);
3693
3820
  function PropertyForecast() {
3821
+ return _super !== null && _super.apply(this, arguments) || this;
3694
3822
  }
3695
3823
  return PropertyForecast;
3696
- }());
3824
+ }(AbstractModel));
3697
3825
 
3698
3826
  var PropertyForecast = /** @class */ (function (_super) {
3699
3827
  __extends(PropertyForecast, _super);
@@ -3778,11 +3906,13 @@
3778
3906
  })
3779
3907
  ], PropertyForecast.prototype, "marketValue", void 0);
3780
3908
 
3781
- var PropertyCategoryMovement$1 = /** @class */ (function () {
3909
+ var PropertyCategoryMovement$1 = /** @class */ (function (_super) {
3910
+ __extends(PropertyCategoryMovement, _super);
3782
3911
  function PropertyCategoryMovement() {
3912
+ return _super !== null && _super.apply(this, arguments) || this;
3783
3913
  }
3784
3914
  return PropertyCategoryMovement;
3785
- }());
3915
+ }(AbstractModel));
3786
3916
 
3787
3917
  var PropertyCategoryMovement = /** @class */ (function (_super) {
3788
3918
  __extends(PropertyCategoryMovement, _super);
@@ -4127,11 +4257,13 @@
4127
4257
  classTransformer.Exclude()
4128
4258
  ], Property.prototype, "documentFile", void 0);
4129
4259
 
4130
- var TransactionReceipt$1 = /** @class */ (function () {
4260
+ var TransactionReceipt$1 = /** @class */ (function (_super) {
4261
+ __extends(TransactionReceipt, _super);
4131
4262
  function TransactionReceipt() {
4263
+ return _super !== null && _super.apply(this, arguments) || this;
4132
4264
  }
4133
4265
  return TransactionReceipt;
4134
- }());
4266
+ }(AbstractModel));
4135
4267
 
4136
4268
  var TransactionReceipt = /** @class */ (function (_super) {
4137
4269
  __extends(TransactionReceipt, _super);
@@ -4144,11 +4276,13 @@
4144
4276
  return TransactionReceipt;
4145
4277
  }(TransactionReceipt$1));
4146
4278
 
4147
- var IncomeSource$1 = /** @class */ (function () {
4279
+ var IncomeSource$1 = /** @class */ (function (_super) {
4280
+ __extends(IncomeSource, _super);
4148
4281
  function IncomeSource() {
4282
+ return _super !== null && _super.apply(this, arguments) || this;
4149
4283
  }
4150
4284
  return IncomeSource;
4151
- }());
4285
+ }(AbstractModel));
4152
4286
 
4153
4287
  exports.IncomeSourceTypeEnum = void 0;
4154
4288
  (function (IncomeSourceTypeEnum) {
@@ -4158,11 +4292,13 @@
4158
4292
  IncomeSourceTypeEnum[IncomeSourceTypeEnum["SOLE"] = 4] = "SOLE";
4159
4293
  })(exports.IncomeSourceTypeEnum || (exports.IncomeSourceTypeEnum = {}));
4160
4294
 
4161
- var SalaryForecast$1 = /** @class */ (function () {
4295
+ var SalaryForecast$1 = /** @class */ (function (_super) {
4296
+ __extends(SalaryForecast, _super);
4162
4297
  function SalaryForecast() {
4298
+ return _super !== null && _super.apply(this, arguments) || this;
4163
4299
  }
4164
4300
  return SalaryForecast;
4165
- }());
4301
+ }(AbstractModel));
4166
4302
 
4167
4303
  var SalaryForecast = /** @class */ (function (_super) {
4168
4304
  __extends(SalaryForecast, _super);
@@ -4182,11 +4318,13 @@
4182
4318
  classTransformer.Type(function () { return IncomeSource; })
4183
4319
  ], SalaryForecast.prototype, "incomeSource", void 0);
4184
4320
 
4185
- var SoleForecast$1 = /** @class */ (function () {
4321
+ var SoleForecast$1 = /** @class */ (function (_super) {
4322
+ __extends(SoleForecast, _super);
4186
4323
  function SoleForecast() {
4324
+ return _super !== null && _super.apply(this, arguments) || this;
4187
4325
  }
4188
4326
  return SoleForecast;
4189
- }());
4327
+ }(AbstractModel));
4190
4328
 
4191
4329
  var SoleForecast = /** @class */ (function (_super) {
4192
4330
  __extends(SoleForecast, _super);
@@ -4207,11 +4345,13 @@
4207
4345
  classTransformer.Type(function () { return IncomeSource; })
4208
4346
  ], SoleForecast.prototype, "incomeSource", void 0);
4209
4347
 
4210
- var IncomeSourceForecast$1 = /** @class */ (function () {
4348
+ var IncomeSourceForecast$1 = /** @class */ (function (_super) {
4349
+ __extends(IncomeSourceForecast, _super);
4211
4350
  function IncomeSourceForecast() {
4351
+ return _super !== null && _super.apply(this, arguments) || this;
4212
4352
  }
4213
4353
  return IncomeSourceForecast;
4214
- }());
4354
+ }(AbstractModel));
4215
4355
 
4216
4356
  exports.SalaryForecastFrequencyEnum = void 0;
4217
4357
  (function (SalaryForecastFrequencyEnum) {
@@ -4221,11 +4361,13 @@
4221
4361
  SalaryForecastFrequencyEnum[SalaryForecastFrequencyEnum["WEEKLY"] = 52] = "WEEKLY";
4222
4362
  })(exports.SalaryForecastFrequencyEnum || (exports.SalaryForecastFrequencyEnum = {}));
4223
4363
 
4224
- var IncomeSourceType$1 = /** @class */ (function () {
4364
+ var IncomeSourceType$1 = /** @class */ (function (_super) {
4365
+ __extends(IncomeSourceType, _super);
4225
4366
  function IncomeSourceType() {
4367
+ return _super !== null && _super.apply(this, arguments) || this;
4226
4368
  }
4227
4369
  return IncomeSourceType;
4228
- }());
4370
+ }(AbstractModel));
4229
4371
 
4230
4372
  exports.IncomeSourceTypeListSalaryEnum = void 0;
4231
4373
  (function (IncomeSourceTypeListSalaryEnum) {
@@ -4385,11 +4527,13 @@
4385
4527
  classTransformer.Type(function () { return Date; })
4386
4528
  ], IncomeSource.prototype, "dateTo", void 0);
4387
4529
 
4388
- var TransactionMetadata$1 = /** @class */ (function () {
4530
+ var TransactionMetadata$1 = /** @class */ (function (_super) {
4531
+ __extends(TransactionMetadata, _super);
4389
4532
  function TransactionMetadata() {
4533
+ return _super !== null && _super.apply(this, arguments) || this;
4390
4534
  }
4391
4535
  return TransactionMetadata;
4392
- }());
4536
+ }(AbstractModel));
4393
4537
 
4394
4538
  var TransactionMetadata = /** @class */ (function (_super) {
4395
4539
  __extends(TransactionMetadata, _super);
@@ -4402,11 +4546,13 @@
4402
4546
  classTransformer.Type(function () { return ChartAccountsMetadata; })
4403
4547
  ], TransactionMetadata.prototype, "metadata", void 0);
4404
4548
 
4405
- var Loan$1 = /** @class */ (function () {
4549
+ var Loan$1 = /** @class */ (function (_super) {
4550
+ __extends(Loan, _super);
4406
4551
  function Loan() {
4552
+ return _super !== null && _super.apply(this, arguments) || this;
4407
4553
  }
4408
4554
  return Loan;
4409
- }());
4555
+ }(AbstractModel));
4410
4556
 
4411
4557
  exports.LoanRepaymentTypeEnum = void 0;
4412
4558
  (function (LoanRepaymentTypeEnum) {
@@ -4434,11 +4580,13 @@
4434
4580
  classTransformer.Type(function () { return Date; })
4435
4581
  ], LoanPayment.prototype, "date", void 0);
4436
4582
 
4437
- var LoanPayout$1 = /** @class */ (function () {
4583
+ var LoanPayout$1 = /** @class */ (function (_super) {
4584
+ __extends(LoanPayout, _super);
4438
4585
  function LoanPayout() {
4586
+ return _super !== null && _super.apply(this, arguments) || this;
4439
4587
  }
4440
4588
  return LoanPayout;
4441
- }());
4589
+ }(AbstractModel));
4442
4590
 
4443
4591
  exports.LoanPayoutTypeEnum = void 0;
4444
4592
  (function (LoanPayoutTypeEnum) {
@@ -4493,11 +4641,13 @@
4493
4641
  classTransformer.Type(function () { return LoanPayout; })
4494
4642
  ], Loan.prototype, "payout", void 0);
4495
4643
 
4496
- var TransactionAllocation$1 = /** @class */ (function () {
4644
+ var TransactionAllocation$1 = /** @class */ (function (_super) {
4645
+ __extends(TransactionAllocation, _super);
4497
4646
  function TransactionAllocation() {
4647
+ return _super !== null && _super.apply(this, arguments) || this;
4498
4648
  }
4499
4649
  return TransactionAllocation;
4500
- }());
4650
+ }(AbstractModel));
4501
4651
 
4502
4652
  var TransactionAllocation = /** @class */ (function (_super) {
4503
4653
  __extends(TransactionAllocation, _super);
@@ -5172,7 +5322,7 @@
5172
5322
  properties.items.forEach(function (property) {
5173
5323
  var transactionsDictionary = new CollectionDictionary(transactions.getByPropertiesIds([property.id]), 'chartAccounts.id');
5174
5324
  transactionsDictionary.keys.map(function (chartAccountId) {
5175
- _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)));
5176
5326
  });
5177
5327
  });
5178
5328
  };
@@ -5216,71 +5366,13 @@
5216
5366
  properties.items.forEach(function (property) {
5217
5367
  var depreciationsByType = new CollectionDictionary(depreciations, 'type');
5218
5368
  depreciationsByType.keys.map(function (type) {
5219
- _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)));
5220
5370
  });
5221
5371
  });
5222
5372
  };
5223
5373
  return PropertyReportItemDepreciationCollection;
5224
5374
  }(PropertyReportItemCollection));
5225
5375
 
5226
- /**
5227
- * Vehicle expense for logbook section
5228
- */
5229
- var VehicleExpense = /** @class */ (function () {
5230
- function VehicleExpense(amount, claimPercent, description) {
5231
- this.amount = amount;
5232
- this.claimPercent = claimPercent;
5233
- this.description = description;
5234
- }
5235
- VehicleExpense.prototype.getClaimAmount = function () {
5236
- return +(this.amount * (this.claimPercent / 100)).toFixed(2);
5237
- };
5238
- return VehicleExpense;
5239
- }());
5240
-
5241
- var VehicleExpenseCollection = /** @class */ (function (_super) {
5242
- __extends(VehicleExpenseCollection, _super);
5243
- function VehicleExpenseCollection(transactions, depreciations, vehicleClaim) {
5244
- var _this = _super.call(this) || this;
5245
- _this.setItems(transactions, depreciations, vehicleClaim);
5246
- return _this;
5247
- }
5248
- VehicleExpenseCollection.prototype.setItems = function (transactions, depreciations, vehicleClaim) {
5249
- var _a;
5250
- this.items = [];
5251
- var transactionsByChartAccounts = new CollectionDictionary(transactions, 'chartAccounts.name');
5252
- var transactionExpenses = transactionsByChartAccounts.keys.map(function (chartAccountsName) {
5253
- return new VehicleExpense(transactionsByChartAccounts.get(chartAccountsName).amount, vehicleClaim.workUsage, chartAccountsName);
5254
- });
5255
- // group all depreciations into one expense item
5256
- var depreciationExpense = new VehicleExpense(depreciations.getCurrentYearForecastAmount(), vehicleClaim.workUsage, 'Depreciation');
5257
- (_a = this.items).push.apply(_a, __spreadArray([depreciationExpense], __read(transactionExpenses)));
5258
- };
5259
- return VehicleExpenseCollection;
5260
- }(Collection));
5261
-
5262
- var ServicePriceCollection = /** @class */ (function (_super) {
5263
- __extends(ServicePriceCollection, _super);
5264
- function ServicePriceCollection() {
5265
- return _super !== null && _super.apply(this, arguments) || this;
5266
- }
5267
- Object.defineProperty(ServicePriceCollection.prototype, "work", {
5268
- get: function () {
5269
- return this.items.filter(function (price) { return price.product.isWork(); })[0];
5270
- },
5271
- enumerable: false,
5272
- configurable: true
5273
- });
5274
- Object.defineProperty(ServicePriceCollection.prototype, "property", {
5275
- get: function () {
5276
- return this.items.filter(function (price) { return price.product.isProperty(); })[0];
5277
- },
5278
- enumerable: false,
5279
- configurable: true
5280
- });
5281
- return ServicePriceCollection;
5282
- }(Collection));
5283
-
5284
5376
  var ServiceSubscriptionCollection = /** @class */ (function (_super) {
5285
5377
  __extends(ServiceSubscriptionCollection, _super);
5286
5378
  function ServiceSubscriptionCollection() {
@@ -6257,11 +6349,13 @@
6257
6349
  return AccountSetupItem;
6258
6350
  }());
6259
6351
 
6260
- var Bank$1 = /** @class */ (function () {
6352
+ var Bank$1 = /** @class */ (function (_super) {
6353
+ __extends(Bank, _super);
6261
6354
  function Bank() {
6355
+ return _super !== null && _super.apply(this, arguments) || this;
6262
6356
  }
6263
6357
  return Bank;
6264
- }());
6358
+ }(AbstractModel));
6265
6359
 
6266
6360
  var Bank = /** @class */ (function (_super) {
6267
6361
  __extends(Bank, _super);
@@ -6280,23 +6374,29 @@
6280
6374
  return Bank;
6281
6375
  }(Bank$1));
6282
6376
 
6283
- var BankAccount$1 = /** @class */ (function () {
6377
+ var BankAccount$1 = /** @class */ (function (_super) {
6378
+ __extends(BankAccount, _super);
6284
6379
  function BankAccount() {
6380
+ return _super !== null && _super.apply(this, arguments) || this;
6285
6381
  }
6286
6382
  return BankAccount;
6287
- }());
6383
+ }(AbstractModel));
6288
6384
 
6289
- var BankAccountBalance = /** @class */ (function () {
6385
+ var BankAccountBalance = /** @class */ (function (_super) {
6386
+ __extends(BankAccountBalance, _super);
6290
6387
  function BankAccountBalance() {
6388
+ return _super !== null && _super.apply(this, arguments) || this;
6291
6389
  }
6292
6390
  return BankAccountBalance;
6293
- }());
6391
+ }(AbstractModel));
6294
6392
 
6295
- var BankAccountProperty$1 = /** @class */ (function () {
6393
+ var BankAccountProperty$1 = /** @class */ (function (_super) {
6394
+ __extends(BankAccountProperty, _super);
6296
6395
  function BankAccountProperty() {
6396
+ return _super !== null && _super.apply(this, arguments) || this;
6297
6397
  }
6298
6398
  return BankAccountProperty;
6299
- }());
6399
+ }(AbstractModel));
6300
6400
 
6301
6401
  var BankAccountProperty = /** @class */ (function (_super) {
6302
6402
  __extends(BankAccountProperty, _super);
@@ -6309,17 +6409,21 @@
6309
6409
  classTransformer.Type(function () { return Property; })
6310
6410
  ], BankAccountProperty.prototype, "property", void 0);
6311
6411
 
6312
- var BankConnection$1 = /** @class */ (function () {
6412
+ var BankConnection$1 = /** @class */ (function (_super) {
6413
+ __extends(BankConnection, _super);
6313
6414
  function BankConnection() {
6415
+ return _super !== null && _super.apply(this, arguments) || this;
6314
6416
  }
6315
6417
  return BankConnection;
6316
- }());
6418
+ }(AbstractModel));
6317
6419
 
6318
- var BasiqJob$1 = /** @class */ (function () {
6420
+ var BasiqJob$1 = /** @class */ (function (_super) {
6421
+ __extends(BasiqJob, _super);
6319
6422
  function BasiqJob() {
6423
+ return _super !== null && _super.apply(this, arguments) || this;
6320
6424
  }
6321
6425
  return BasiqJob;
6322
- }());
6426
+ }(AbstractModel));
6323
6427
 
6324
6428
  var BasiqJob = /** @class */ (function (_super) {
6325
6429
  __extends(BasiqJob, _super);
@@ -6701,11 +6805,13 @@
6701
6805
  return BasiqToken;
6702
6806
  }());
6703
6807
 
6704
- var BorrowingExpense$1 = /** @class */ (function () {
6808
+ var BorrowingExpense$1 = /** @class */ (function (_super) {
6809
+ __extends(BorrowingExpense, _super);
6705
6810
  function BorrowingExpense() {
6811
+ return _super !== null && _super.apply(this, arguments) || this;
6706
6812
  }
6707
6813
  return BorrowingExpense;
6708
- }());
6814
+ }(AbstractModel));
6709
6815
 
6710
6816
  var BorrowingExpense = /** @class */ (function (_super) {
6711
6817
  __extends(BorrowingExpense, _super);
@@ -6715,11 +6821,13 @@
6715
6821
  return BorrowingExpense;
6716
6822
  }(BorrowingExpense$1));
6717
6823
 
6718
- var BorrowingExpenseLoan$1 = /** @class */ (function () {
6824
+ var BorrowingExpenseLoan$1 = /** @class */ (function (_super) {
6825
+ __extends(BorrowingExpenseLoan, _super);
6719
6826
  function BorrowingExpenseLoan() {
6827
+ return _super !== null && _super.apply(this, arguments) || this;
6720
6828
  }
6721
6829
  return BorrowingExpenseLoan;
6722
- }());
6830
+ }(AbstractModel));
6723
6831
 
6724
6832
  var BorrowingExpenseLoan = /** @class */ (function (_super) {
6725
6833
  __extends(BorrowingExpenseLoan, _super);
@@ -6752,11 +6860,13 @@
6752
6860
  classTransformer.Type(function () { return ChartSerie; })
6753
6861
  ], ChartData.prototype, "data", void 0);
6754
6862
 
6755
- var ChartAccountsDepreciation$1 = /** @class */ (function () {
6863
+ var ChartAccountsDepreciation$1 = /** @class */ (function (_super) {
6864
+ __extends(ChartAccountsDepreciation, _super);
6756
6865
  function ChartAccountsDepreciation() {
6866
+ return _super !== null && _super.apply(this, arguments) || this;
6757
6867
  }
6758
6868
  return ChartAccountsDepreciation;
6759
- }());
6869
+ }(AbstractModel));
6760
6870
 
6761
6871
  var ChartAccountsDepreciation = /** @class */ (function (_super) {
6762
6872
  __extends(ChartAccountsDepreciation, _super);
@@ -6788,11 +6898,13 @@
6788
6898
  ChartAccountsTaxLabelsEnum["TAX_DEDUCTED"] = "Tax Deducted";
6789
6899
  })(exports.ChartAccountsTaxLabelsEnum || (exports.ChartAccountsTaxLabelsEnum = {}));
6790
6900
 
6791
- var ChartAccountsValue$1 = /** @class */ (function () {
6901
+ var ChartAccountsValue$1 = /** @class */ (function (_super) {
6902
+ __extends(ChartAccountsValue, _super);
6792
6903
  function ChartAccountsValue() {
6904
+ return _super !== null && _super.apply(this, arguments) || this;
6793
6905
  }
6794
6906
  return ChartAccountsValue;
6795
- }());
6907
+ }(AbstractModel));
6796
6908
 
6797
6909
  var ChartAccountsValue = /** @class */ (function (_super) {
6798
6910
  __extends(ChartAccountsValue, _super);
@@ -6802,11 +6914,13 @@
6802
6914
  return ChartAccountsValue;
6803
6915
  }(ChartAccountsValue$1));
6804
6916
 
6805
- var Chat$1 = /** @class */ (function () {
6917
+ var Chat$1 = /** @class */ (function (_super) {
6918
+ __extends(Chat, _super);
6806
6919
  function Chat() {
6920
+ return _super !== null && _super.apply(this, arguments) || this;
6807
6921
  }
6808
6922
  return Chat;
6809
- }());
6923
+ }(AbstractModel));
6810
6924
 
6811
6925
  var Chat = /** @class */ (function (_super) {
6812
6926
  __extends(Chat, _super);
@@ -6837,17 +6951,21 @@
6837
6951
  ChatViewTypeEnum[ChatViewTypeEnum["ATTACHMENTS"] = 1] = "ATTACHMENTS";
6838
6952
  })(exports.ChatViewTypeEnum || (exports.ChatViewTypeEnum = {}));
6839
6953
 
6840
- var Message$1 = /** @class */ (function () {
6954
+ var Message$1 = /** @class */ (function (_super) {
6955
+ __extends(Message, _super);
6841
6956
  function Message() {
6957
+ return _super !== null && _super.apply(this, arguments) || this;
6842
6958
  }
6843
6959
  return Message;
6844
- }());
6960
+ }(AbstractModel));
6845
6961
 
6846
- var MessageDocument$1 = /** @class */ (function () {
6962
+ var MessageDocument$1 = /** @class */ (function (_super) {
6963
+ __extends(MessageDocument, _super);
6847
6964
  function MessageDocument() {
6965
+ return _super !== null && _super.apply(this, arguments) || this;
6848
6966
  }
6849
6967
  return MessageDocument;
6850
- }());
6968
+ }(AbstractModel));
6851
6969
 
6852
6970
  var MessageDocument = /** @class */ (function (_super) {
6853
6971
  __extends(MessageDocument, _super);
@@ -6905,11 +7023,13 @@
6905
7023
  classTransformer.Expose()
6906
7024
  ], Message.prototype, "documents", void 0);
6907
7025
 
6908
- var ClientIncomeTypes$1 = /** @class */ (function () {
7026
+ var ClientIncomeTypes$1 = /** @class */ (function (_super) {
7027
+ __extends(ClientIncomeTypes, _super);
6909
7028
  function ClientIncomeTypes() {
7029
+ return _super !== null && _super.apply(this, arguments) || this;
6910
7030
  }
6911
7031
  return ClientIncomeTypes;
6912
- }());
7032
+ }(AbstractModel));
6913
7033
 
6914
7034
  var ClientIncomeTypes = /** @class */ (function (_super) {
6915
7035
  __extends(ClientIncomeTypes, _super);
@@ -6929,17 +7049,21 @@
6929
7049
  return ClientIncomeTypes;
6930
7050
  }(ClientIncomeTypes$1));
6931
7051
 
6932
- var ClientInvite$1 = /** @class */ (function () {
7052
+ var ClientInvite$1 = /** @class */ (function (_super) {
7053
+ __extends(ClientInvite, _super);
6933
7054
  function ClientInvite() {
7055
+ return _super !== null && _super.apply(this, arguments) || this;
6934
7056
  }
6935
7057
  return ClientInvite;
6936
- }());
7058
+ }(AbstractModel));
6937
7059
 
6938
- var RegistrationInvite$1 = /** @class */ (function () {
7060
+ var RegistrationInvite$1 = /** @class */ (function (_super) {
7061
+ __extends(RegistrationInvite, _super);
6939
7062
  function RegistrationInvite() {
7063
+ return _super !== null && _super.apply(this, arguments) || this;
6940
7064
  }
6941
7065
  return RegistrationInvite;
6942
- }());
7066
+ }(AbstractModel));
6943
7067
 
6944
7068
  var RegistrationInvite = /** @class */ (function (_super) {
6945
7069
  __extends(RegistrationInvite, _super);
@@ -7027,11 +7151,13 @@
7027
7151
  classTransformer.Type(function () { return RegistrationInvite; })
7028
7152
  ], ClientInvite.prototype, "registrationInvite", void 0);
7029
7153
 
7030
- var ClientMovement$1 = /** @class */ (function () {
7154
+ var ClientMovement$1 = /** @class */ (function (_super) {
7155
+ __extends(ClientMovement, _super);
7031
7156
  function ClientMovement() {
7157
+ return _super !== null && _super.apply(this, arguments) || this;
7032
7158
  }
7033
7159
  return ClientMovement;
7034
- }());
7160
+ }(AbstractModel));
7035
7161
 
7036
7162
  var ClientMovement = /** @class */ (function (_super) {
7037
7163
  __extends(ClientMovement, _super);
@@ -7224,11 +7350,13 @@
7224
7350
  },
7225
7351
  _a$1);
7226
7352
 
7227
- var DepreciationReceipt$1 = /** @class */ (function () {
7353
+ var DepreciationReceipt$1 = /** @class */ (function (_super) {
7354
+ __extends(DepreciationReceipt, _super);
7228
7355
  function DepreciationReceipt() {
7356
+ return _super !== null && _super.apply(this, arguments) || this;
7229
7357
  }
7230
7358
  return DepreciationReceipt;
7231
- }());
7359
+ }(AbstractModel));
7232
7360
 
7233
7361
  var DepreciationReceipt = /** @class */ (function (_super) {
7234
7362
  __extends(DepreciationReceipt, _super);
@@ -7241,11 +7369,13 @@
7241
7369
  return DepreciationReceipt;
7242
7370
  }(DepreciationReceipt$1));
7243
7371
 
7244
- var Document$1 = /** @class */ (function () {
7372
+ var Document$1 = /** @class */ (function (_super) {
7373
+ __extends(Document, _super);
7245
7374
  function Document() {
7375
+ return _super !== null && _super.apply(this, arguments) || this;
7246
7376
  }
7247
7377
  return Document;
7248
- }());
7378
+ }(AbstractModel));
7249
7379
 
7250
7380
  /**
7251
7381
  * Enum with document types which used to API url prefix
@@ -7302,11 +7432,13 @@
7302
7432
  ]
7303
7433
  };
7304
7434
 
7305
- var DocumentFolder$1 = /** @class */ (function () {
7435
+ var DocumentFolder$1 = /** @class */ (function (_super) {
7436
+ __extends(DocumentFolder, _super);
7306
7437
  function DocumentFolder() {
7438
+ return _super !== null && _super.apply(this, arguments) || this;
7307
7439
  }
7308
7440
  return DocumentFolder;
7309
- }());
7441
+ }(AbstractModel));
7310
7442
 
7311
7443
  var DocumentFolder = /** @class */ (function (_super) {
7312
7444
  __extends(DocumentFolder, _super);
@@ -7319,11 +7451,13 @@
7319
7451
  classTransformer.Type(function () { return Document; })
7320
7452
  ], DocumentFolder.prototype, "documents", void 0);
7321
7453
 
7322
- var EmployeeInvite$1 = /** @class */ (function () {
7454
+ var EmployeeInvite$1 = /** @class */ (function (_super) {
7455
+ __extends(EmployeeInvite, _super);
7323
7456
  function EmployeeInvite() {
7457
+ return _super !== null && _super.apply(this, arguments) || this;
7324
7458
  }
7325
7459
  return EmployeeInvite;
7326
- }());
7460
+ }(AbstractModel));
7327
7461
 
7328
7462
  var EmployeeInvite = /** @class */ (function (_super) {
7329
7463
  __extends(EmployeeInvite, _super);
@@ -7502,17 +7636,21 @@
7502
7636
  { label: 'Personal', value: exports.VehicleLogbookPurposeEnum.PERSONAL }
7503
7637
  ];
7504
7638
 
7505
- var Vehicle$1 = /** @class */ (function () {
7639
+ var Vehicle$1 = /** @class */ (function (_super) {
7640
+ __extends(Vehicle, _super);
7506
7641
  function Vehicle() {
7642
+ return _super !== null && _super.apply(this, arguments) || this;
7507
7643
  }
7508
7644
  return Vehicle;
7509
- }());
7645
+ }(AbstractModel));
7510
7646
 
7511
- var VehicleLogbook$1 = /** @class */ (function () {
7647
+ var VehicleLogbook$1 = /** @class */ (function (_super) {
7648
+ __extends(VehicleLogbook, _super);
7512
7649
  function VehicleLogbook() {
7650
+ return _super !== null && _super.apply(this, arguments) || this;
7513
7651
  }
7514
7652
  return VehicleLogbook;
7515
- }());
7653
+ }(AbstractModel));
7516
7654
 
7517
7655
  var VehicleLogbook = /** @class */ (function (_super) {
7518
7656
  __extends(VehicleLogbook, _super);
@@ -7554,11 +7692,13 @@
7554
7692
  classTransformer.Type(function () { return VehicleLogbook; })
7555
7693
  ], Vehicle.prototype, "logbook", void 0);
7556
7694
 
7557
- var VehicleClaim$1 = /** @class */ (function () {
7695
+ var VehicleClaim$1 = /** @class */ (function (_super) {
7696
+ __extends(VehicleClaim, _super);
7558
7697
  function VehicleClaim() {
7698
+ return _super !== null && _super.apply(this, arguments) || this;
7559
7699
  }
7560
7700
  return VehicleClaim;
7561
- }());
7701
+ }(AbstractModel));
7562
7702
 
7563
7703
  var WEEKS_IN_YEAR = 52;
7564
7704
  var VehicleClaim = /** @class */ (function (_super) {
@@ -7651,11 +7791,13 @@
7651
7791
  return VehicleClaim;
7652
7792
  }(VehicleClaim$1));
7653
7793
 
7654
- var ServiceNotification = /** @class */ (function () {
7794
+ var ServiceNotification = /** @class */ (function (_super) {
7795
+ __extends(ServiceNotification, _super);
7655
7796
  function ServiceNotification() {
7797
+ return _super !== null && _super.apply(this, arguments) || this;
7656
7798
  }
7657
7799
  return ServiceNotification;
7658
- }());
7800
+ }(AbstractModel));
7659
7801
 
7660
7802
  var Notification = /** @class */ (function (_super) {
7661
7803
  __extends(Notification, _super);
@@ -7999,11 +8141,13 @@
7999
8141
  return PropertyEquityChartData;
8000
8142
  }());
8001
8143
 
8002
- var PropertyShare$1 = /** @class */ (function () {
8144
+ var PropertyShare$1 = /** @class */ (function (_super) {
8145
+ __extends(PropertyShare, _super);
8003
8146
  function PropertyShare() {
8147
+ return _super !== null && _super.apply(this, arguments) || this;
8004
8148
  }
8005
8149
  return PropertyShare;
8006
- }());
8150
+ }(AbstractModel));
8007
8151
 
8008
8152
  var PropertyShare = /** @class */ (function (_super) {
8009
8153
  __extends(PropertyShare, _super);
@@ -8062,17 +8206,21 @@
8062
8206
  })
8063
8207
  ], PropertyShare.prototype, "email", void 0);
8064
8208
 
8065
- var PropertySale$1 = /** @class */ (function () {
8209
+ var PropertySale$1 = /** @class */ (function (_super) {
8210
+ __extends(PropertySale, _super);
8066
8211
  function PropertySale() {
8212
+ return _super !== null && _super.apply(this, arguments) || this;
8067
8213
  }
8068
8214
  return PropertySale;
8069
- }());
8215
+ }(AbstractModel));
8070
8216
 
8071
- var PropertySaleTaxExemptionMetadata$1 = /** @class */ (function () {
8217
+ var PropertySaleTaxExemptionMetadata$1 = /** @class */ (function (_super) {
8218
+ __extends(PropertySaleTaxExemptionMetadata, _super);
8072
8219
  function PropertySaleTaxExemptionMetadata() {
8220
+ return _super !== null && _super.apply(this, arguments) || this;
8073
8221
  }
8074
8222
  return PropertySaleTaxExemptionMetadata;
8075
- }());
8223
+ }(AbstractModel));
8076
8224
 
8077
8225
  var PropertySale = /** @class */ (function (_super) {
8078
8226
  __extends(PropertySale, _super);
@@ -8098,11 +8246,13 @@
8098
8246
  classTransformer.Type(function () { return PropertySaleTaxExemptionMetadata$1; })
8099
8247
  ], PropertySale.prototype, "taxExemptionMetadata", void 0);
8100
8248
 
8101
- var TaxExemption$1 = /** @class */ (function () {
8249
+ var TaxExemption$1 = /** @class */ (function (_super) {
8250
+ __extends(TaxExemption, _super);
8102
8251
  function TaxExemption() {
8252
+ return _super !== null && _super.apply(this, arguments) || this;
8103
8253
  }
8104
8254
  return TaxExemption;
8105
- }());
8255
+ }(AbstractModel));
8106
8256
 
8107
8257
  var TaxExemption = /** @class */ (function (_super) {
8108
8258
  __extends(TaxExemption, _super);
@@ -8112,11 +8262,13 @@
8112
8262
  return TaxExemption;
8113
8263
  }(TaxExemption$1));
8114
8264
 
8115
- var TaxExemptionMetadata$1 = /** @class */ (function () {
8265
+ var TaxExemptionMetadata$1 = /** @class */ (function (_super) {
8266
+ __extends(TaxExemptionMetadata, _super);
8116
8267
  function TaxExemptionMetadata() {
8268
+ return _super !== null && _super.apply(this, arguments) || this;
8117
8269
  }
8118
8270
  return TaxExemptionMetadata;
8119
- }());
8271
+ }(AbstractModel));
8120
8272
 
8121
8273
  var TaxExemptionMetadata = /** @class */ (function (_super) {
8122
8274
  __extends(TaxExemptionMetadata, _super);
@@ -8146,11 +8298,13 @@
8146
8298
  myAccount: '/client/my-account/subscription'
8147
8299
  };
8148
8300
 
8149
- var ServicePayment$1 = /** @class */ (function () {
8301
+ var ServicePayment$1 = /** @class */ (function (_super) {
8302
+ __extends(ServicePayment, _super);
8150
8303
  function ServicePayment() {
8304
+ return _super !== null && _super.apply(this, arguments) || this;
8151
8305
  }
8152
8306
  return ServicePayment;
8153
- }());
8307
+ }(AbstractModel));
8154
8308
 
8155
8309
  var ServicePayment = /** @class */ (function (_super) {
8156
8310
  __extends(ServicePayment, _super);
@@ -8163,11 +8317,13 @@
8163
8317
  classTransformer.Type(function () { return ServiceSubscription; })
8164
8318
  ], ServicePayment.prototype, "subscription", void 0);
8165
8319
 
8166
- var TaxReview$1 = /** @class */ (function () {
8320
+ var TaxReview$1 = /** @class */ (function (_super) {
8321
+ __extends(TaxReview, _super);
8167
8322
  function TaxReview() {
8323
+ return _super !== null && _super.apply(this, arguments) || this;
8168
8324
  }
8169
8325
  return TaxReview;
8170
- }());
8326
+ }(AbstractModel));
8171
8327
 
8172
8328
  var TaxReview = /** @class */ (function (_super) {
8173
8329
  __extends(TaxReview, _super);
@@ -8471,11 +8627,13 @@
8471
8627
  MyAccountHistoryTypeEnum[MyAccountHistoryTypeEnum["UPLOAD_DOCUMENT"] = 2] = "UPLOAD_DOCUMENT";
8472
8628
  })(exports.MyAccountHistoryTypeEnum || (exports.MyAccountHistoryTypeEnum = {}));
8473
8629
 
8474
- var Occupation$1 = /** @class */ (function () {
8630
+ var Occupation$1 = /** @class */ (function (_super) {
8631
+ __extends(Occupation, _super);
8475
8632
  function Occupation() {
8633
+ return _super !== null && _super.apply(this, arguments) || this;
8476
8634
  }
8477
8635
  return Occupation;
8478
- }());
8636
+ }(AbstractModel));
8479
8637
 
8480
8638
  var Occupation = /** @class */ (function (_super) {
8481
8639
  __extends(Occupation, _super);
@@ -8494,7 +8652,6 @@
8494
8652
  ROLE_USER_SUBSCRIPTION: [exports.UserRolesEnum.SUBSCRIPTION],
8495
8653
  ROLE_USER_WORK: [exports.UserRolesEnum.WORK_TANK],
8496
8654
  ROLE_USER_PROPERTY: [exports.UserRolesEnum.PROPERTY_TANK],
8497
- ROLE_USER_SOLE: [exports.UserRolesEnum.SOLE_TANK],
8498
8655
  ROLE_PREVIOUS_ADMIN: [exports.UserRolesEnum.SWITCH_USER]
8499
8656
  };
8500
8657
 
@@ -8507,11 +8664,13 @@
8507
8664
  return UserToRegister;
8508
8665
  }());
8509
8666
 
8510
- var UserEventTypeCategory$1 = /** @class */ (function () {
8667
+ var UserEventTypeCategory$1 = /** @class */ (function (_super) {
8668
+ __extends(UserEventTypeCategory, _super);
8511
8669
  function UserEventTypeCategory() {
8670
+ return _super !== null && _super.apply(this, arguments) || this;
8512
8671
  }
8513
8672
  return UserEventTypeCategory;
8514
- }());
8673
+ }(AbstractModel));
8515
8674
 
8516
8675
  var UserEventTypeCategory = /** @class */ (function (_super) {
8517
8676
  __extends(UserEventTypeCategory, _super);
@@ -8521,17 +8680,21 @@
8521
8680
  return UserEventTypeCategory;
8522
8681
  }(UserEventTypeCategory$1));
8523
8682
 
8524
- var UserEventSetting$1 = /** @class */ (function () {
8683
+ var UserEventSetting$1 = /** @class */ (function (_super) {
8684
+ __extends(UserEventSetting, _super);
8525
8685
  function UserEventSetting() {
8686
+ return _super !== null && _super.apply(this, arguments) || this;
8526
8687
  }
8527
8688
  return UserEventSetting;
8528
- }());
8689
+ }(AbstractModel));
8529
8690
 
8530
- var UserEventType$1 = /** @class */ (function () {
8691
+ var UserEventType$1 = /** @class */ (function (_super) {
8692
+ __extends(UserEventType, _super);
8531
8693
  function UserEventType() {
8694
+ return _super !== null && _super.apply(this, arguments) || this;
8532
8695
  }
8533
8696
  return UserEventType;
8534
- }());
8697
+ }(AbstractModel));
8535
8698
 
8536
8699
  var UserEventType = /** @class */ (function (_super) {
8537
8700
  __extends(UserEventType, _super);
@@ -8793,7 +8956,7 @@
8793
8956
  * get instance by id from cache
8794
8957
  * @param id ID of required item
8795
8958
  */
8796
- RestService.prototype.getById = function (id) {
8959
+ RestService.prototype.findById = function (id) {
8797
8960
  return this.get()
8798
8961
  .pipe(operators.map(function (items) {
8799
8962
  return items.find(function (item) { return item['id'] === id; });
@@ -9347,11 +9510,7 @@
9347
9510
  */
9348
9511
  TransactionAllocationService.prototype.onTransactionsCreated = function () {
9349
9512
  var _this = this;
9350
- this.eventDispatcherService.on(exports.AppEventTypeEnum.TRANSACTIONS_CREATED).subscribe(function (transactions) {
9351
- // @TODO Alex hack: research and refactor cache update logic, dont reset cache each time transactions changed
9352
- if (transactions[0].isTransfer) {
9353
- return;
9354
- }
9513
+ this.eventDispatcherService.on(exports.AppEventTypeEnum.TRANSACTIONS_CREATED).subscribe(function () {
9355
9514
  // Update allocations cache to synchronize data and fire subscriptions
9356
9515
  _this.resetCache();
9357
9516
  });
@@ -9362,7 +9521,6 @@
9362
9521
  TransactionAllocationService.prototype.onDepreciationCreated = function () {
9363
9522
  var _this = this;
9364
9523
  this.eventDispatcherService.on(exports.AppEventTypeEnum.DEPRECIATIONS_CREATED).subscribe(function () {
9365
- // @TODO Alex hack: research and refactor cache update logic, dont reset cache each time depreciations changed
9366
9524
  // Update allocations cache to synchronize data and fire subscriptions
9367
9525
  _this.resetCache();
9368
9526
  });
@@ -9373,7 +9531,6 @@
9373
9531
  TransactionAllocationService.prototype.onTransactionDeleted = function () {
9374
9532
  var _this = this;
9375
9533
  this.eventDispatcherService.on(exports.AppEventTypeEnum.TRANSACTION_DELETED).subscribe(function () {
9376
- // @TODO Alex hack: research and refactor cache update logic, dont reset cache each time transactions changed
9377
9534
  // Update allocations cache to synchronize data and fire subscriptions
9378
9535
  _this.resetCache();
9379
9536
  });
@@ -12579,60 +12736,21 @@
12579
12736
  }
12580
12737
  return this.serviceSubscriptionSubject.asObservable();
12581
12738
  };
12582
- /**
12583
- * @TODO right now we have only monthly prices, the function should be refactored to support other options in future
12584
- *
12585
- * create available subscription plans based on existing products
12586
- */
12587
- SubscriptionService.prototype.getSubscriptionPlans = function () {
12588
- var _this = this;
12589
- if (!this._serviceSubscriptions) {
12590
- this.http.get(this.environment.apiV2 + "/service-prices")
12591
- .pipe(operators.map(function (response) {
12592
- return new ServicePriceCollection(response['hydra:member'].map(function (item) { return classTransformer.plainToClass(ServicePrice, item); }));
12593
- }))
12594
- .subscribe(function (prices) {
12595
- _this._serviceSubscriptions = new ServiceSubscriptionCollection([
12596
- classTransformer.plainToClass(ServiceSubscription, { items: [] }),
12597
- classTransformer.plainToClass(ServiceSubscription, {
12598
- items: [classTransformer.plainToClass(ServiceSubscriptionItem, {
12599
- price: prices.property,
12600
- quantity: 2
12601
- })]
12602
- }),
12603
- classTransformer.plainToClass(ServiceSubscription, {
12604
- items: [classTransformer.plainToClass(ServiceSubscriptionItem, {
12605
- price: prices.property,
12606
- quantity: 3
12607
- })]
12608
- })
12609
- ]);
12610
- _this._serviceSubscriptions.items.forEach(function (subscription) {
12611
- subscription.items.push(classTransformer.plainToClass(ServiceSubscriptionItem, { price: prices.work, quantity: 1 }));
12612
- });
12613
- _this.serviceSubscriptionsSubject.next(_this._serviceSubscriptions);
12614
- });
12615
- }
12616
- return this.serviceSubscriptionsSubject.asObservable();
12617
- };
12618
12739
  /**
12619
12740
  * redirect to stripe payment page
12620
12741
  */
12621
- SubscriptionService.prototype.checkoutRedirect = function (subscription, successUrl, cancelUrl) {
12742
+ SubscriptionService.prototype.checkoutRedirect = function (subscription) {
12622
12743
  return __awaiter(this, void 0, void 0, function () {
12623
- var stripe, lineItems;
12744
+ var stripe;
12624
12745
  return __generator(this, function (_a) {
12625
12746
  switch (_a.label) {
12626
12747
  case 0: return [4 /*yield*/, stripeJs.loadStripe(this.environment.stripePk)];
12627
12748
  case 1:
12628
12749
  stripe = _a.sent();
12629
- lineItems = subscription.items.map(function (item) {
12630
- return { servicePriceId: item.price.id, quantity: item.quantity };
12631
- });
12632
12750
  this.http.post(this.environment.apiV2 + "/stripe/checkout-session", {
12633
- lineItems: lineItems,
12634
- successUrl: successUrl,
12635
- cancelUrl: cancelUrl
12751
+ items: subscription.items,
12752
+ successUrl: window.location.href,
12753
+ cancelUrl: window.location.href
12636
12754
  })
12637
12755
  .subscribe(function (session) {
12638
12756
  // @Todo remove user TRIAL status
@@ -12703,6 +12821,29 @@
12703
12821
  }] }];
12704
12822
  } });
12705
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
+
12706
12847
  /**
12707
12848
  * Service to work with tax review
12708
12849
  */
@@ -13888,7 +14029,7 @@
13888
14029
  exports.ServiceNotificationService = ServiceNotificationService;
13889
14030
  exports.ServicePayment = ServicePayment;
13890
14031
  exports.ServicePrice = ServicePrice;
13891
- exports.ServicePriceCollection = ServicePriceCollection;
14032
+ exports.ServicePriceService = ServicePriceService;
13892
14033
  exports.ServiceProduct = ServiceProduct;
13893
14034
  exports.ServiceSubscription = ServiceSubscription;
13894
14035
  exports.ServiceSubscriptionCollection = ServiceSubscriptionCollection;
@@ -13938,8 +14079,6 @@
13938
14079
  exports.VehicleClaimForm = VehicleClaimForm;
13939
14080
  exports.VehicleClaimService = VehicleClaimService;
13940
14081
  exports.VehicleCollection = VehicleCollection;
13941
- exports.VehicleExpense = VehicleExpense;
13942
- exports.VehicleExpenseCollection = VehicleExpenseCollection;
13943
14082
  exports.VehicleForm = VehicleForm;
13944
14083
  exports.VehicleLogbook = VehicleLogbook;
13945
14084
  exports.VehicleLogbookCollection = VehicleLogbookCollection;