taxtank-core 0.28.17 → 0.28.20

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 (33) hide show
  1. package/bundles/taxtank-core.umd.js +194 -109
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/chat.collection.js +26 -0
  4. package/esm2015/lib/collections/message.collection.js +13 -1
  5. package/esm2015/lib/db/Enums/chart-accounts-list.enum.js +2 -2
  6. package/esm2015/lib/db/Enums/chat-status.enum.js +1 -1
  7. package/esm2015/lib/db/Models/property/property-forecast.js +1 -1
  8. package/esm2015/lib/db/Models/property/property.js +1 -1
  9. package/esm2015/lib/forms/sole/sole-business.form.js +3 -3
  10. package/esm2015/lib/forms/sole/sole-invoice.form.js +3 -2
  11. package/esm2015/lib/models/bank/bank-account.js +7 -1
  12. package/esm2015/lib/models/chart-accounts/chart-accounts.js +7 -1
  13. package/esm2015/lib/models/chat/message.js +5 -1
  14. package/esm2015/lib/models/event/app-event-type.enum.js +36 -35
  15. package/esm2015/lib/models/property/property.js +4 -1
  16. package/esm2015/lib/services/http/property/property.service.js +4 -1
  17. package/esm2015/lib/services/http/transaction/transaction.service.js +11 -1
  18. package/esm2015/public-api.js +2 -1
  19. package/fesm2015/taxtank-core.js +163 -98
  20. package/fesm2015/taxtank-core.js.map +1 -1
  21. package/lib/collections/chat.collection.d.ts +10 -0
  22. package/lib/collections/message.collection.d.ts +5 -0
  23. package/lib/db/Enums/chart-accounts-list.enum.d.ts +2 -2
  24. package/lib/db/Models/property/property-forecast.d.ts +1 -0
  25. package/lib/db/Models/property/property.d.ts +0 -1
  26. package/lib/models/bank/bank-account.d.ts +2 -0
  27. package/lib/models/chart-accounts/chart-accounts.d.ts +4 -0
  28. package/lib/models/chat/message.d.ts +2 -0
  29. package/lib/models/event/app-event-type.enum.d.ts +35 -34
  30. package/lib/models/property/property.d.ts +1 -0
  31. package/lib/services/http/transaction/transaction.service.d.ts +7 -1
  32. package/package.json +1 -1
  33. package/public-api.d.ts +1 -0
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('rxjs'), require('rxjs/operators'), require('class-transformer'), require('@auth0/angular-jwt'), require('lodash/get'), require('lodash/last'), require('lodash/flatten'), require('lodash/hasIn'), require('lodash/first'), require('moment'), require('moment-range'), require('lodash/uniqBy'), require('lodash/concat'), require('rxjs/internal/observable/throwError'), require('lodash/cloneDeep'), require('event-source-polyfill/src/eventsource.min.js'), require('lodash/compact'), require('@angular/forms'), require('lodash/merge'), require('lodash/isEqual'), require('lodash/fromPairs'), require('lodash'), require('@angular/router'), require('lodash/clone'), require('html2pdf.js'), require('jspdf'), require('jspdf-autotable'), require('@stripe/stripe-js'), require('xlsx'), require('file-saver')) :
3
- typeof define === 'function' && define.amd ? define('taxtank-core', ['exports', '@angular/core', '@angular/common', '@angular/common/http', 'rxjs', 'rxjs/operators', 'class-transformer', '@auth0/angular-jwt', 'lodash/get', 'lodash/last', 'lodash/flatten', 'lodash/hasIn', 'lodash/first', 'moment', 'moment-range', 'lodash/uniqBy', 'lodash/concat', 'rxjs/internal/observable/throwError', 'lodash/cloneDeep', 'event-source-polyfill/src/eventsource.min.js', 'lodash/compact', '@angular/forms', 'lodash/merge', 'lodash/isEqual', 'lodash/fromPairs', 'lodash', '@angular/router', 'lodash/clone', 'html2pdf.js', 'jspdf', 'jspdf-autotable', '@stripe/stripe-js', 'xlsx', 'file-saver'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["taxtank-core"] = {}, global.ng.core, global.ng.common, global.ng.common.http, global.rxjs, global.rxjs.operators, global.classTransformer, global.angularJwt, global.get, global.last, global.flatten, global.hasIn, global.first, global.moment$1, global.momentRange, global.uniqBy, global.concat, global.rxjs["internal/observable/throwError"], global.cloneDeep$1, global.eventsource_min_js, global.compact, global.ng.forms, global.merge, global.isEqual, global.fromPairs, global._, global.ng.router, global.clone, global.html2pdf, global.jsPDF, global.autoTable, global.stripeJs, global.xlsx, global.FileSaver));
5
- })(this, (function (exports, i0, i1$1, i1, rxjs, operators, classTransformer, angularJwt, get, last, flatten, hasIn, first, moment$1, momentRange, uniqBy, concat, throwError, cloneDeep$1, eventsource_min_js, compact, forms, merge, isEqual, fromPairs, _, i1$2, clone, html2pdf, jsPDF, autoTable, stripeJs, xlsx, FileSaver) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('rxjs'), require('rxjs/operators'), require('class-transformer'), require('@auth0/angular-jwt'), require('lodash/get'), require('lodash/last'), require('lodash/flatten'), require('lodash/hasIn'), require('lodash/first'), require('moment'), require('moment-range'), require('lodash/uniqBy'), require('lodash/concat'), require('rxjs/internal/observable/throwError'), require('lodash/cloneDeep'), require('event-source-polyfill/src/eventsource.min.js'), require('lodash/compact'), require('lodash/differenceBy'), require('@angular/forms'), require('lodash/merge'), require('lodash/isEqual'), require('lodash/fromPairs'), require('lodash'), require('@angular/router'), require('lodash/clone'), require('html2pdf.js'), require('jspdf'), require('jspdf-autotable'), require('@stripe/stripe-js'), require('xlsx'), require('file-saver')) :
3
+ typeof define === 'function' && define.amd ? define('taxtank-core', ['exports', '@angular/core', '@angular/common', '@angular/common/http', 'rxjs', 'rxjs/operators', 'class-transformer', '@auth0/angular-jwt', 'lodash/get', 'lodash/last', 'lodash/flatten', 'lodash/hasIn', 'lodash/first', 'moment', 'moment-range', 'lodash/uniqBy', 'lodash/concat', 'rxjs/internal/observable/throwError', 'lodash/cloneDeep', 'event-source-polyfill/src/eventsource.min.js', 'lodash/compact', 'lodash/differenceBy', '@angular/forms', 'lodash/merge', 'lodash/isEqual', 'lodash/fromPairs', 'lodash', '@angular/router', 'lodash/clone', 'html2pdf.js', 'jspdf', 'jspdf-autotable', '@stripe/stripe-js', 'xlsx', 'file-saver'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["taxtank-core"] = {}, global.ng.core, global.ng.common, global.ng.common.http, global.rxjs, global.rxjs.operators, global.classTransformer, global.angularJwt, global.get, global.last, global.flatten, global.hasIn, global.first, global.moment$1, global.momentRange, global.uniqBy, global.concat, global.rxjs["internal/observable/throwError"], global.cloneDeep$1, global.eventsource_min_js, global.compact, global.differenceBy, global.ng.forms, global.merge, global.isEqual, global.fromPairs, global._, global.ng.router, global.clone, global.html2pdf, global.jsPDF, global.autoTable, global.stripeJs, global.xlsx, global.FileSaver));
5
+ })(this, (function (exports, i0, i1$1, i1, rxjs, operators, classTransformer, angularJwt, get, last, flatten, hasIn, first, moment$1, momentRange, uniqBy, concat, throwError, cloneDeep$1, eventsource_min_js, compact, differenceBy, forms, merge, isEqual, fromPairs, _, i1$2, clone, html2pdf, jsPDF, autoTable, stripeJs, xlsx, FileSaver) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -37,6 +37,7 @@
37
37
  var concat__default = /*#__PURE__*/_interopDefaultLegacy(concat);
38
38
  var cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep$1);
39
39
  var compact__default = /*#__PURE__*/_interopDefaultLegacy(compact);
40
+ var differenceBy__default = /*#__PURE__*/_interopDefaultLegacy(differenceBy);
40
41
  var merge__default = /*#__PURE__*/_interopDefaultLegacy(merge);
41
42
  var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
42
43
  var fromPairs__default = /*#__PURE__*/_interopDefaultLegacy(fromPairs);
@@ -577,40 +578,41 @@
577
578
  AppEventTypeEnum[AppEventTypeEnum["MESSAGE_FILE_DELETED"] = 26] = "MESSAGE_FILE_DELETED";
578
579
  AppEventTypeEnum[AppEventTypeEnum["NOTIFICATION_ADDED"] = 27] = "NOTIFICATION_ADDED";
579
580
  AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DEPRECIATION_CALCULATION_UPDATED"] = 28] = "PROPERTY_DEPRECIATION_CALCULATION_UPDATED";
580
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED_WITH_DOCUMENT"] = 29] = "PROPERTY_UPDATED_WITH_DOCUMENT";
581
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DOCUMENT_ADDED"] = 30] = "PROPERTY_DOCUMENT_ADDED";
582
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_CREATED"] = 31] = "PROPERTY_MOVEMENT_CREATED";
583
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_UPDATED"] = 32] = "PROPERTY_MOVEMENT_UPDATED";
584
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_DELETED"] = 33] = "PROPERTY_MOVEMENT_DELETED";
585
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SHARE_UPDATED"] = 34] = "PROPERTY_SHARE_UPDATED";
586
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_ADDED"] = 35] = "PROPERTY_SALE_ADDED";
587
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_DELETED"] = 36] = "PROPERTY_SALE_DELETED";
588
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_ADDED"] = 37] = "PROPERTY_SUBSCRIPTION_ADDED";
589
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 38] = "PROPERTY_SUBSCRIPTION_DELETED";
590
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 39] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
591
- AppEventTypeEnum[AppEventTypeEnum["SERVICE_SUBSCRIPTION_UPDATED"] = 40] = "SERVICE_SUBSCRIPTION_UPDATED";
592
- AppEventTypeEnum[AppEventTypeEnum["SOLE_BUSINESS_CREATED"] = 41] = "SOLE_BUSINESS_CREATED";
593
- AppEventTypeEnum[AppEventTypeEnum["SOLE_DEPRECIATION_METHOD_UPDATED"] = 42] = "SOLE_DEPRECIATION_METHOD_UPDATED";
594
- AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_CREATED"] = 43] = "SOLE_DETAILS_CREATED";
595
- AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_UPDATED"] = 44] = "SOLE_DETAILS_UPDATED";
596
- AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 45] = "TAX_REVIEW_UPDATED";
597
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 46] = "TRANSACTION_CREATED";
598
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 47] = "TRANSACTION_DELETED";
599
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 48] = "TRANSACTION_UPDATED";
600
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_RECEIPT"] = 49] = "TRANSACTION_UPDATED_WITH_RECEIPT";
601
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_DELETED_RECEIPT"] = 50] = "TRANSACTION_UPDATED_WITH_DELETED_RECEIPT";
602
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_CREATED"] = 51] = "TRANSACTION_RECEIPT_CREATED";
603
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_DELETED"] = 52] = "TRANSACTION_RECEIPT_DELETED";
604
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 53] = "TRANSACTIONS_CREATED";
605
- AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 54] = "USER_UPDATED";
606
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 55] = "VEHICLE_CLAIM_UPDATED";
607
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 56] = "VEHICLE_CLAIM_CREATED";
608
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 57] = "VEHICLE_CLAIM_DETAILS_UPDATED";
609
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 58] = "VEHICLE_CLAIM_DETAILS_CREATED";
610
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 59] = "VEHICLE_LOGBOOK_CREATED";
611
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 60] = "VEHICLE_LOGBOOK_UPDATED";
612
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 61] = "VEHICLE_LOGBOOK_DELETED";
613
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 62] = "VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED";
581
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED"] = 29] = "PROPERTY_UPDATED";
582
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED_WITH_DOCUMENT"] = 30] = "PROPERTY_UPDATED_WITH_DOCUMENT";
583
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DOCUMENT_ADDED"] = 31] = "PROPERTY_DOCUMENT_ADDED";
584
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_CREATED"] = 32] = "PROPERTY_MOVEMENT_CREATED";
585
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_UPDATED"] = 33] = "PROPERTY_MOVEMENT_UPDATED";
586
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_DELETED"] = 34] = "PROPERTY_MOVEMENT_DELETED";
587
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SHARE_UPDATED"] = 35] = "PROPERTY_SHARE_UPDATED";
588
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_ADDED"] = 36] = "PROPERTY_SALE_ADDED";
589
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SALE_DELETED"] = 37] = "PROPERTY_SALE_DELETED";
590
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_ADDED"] = 38] = "PROPERTY_SUBSCRIPTION_ADDED";
591
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 39] = "PROPERTY_SUBSCRIPTION_DELETED";
592
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 40] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
593
+ AppEventTypeEnum[AppEventTypeEnum["SERVICE_SUBSCRIPTION_UPDATED"] = 41] = "SERVICE_SUBSCRIPTION_UPDATED";
594
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_BUSINESS_CREATED"] = 42] = "SOLE_BUSINESS_CREATED";
595
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_DEPRECIATION_METHOD_UPDATED"] = 43] = "SOLE_DEPRECIATION_METHOD_UPDATED";
596
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_CREATED"] = 44] = "SOLE_DETAILS_CREATED";
597
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_UPDATED"] = 45] = "SOLE_DETAILS_UPDATED";
598
+ AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 46] = "TAX_REVIEW_UPDATED";
599
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 47] = "TRANSACTION_CREATED";
600
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 48] = "TRANSACTION_DELETED";
601
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 49] = "TRANSACTION_UPDATED";
602
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_RECEIPT"] = 50] = "TRANSACTION_UPDATED_WITH_RECEIPT";
603
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED_WITH_DELETED_RECEIPT"] = 51] = "TRANSACTION_UPDATED_WITH_DELETED_RECEIPT";
604
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_CREATED"] = 52] = "TRANSACTION_RECEIPT_CREATED";
605
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_RECEIPT_DELETED"] = 53] = "TRANSACTION_RECEIPT_DELETED";
606
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 54] = "TRANSACTIONS_CREATED";
607
+ AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 55] = "USER_UPDATED";
608
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 56] = "VEHICLE_CLAIM_UPDATED";
609
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 57] = "VEHICLE_CLAIM_CREATED";
610
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 58] = "VEHICLE_CLAIM_DETAILS_UPDATED";
611
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 59] = "VEHICLE_CLAIM_DETAILS_CREATED";
612
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 60] = "VEHICLE_LOGBOOK_CREATED";
613
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 61] = "VEHICLE_LOGBOOK_UPDATED";
614
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 62] = "VEHICLE_LOGBOOK_DELETED";
615
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 63] = "VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED";
614
616
  })(exports.AppEventTypeEnum || (exports.AppEventTypeEnum = {}));
615
617
 
616
618
  var EventDispatcherService = /** @class */ (function () {
@@ -2816,7 +2818,6 @@
2816
2818
  ChartAccountsListEnum[ChartAccountsListEnum["DIVIDENDS"] = 542] = "DIVIDENDS";
2817
2819
  ChartAccountsListEnum[ChartAccountsListEnum["TRANSFER"] = 615] = "TRANSFER";
2818
2820
  ChartAccountsListEnum[ChartAccountsListEnum["BUILDING_AT_COST"] = 304] = "BUILDING_AT_COST";
2819
- ChartAccountsListEnum[ChartAccountsListEnum["MANAGEMENT_FEES_PLATFORM_FEES"] = 656] = "MANAGEMENT_FEES_PLATFORM_FEES";
2820
2821
  ChartAccountsListEnum[ChartAccountsListEnum["KLMS_TRAVELLED_FOR_WORK"] = 24] = "KLMS_TRAVELLED_FOR_WORK";
2821
2822
  ChartAccountsListEnum[ChartAccountsListEnum["KLMS_TRAVELLED"] = 683] = "KLMS_TRAVELLED";
2822
2823
  ChartAccountsListEnum[ChartAccountsListEnum["DIRECTOR_FEES"] = 6] = "DIRECTOR_FEES";
@@ -2854,6 +2855,7 @@
2854
2855
  ChartAccountsListEnum[ChartAccountsListEnum["CODE_A_SUPERANNUATION_INCOME_STREAMS_DEATH"] = 640] = "CODE_A_SUPERANNUATION_INCOME_STREAMS_DEATH";
2855
2856
  ChartAccountsListEnum[ChartAccountsListEnum["PERSONAL_EXPENSES"] = 628] = "PERSONAL_EXPENSES";
2856
2857
  ChartAccountsListEnum[ChartAccountsListEnum["PERSONAL_INCOME"] = 630] = "PERSONAL_INCOME";
2858
+ ChartAccountsListEnum[ChartAccountsListEnum["PLATFORM_FEES"] = 857] = "PLATFORM_FEES";
2857
2859
  })(exports.ChartAccountsListEnum || (exports.ChartAccountsListEnum = {}));
2858
2860
 
2859
2861
  exports.ChartAccountsCategoryEnum = void 0;
@@ -3091,6 +3093,12 @@
3091
3093
  ChartAccounts.prototype.isPropertyExpense = function () {
3092
3094
  return this.category === exports.ChartAccountsCategoryEnum.PROPERTY_EXPENSE;
3093
3095
  };
3096
+ /**
3097
+ * Check if chart accounts is property income
3098
+ */
3099
+ ChartAccounts.prototype.isPropertyIncome = function () {
3100
+ return this.category === exports.ChartAccountsCategoryEnum.PROPERTY_INCOME;
3101
+ };
3094
3102
  ChartAccounts.prototype.isPersonal = function () {
3095
3103
  return CHART_ACCOUNTS_CATEGORIES.personal.includes(this.category);
3096
3104
  };
@@ -5384,6 +5392,13 @@
5384
5392
  enumerable: false,
5385
5393
  configurable: true
5386
5394
  });
5395
+ Object.defineProperty(Property.prototype, "claimPercent", {
5396
+ get: function () {
5397
+ return this.currentYearForecast.claimPercent;
5398
+ },
5399
+ enumerable: false,
5400
+ configurable: true
5401
+ });
5387
5402
  Object.defineProperty(Property.prototype, "sharePercent", {
5388
5403
  get: function () {
5389
5404
  return this.myShare.percent;
@@ -5707,6 +5722,20 @@
5707
5722
  enumerable: false,
5708
5723
  configurable: true
5709
5724
  });
5725
+ Object.defineProperty(BankAccount.prototype, "bsb", {
5726
+ get: function () {
5727
+ return this.accountNumber.split(' ')[0];
5728
+ },
5729
+ enumerable: false,
5730
+ configurable: true
5731
+ });
5732
+ Object.defineProperty(BankAccount.prototype, "number", {
5733
+ get: function () {
5734
+ return this.accountNumber.split(' ')[1];
5735
+ },
5736
+ enumerable: false,
5737
+ configurable: true
5738
+ });
5710
5739
  /**
5711
5740
  * Get current opening balance amount
5712
5741
  */
@@ -7050,6 +7079,110 @@
7050
7079
  return ChartAccountsCollection;
7051
7080
  }(Collection));
7052
7081
 
7082
+ var MessageCollection = /** @class */ (function (_super) {
7083
+ __extends(MessageCollection, _super);
7084
+ function MessageCollection() {
7085
+ return _super !== null && _super.apply(this, arguments) || this;
7086
+ }
7087
+ MessageCollection.prototype.getFirstUnreadMessage = function (user) {
7088
+ return this.items.find(function (message) {
7089
+ return !message.isRead() && message.isFromEmployee() !== user.isEmployee();
7090
+ });
7091
+ };
7092
+ /**
7093
+ * Get List of unread chats
7094
+ */
7095
+ MessageCollection.prototype.getUnread = function () {
7096
+ return this.items.filter(function (message) { return !message.readAt; });
7097
+ };
7098
+ MessageCollection.prototype.getFromActiveChats = function () {
7099
+ return this.filter(function (message) { return message.chat.isActive(); });
7100
+ };
7101
+ /**
7102
+ * Get amount of chats that contains unread messages
7103
+ */
7104
+ MessageCollection.prototype.getUnreadChatsAmount = function (isFromEmployee) {
7105
+ if (isFromEmployee === void 0) { isFromEmployee = false; }
7106
+ // filtered messages for client/employee
7107
+ var filteredMessages = this.filter(function (message) { return isFromEmployee ? message.isFromEmployee() : !message.isFromEmployee(); });
7108
+ return uniqBy__default["default"](filteredMessages.getFromActiveChats().getUnread(), 'chat.id').length;
7109
+ };
7110
+ /**
7111
+ * Check if chat has unread chats
7112
+ */
7113
+ MessageCollection.prototype.hasUnread = function () {
7114
+ return !!this.getUnread().length;
7115
+ };
7116
+ return MessageCollection;
7117
+ }(Collection));
7118
+
7119
+ /**
7120
+ * List of objects grouped by passed property
7121
+ */
7122
+ var Dictionary = /** @class */ (function () {
7123
+ function Dictionary(items, path) {
7124
+ if (path === void 0) { path = 'id'; }
7125
+ this.items = {};
7126
+ if (!items.length) {
7127
+ return;
7128
+ }
7129
+ // Do nothing if provided path was not found in the 1st item
7130
+ if (!hasIn__default["default"](items[0], path.split('.')[0])) {
7131
+ return;
7132
+ }
7133
+ this.groupItems(items, path);
7134
+ }
7135
+ Dictionary.prototype.add = function (key, value) {
7136
+ this.items[key] = value;
7137
+ };
7138
+ Dictionary.prototype.get = function (key) {
7139
+ return this.items[key] !== undefined ? this.items[key] : null;
7140
+ };
7141
+ Dictionary.prototype.groupItems = function (items, path) {
7142
+ var _this = this;
7143
+ items.forEach(function (item) {
7144
+ var key = get__default["default"](item, path);
7145
+ // if object does not have property for grouping it will be grouped as 'other'
7146
+ if (key === undefined) {
7147
+ key = 'other';
7148
+ }
7149
+ _this.items[key] = item;
7150
+ });
7151
+ };
7152
+ return Dictionary;
7153
+ }());
7154
+
7155
+ exports.ChatStatusEnum = void 0;
7156
+ (function (ChatStatusEnum) {
7157
+ ChatStatusEnum[ChatStatusEnum["ACTIVE"] = 1] = "ACTIVE";
7158
+ ChatStatusEnum[ChatStatusEnum["INACTIVE"] = 2] = "INACTIVE";
7159
+ })(exports.ChatStatusEnum || (exports.ChatStatusEnum = {}));
7160
+
7161
+ var ChatCollection = /** @class */ (function (_super) {
7162
+ __extends(ChatCollection, _super);
7163
+ function ChatCollection() {
7164
+ return _super !== null && _super.apply(this, arguments) || this;
7165
+ }
7166
+ /**
7167
+ * Sort chats by last messages (newest first) + empty chats in the end
7168
+ */
7169
+ ChatCollection.prototype.getSortedByNewest = function (messages) {
7170
+ var chatsById = new Dictionary(this.toArray());
7171
+ // get chats array sorted from newest to oldest
7172
+ var chats = uniqBy__default["default"](new MessageCollection(messages)
7173
+ .filterBy('chat.id', this.getIds())
7174
+ .sortBy('createdAt', true)
7175
+ .toArray()
7176
+ .map(function (message) { return chatsById.get(message.chat.id); }), 'id');
7177
+ var emptyChats = differenceBy__default["default"](this.toArray(), chats, 'id');
7178
+ return this.create(__spreadArray(__spreadArray([], __read(chats)), __read(emptyChats)));
7179
+ };
7180
+ ChatCollection.prototype.getActive = function () {
7181
+ return this.filterBy('status', exports.ChatStatusEnum.ACTIVE);
7182
+ };
7183
+ return ChatCollection;
7184
+ }(Collection));
7185
+
7053
7186
  var ClientCollection = /** @class */ (function (_super) {
7054
7187
  __extends(ClientCollection, _super);
7055
7188
  function ClientCollection() {
@@ -7712,31 +7845,6 @@
7712
7845
  return LoanCollection;
7713
7846
  }(Collection));
7714
7847
 
7715
- var MessageCollection = /** @class */ (function (_super) {
7716
- __extends(MessageCollection, _super);
7717
- function MessageCollection() {
7718
- return _super !== null && _super.apply(this, arguments) || this;
7719
- }
7720
- MessageCollection.prototype.getFirstUnreadMessage = function (user) {
7721
- return this.items.find(function (message) {
7722
- return !message.isRead() && message.isFromEmployee() !== user.isEmployee();
7723
- });
7724
- };
7725
- /**
7726
- * Get List of unread chats
7727
- */
7728
- MessageCollection.prototype.getUnread = function () {
7729
- return this.items.filter(function (message) { return !message.readAt; });
7730
- };
7731
- /**
7732
- * Check if chat has unread chats
7733
- */
7734
- MessageCollection.prototype.hasUnread = function () {
7735
- return !!this.getUnread().length;
7736
- };
7737
- return MessageCollection;
7738
- }(Collection));
7739
-
7740
7848
  /**
7741
7849
  * Collection of MessageDocument instances
7742
7850
  */
@@ -8698,12 +8806,6 @@
8698
8806
  ChartAccountsTypeEnum[ChartAccountsTypeEnum["EXPENSE"] = 2] = "EXPENSE";
8699
8807
  })(exports.ChartAccountsTypeEnum || (exports.ChartAccountsTypeEnum = {}));
8700
8808
 
8701
- exports.ChatStatusEnum = void 0;
8702
- (function (ChatStatusEnum) {
8703
- ChatStatusEnum[ChatStatusEnum["ACTIVE"] = 1] = "ACTIVE";
8704
- ChatStatusEnum[ChatStatusEnum["INACTIVE"] = 2] = "INACTIVE";
8705
- })(exports.ChatStatusEnum || (exports.ChatStatusEnum = {}));
8706
-
8707
8809
  exports.ClientDetailsMedicareExemptionEnum = void 0;
8708
8810
  (function (ClientDetailsMedicareExemptionEnum) {
8709
8811
  ClientDetailsMedicareExemptionEnum[ClientDetailsMedicareExemptionEnum["NO"] = 0] = "NO";
@@ -9553,6 +9655,9 @@
9553
9655
  __decorate([
9554
9656
  classTransformer.Type(function () { return User; })
9555
9657
  ], Message.prototype, "employee", void 0);
9658
+ __decorate([
9659
+ classTransformer.Type(function () { return Chat; })
9660
+ ], Message.prototype, "chat", void 0);
9556
9661
  __decorate([
9557
9662
  classTransformer.Type(function () { return MessageDocument; }),
9558
9663
  classTransformer.Expose()
@@ -9814,42 +9919,6 @@
9814
9919
  AlphabetColorsEnum["Z"] = "#E3C9CE";
9815
9920
  })(exports.AlphabetColorsEnum || (exports.AlphabetColorsEnum = {}));
9816
9921
 
9817
- /**
9818
- * List of objects grouped by passed property
9819
- */
9820
- var Dictionary = /** @class */ (function () {
9821
- function Dictionary(items, path) {
9822
- if (path === void 0) { path = 'id'; }
9823
- this.items = {};
9824
- if (!items.length) {
9825
- return;
9826
- }
9827
- // Do nothing if provided path was not found in the 1st item
9828
- if (!hasIn__default["default"](items[0], path.split('.')[0])) {
9829
- return;
9830
- }
9831
- this.groupItems(items, path);
9832
- }
9833
- Dictionary.prototype.add = function (key, value) {
9834
- this.items[key] = value;
9835
- };
9836
- Dictionary.prototype.get = function (key) {
9837
- return this.items[key] !== undefined ? this.items[key] : null;
9838
- };
9839
- Dictionary.prototype.groupItems = function (items, path) {
9840
- var _this = this;
9841
- items.forEach(function (item) {
9842
- var key = get__default["default"](item, path);
9843
- // if object does not have property for grouping it will be grouped as 'other'
9844
- if (key === undefined) {
9845
- key = 'other';
9846
- }
9847
- _this.items[key] = item;
9848
- });
9849
- };
9850
- return Dictionary;
9851
- }());
9852
-
9853
9922
  exports.DepreciationGroupEnum = void 0;
9854
9923
  (function (DepreciationGroupEnum) {
9855
9924
  DepreciationGroupEnum[DepreciationGroupEnum["BUILDING_IMPROVEMENTS"] = 0] = "BUILDING_IMPROVEMENTS";
@@ -12637,6 +12706,9 @@
12637
12706
  if (property.documentFile) {
12638
12707
  _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.PROPERTY_UPDATED_WITH_DOCUMENT, property));
12639
12708
  }
12709
+ else {
12710
+ _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.PROPERTY_UPDATED, property));
12711
+ }
12640
12712
  return updatedProperty;
12641
12713
  }));
12642
12714
  };
@@ -13168,6 +13240,7 @@
13168
13240
  this.listenReceiptAdded();
13169
13241
  this.listenReceiptDeleted();
13170
13242
  this.listenVehicleClaimChanges();
13243
+ this.listenPropertyForecastUpdate();
13171
13244
  };
13172
13245
  /**
13173
13246
  * get list of all user's TaxTank transactions
@@ -13468,6 +13541,16 @@
13468
13541
  _this.resetCache();
13469
13542
  });
13470
13543
  };
13544
+ /**
13545
+ * property forecast includes claimPercent which affects property related expenses
13546
+ * @TODO Alex move to forecast api instead of property
13547
+ */
13548
+ TransactionService.prototype.listenPropertyForecastUpdate = function () {
13549
+ var _this = this;
13550
+ this.eventDispatcherService.on([exports.AppEventTypeEnum.PROPERTY_UPDATED]).subscribe(function () {
13551
+ _this.resetCache();
13552
+ });
13553
+ };
13471
13554
  TransactionService.prototype.replaceInCache = function (transactionToReplace) {
13472
13555
  replace(this.cache, transactionToReplace);
13473
13556
  this.updateCache();
@@ -17448,7 +17531,7 @@
17448
17531
  * We take the first forecast because income sources available only for new business, so we have only one forecast
17449
17532
  */
17450
17533
  get: function () {
17451
- if (!this.business.id) {
17534
+ if (this.business.id) {
17452
17535
  return null;
17453
17536
  }
17454
17537
  return this.get('incomeSource').get('soleForecasts').at(0);
@@ -17461,7 +17544,7 @@
17461
17544
  * We take the first loss because losses available only for new business, so we have only one loss
17462
17545
  */
17463
17546
  get: function () {
17464
- if (!this.business.id) {
17547
+ if (this.business.id) {
17465
17548
  return null;
17466
17549
  }
17467
17550
  return this.get('losses').at(0);
@@ -17619,7 +17702,8 @@
17619
17702
  items: new forms.FormArray((invoice.items || [classTransformer.plainToClass(SoleInvoiceItem, {})]).map(function (item) { return new SoleInvoiceItemForm(item); })),
17620
17703
  payer: new forms.FormControl(invoice.payer, forms.Validators.required),
17621
17704
  taxType: new forms.FormControl(invoice.taxType, forms.Validators.required),
17622
- bankAccount: new forms.FormControl(invoice.bankAccount, forms.Validators.required)
17705
+ bankAccount: new forms.FormControl(invoice.bankAccount, forms.Validators.required),
17706
+ reference: new forms.FormControl(invoice.reference)
17623
17707
  }, invoice) || this;
17624
17708
  _this.soleDetailsGST = soleDetailsGST;
17625
17709
  // we need invoice template only for new invoices
@@ -18867,6 +18951,7 @@
18867
18951
  exports.ChartData = ChartData;
18868
18952
  exports.ChartSerie = ChartSerie;
18869
18953
  exports.Chat = Chat;
18954
+ exports.ChatCollection = ChatCollection;
18870
18955
  exports.ChatService = ChatService;
18871
18956
  exports.ClientCollection = ClientCollection;
18872
18957
  exports.ClientDetails = ClientDetails;