taxtank-core 0.28.4 → 0.28.7

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 (41) hide show
  1. package/bundles/taxtank-core.umd.js +328 -49
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/db/Enums/user-event-type-type.enum.js +48 -0
  4. package/esm2015/lib/db/Models/bank/bank.js +1 -1
  5. package/esm2015/lib/forms/index.js +2 -1
  6. package/esm2015/lib/forms/property/index.js +2 -0
  7. package/esm2015/lib/forms/property/property-sale/index.js +4 -0
  8. package/esm2015/lib/forms/property/property-sale/property-sale-cost-base.form.js +39 -0
  9. package/esm2015/lib/forms/property/property-sale/property-sale-cost-sale.form.js +74 -0
  10. package/esm2015/lib/forms/property/property-sale/property-sale-exemptions.form.js +75 -0
  11. package/esm2015/lib/models/bank/bank-connection.js +2 -2
  12. package/esm2015/lib/models/endpoint/endpoints.const.js +2 -1
  13. package/esm2015/lib/models/notification/notification.js +1 -1
  14. package/esm2015/lib/models/property/property-sale/index.js +6 -0
  15. package/esm2015/lib/models/property/property-sale/property-sale-cost-base.js +20 -0
  16. package/esm2015/lib/services/http/bank/bank-connection/bank-connection.service.js +13 -4
  17. package/esm2015/lib/services/http/bank/bank-transaction/bank-transaction.service.js +3 -3
  18. package/esm2015/lib/services/http/bank/bank.service.js +2 -2
  19. package/esm2015/lib/services/http/bank/basiq/basiq.service.js +3 -3
  20. package/esm2015/lib/services/http/firm/client-invite/client-invite.service.js +3 -3
  21. package/esm2015/lib/services/http/firm/client-movement/client-movement.service.js +3 -3
  22. package/esm2015/lib/services/http/service-notification/service-notification.service.js +2 -1
  23. package/esm2015/lib/services/http/tax-review/tax-review.service.js +3 -3
  24. package/esm2015/lib/services/http/transaction/transaction.service.js +8 -4
  25. package/esm2015/public-api.js +2 -5
  26. package/fesm2015/taxtank-core.js +298 -45
  27. package/fesm2015/taxtank-core.js.map +1 -1
  28. package/lib/db/Enums/user-event-type-type.enum.d.ts +46 -0
  29. package/lib/db/Models/bank/bank.d.ts +1 -0
  30. package/lib/forms/index.d.ts +1 -0
  31. package/lib/forms/property/index.d.ts +1 -0
  32. package/lib/forms/property/property-sale/index.d.ts +3 -0
  33. package/lib/forms/property/property-sale/property-sale-cost-base.form.d.ts +14 -0
  34. package/lib/forms/property/property-sale/property-sale-cost-sale.form.d.ts +25 -0
  35. package/lib/forms/property/property-sale/property-sale-exemptions.form.d.ts +26 -0
  36. package/lib/models/notification/notification.d.ts +2 -4
  37. package/lib/models/property/property-sale/index.d.ts +5 -0
  38. package/lib/models/property/property-sale/property-sale-cost-base.d.ts +12 -0
  39. package/lib/services/http/bank/bank-connection/bank-connection.service.d.ts +3 -1
  40. package/package.json +1 -1
  41. package/public-api.d.ts +1 -4
@@ -1072,6 +1072,7 @@
1072
1072
  SOLE_INVOICE_TEMPLATES_POST: new Endpoint('POST', '\\/sole-invoice-templates'),
1073
1073
  SOLE_INVOICE_TEMPLATES_PUT: new Endpoint('PUT', '\\/sole-invoice-templates\\/\\d+'),
1074
1074
  SOLE_INVOICE_TEMPLATES_DELETE: new Endpoint('DELETE', '\\/sole-invoice-templates\\/\\d+'),
1075
+ TAX_EXEMPTIONS_GET: new Endpoint('GET', '\\/tax-exemptions'),
1075
1076
  TAX_CALCULATION_POST: new Endpoint('POST', '\\/tax-calculation'),
1076
1077
  TAX_REVIEWS_GET: new Endpoint('GET', '\\/tax-reviews'),
1077
1078
  TAX_REVIEWS_DELETE: new Endpoint('DELETE', '\\/tax-reviews\\/\\d+'),
@@ -1176,35 +1177,6 @@
1176
1177
  type: i0.Injectable
1177
1178
  }], ctorParameters: function () { return [{ type: PreloaderService }]; } });
1178
1179
 
1179
- exports.UserEventTypeClientTypeEnum = void 0;
1180
- (function (UserEventTypeClientTypeEnum) {
1181
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["SUBSCRIBED"] = 2000] = "SUBSCRIBED";
1182
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["UNSUBSCRIBED"] = 2001] = "UNSUBSCRIBED";
1183
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["SUBSCRIPTION_UPDATE"] = 2004] = "SUBSCRIPTION_UPDATE";
1184
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["SUBSCRIPTION_TRIAL_UPDATE"] = 2005] = "SUBSCRIPTION_TRIAL_UPDATE";
1185
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CLIENT_INVITE"] = 2010] = "CLIENT_INVITE";
1186
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CLIENT_INVITE_TO_REGISTER"] = 2011] = "CLIENT_INVITE_TO_REGISTER";
1187
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_ACCEPTED"] = 2012] = "FIRM_INVITE_ACCEPTED";
1188
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_REJECTED"] = 2013] = "FIRM_INVITE_REJECTED";
1189
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_REGISTERED"] = 2014] = "FIRM_INVITE_REGISTERED";
1190
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE"] = 2020] = "PROPERTY_SHARE_INVITE";
1191
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_TO_REGISTER"] = 2021] = "PROPERTY_SHARE_INVITE_TO_REGISTER";
1192
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_ACCEPTED"] = 2022] = "PROPERTY_SHARE_INVITE_ACCEPTED";
1193
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_REJECTED"] = 2023] = "PROPERTY_SHARE_INVITE_REJECTED";
1194
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_REGISTERED"] = 2024] = "PROPERTY_SHARE_INVITE_REGISTERED";
1195
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_CHANGE_REQUESTED"] = 2025] = "PROPERTY_SHARE_CHANGE_REQUESTED";
1196
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_CHANGE_ACCEPTED"] = 2026] = "PROPERTY_SHARE_CHANGE_ACCEPTED";
1197
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_CHANGE_REJECTED"] = 2027] = "PROPERTY_SHARE_CHANGE_REJECTED";
1198
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_NEW_ACCOUNTS"] = 2030] = "BASIQ_NEW_ACCOUNTS";
1199
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_FIRST_IMPORT_COMPLETE"] = 2031] = "BASIQ_FIRST_IMPORT_COMPLETE";
1200
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_AUTHORIZATION_FAIL"] = 2032] = "BASIQ_AUTHORIZATION_FAIL";
1201
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["TRANSACTION_ALLOCATE_REMINDER"] = 2033] = "TRANSACTION_ALLOCATE_REMINDER";
1202
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["REGISTRATION_INVITE"] = 2040] = "REGISTRATION_INVITE";
1203
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["REGISTRATION_INVITE_ACCEPTED"] = 2041] = "REGISTRATION_INVITE_ACCEPTED";
1204
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["EMAIL_CONFIRMED"] = 2050] = "EMAIL_CONFIRMED";
1205
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["TAX_REVIEW_REQUESTED"] = 2060] = "TAX_REVIEW_REQUESTED";
1206
- })(exports.UserEventTypeClientTypeEnum || (exports.UserEventTypeClientTypeEnum = {}));
1207
-
1208
1180
  // replace array element with the new one (only arrays of objects)
1209
1181
  function replace(array, item, matchField) {
1210
1182
  if (matchField === void 0) { matchField = 'id'; }
@@ -5577,7 +5549,7 @@
5577
5549
  * login required for new or disconnected external connections
5578
5550
  */
5579
5551
  BankConnection.prototype.isLoginRequired = function () {
5580
- return !!(!this.id && this.bank.externalId) || this.isInvalid();
5552
+ return !!(!this.id && this.bank.externalId && !this.bank.isManual) || this.isInvalid();
5581
5553
  };
5582
5554
  BankConnection.prototype.setPending = function () {
5583
5555
  this.status = exports.BankConnectionStatusEnum.PENDING;
@@ -5887,6 +5859,54 @@
5887
5859
  return BankAccountCollection;
5888
5860
  }(Collection));
5889
5861
 
5862
+ var UserEventTypeTypeEnum;
5863
+ (function (UserEventTypeTypeEnum) {
5864
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTERED"] = 1000] = "REGISTERED";
5865
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PASSWORD_RESET_REQUEST"] = 1001] = "PASSWORD_RESET_REQUEST";
5866
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["APP_FEATURES"] = 1010] = "APP_FEATURES";
5867
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIBED"] = 2000] = "SUBSCRIBED";
5868
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["UNSUBSCRIBED"] = 2001] = "UNSUBSCRIBED";
5869
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_UPDATE"] = 2004] = "SUBSCRIPTION_UPDATE";
5870
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_TRIAL_UPDATE"] = 2005] = "SUBSCRIPTION_TRIAL_UPDATE";
5871
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_PAYMENT_FAILED"] = 2006] = "SUBSCRIPTION_PAYMENT_FAILED";
5872
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE"] = 2010] = "CLIENT_INVITE";
5873
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_TO_REGISTER"] = 2011] = "CLIENT_INVITE_TO_REGISTER";
5874
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_ACCEPTED"] = 2012] = "FIRM_INVITE_ACCEPTED";
5875
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_REJECTED"] = 2013] = "FIRM_INVITE_REJECTED";
5876
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_REGISTERED"] = 2014] = "FIRM_INVITE_REGISTERED";
5877
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE"] = 2020] = "PROPERTY_SHARE_INVITE";
5878
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_TO_REGISTER"] = 2021] = "PROPERTY_SHARE_INVITE_TO_REGISTER";
5879
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_ACCEPTED"] = 2022] = "PROPERTY_SHARE_INVITE_ACCEPTED";
5880
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_REJECTED"] = 2023] = "PROPERTY_SHARE_INVITE_REJECTED";
5881
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_REGISTERED"] = 2024] = "PROPERTY_SHARE_INVITE_REGISTERED";
5882
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_REQUESTED"] = 2025] = "PROPERTY_SHARE_CHANGE_REQUESTED";
5883
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_ACCEPTED"] = 2026] = "PROPERTY_SHARE_CHANGE_ACCEPTED";
5884
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_REJECTED"] = 2027] = "PROPERTY_SHARE_CHANGE_REJECTED";
5885
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["OWNER_SUBSCRIBED"] = 2028] = "OWNER_SUBSCRIBED";
5886
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["OWNER_UNSUBSCRIBED"] = 2029] = "OWNER_UNSUBSCRIBED";
5887
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_NEW_ACCOUNTS"] = 2030] = "BASIQ_NEW_ACCOUNTS";
5888
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_FIRST_IMPORT_COMPLETE"] = 2031] = "BASIQ_FIRST_IMPORT_COMPLETE";
5889
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_AUTHORIZATION_FAIL"] = 2032] = "BASIQ_AUTHORIZATION_FAIL";
5890
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["TRANSACTION_ALLOCATE_REMINDER"] = 2033] = "TRANSACTION_ALLOCATE_REMINDER";
5891
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTRATION_INVITE"] = 2040] = "REGISTRATION_INVITE";
5892
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTRATION_INVITE_ACCEPTED"] = 2041] = "REGISTRATION_INVITE_ACCEPTED";
5893
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_EMAIL_CONFIRMED"] = 2050] = "CLIENT_EMAIL_CONFIRMED";
5894
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["TAX_REVIEW_REQUESTED"] = 2060] = "TAX_REVIEW_REQUESTED";
5895
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_TO_REGISTER"] = 3000] = "FIRM_INVITE_TO_REGISTER";
5896
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE"] = 3001] = "FIRM_INVITE";
5897
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_ACCEPTED"] = 3002] = "CLIENT_INVITE_ACCEPTED";
5898
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_REJECTED"] = 3003] = "CLIENT_INVITE_REJECTED";
5899
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_REGISTERED"] = 3004] = "CLIENT_INVITE_REGISTERED";
5900
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_NEW_CLIENT"] = 3005] = "FIRM_NEW_CLIENT";
5901
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_LOST_CLIENT"] = 3006] = "FIRM_LOST_CLIENT";
5902
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_INVITE"] = 3010] = "EMPLOYEE_INVITE";
5903
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_LOST_CLIENT"] = 3011] = "EMPLOYEE_LOST_CLIENT";
5904
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_NEW_CLIENT"] = 3012] = "EMPLOYEE_NEW_CLIENT";
5905
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_INVITE_ACCEPTED"] = 3013] = "EMPLOYEE_INVITE_ACCEPTED";
5906
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_EMAIL_CONFIRMED"] = 3020] = "EMPLOYEE_EMAIL_CONFIRMED";
5907
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["TAX_REVIEW_RECEIVED"] = 3030] = "TAX_REVIEW_RECEIVED";
5908
+ })(UserEventTypeTypeEnum || (UserEventTypeTypeEnum = {}));
5909
+
5890
5910
  /**
5891
5911
  * any event happened in the app, which needs to be handled somehow (distributed to other part of the app)
5892
5912
  */
@@ -5944,18 +5964,27 @@
5944
5964
  });
5945
5965
  };
5946
5966
  /**
5947
- * Update cache when basiq login failed to get actual connections statuses
5967
+ * Update cache when basiq accounts were retrieved or login to basic was failed to get actual connections statuses
5948
5968
  */
5949
5969
  BankConnectionService.prototype.listenNotifications = function () {
5950
5970
  var _this = this;
5971
+ // @TODO vik listen sse when backend updated
5951
5972
  this.eventDispatcherService.on(exports.AppEventTypeEnum.NOTIFICATION_ADDED).subscribe(function (notification) {
5952
- if (!notification.isRead && notification.eventType === exports.UserEventTypeClientTypeEnum.BASIQ_AUTHORIZATION_FAIL) {
5973
+ // @Todo TT-2280 Alex refactor ServiceNotification isRead logic. We don't need to know here whether notification was read or not
5974
+ if (!notification.isRead) {
5975
+ return;
5976
+ }
5977
+ if (BankConnectionService.userEventTypes.includes(notification.eventType)) {
5953
5978
  _this.resetCache();
5954
5979
  }
5955
5980
  });
5956
5981
  };
5957
5982
  return BankConnectionService;
5958
5983
  }(RestService));
5984
+ BankConnectionService.userEventTypes = [
5985
+ UserEventTypeTypeEnum.BASIQ_NEW_ACCOUNTS,
5986
+ UserEventTypeTypeEnum.BASIQ_AUTHORIZATION_FAIL
5987
+ ];
5959
5988
  BankConnectionService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: BankConnectionService, deps: null, target: i0__namespace.ɵɵFactoryTarget.Injectable });
5960
5989
  BankConnectionService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: BankConnectionService, providedIn: 'root' });
5961
5990
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: BankConnectionService, decorators: [{
@@ -6050,7 +6079,7 @@
6050
6079
  BasiqService.prototype.listenNotifications = function () {
6051
6080
  var _this = this;
6052
6081
  this.eventDispatcherService.on(exports.AppEventTypeEnum.NOTIFICATION_ADDED).subscribe(function (notification) {
6053
- if (!notification.isRead && notification.eventType === exports.UserEventTypeClientTypeEnum.BASIQ_NEW_ACCOUNTS) {
6082
+ if (!notification.isRead && notification.eventType === UserEventTypeTypeEnum.BASIQ_NEW_ACCOUNTS) {
6054
6083
  _this.resetCache();
6055
6084
  }
6056
6085
  });
@@ -8758,6 +8787,35 @@
8758
8787
  UserEventTypeEmployeeTypeEnum[UserEventTypeEmployeeTypeEnum["TAX_REVIEW_REQUESTED"] = 3030] = "TAX_REVIEW_REQUESTED";
8759
8788
  })(exports.UserEventTypeEmployeeTypeEnum || (exports.UserEventTypeEmployeeTypeEnum = {}));
8760
8789
 
8790
+ exports.UserEventTypeClientTypeEnum = void 0;
8791
+ (function (UserEventTypeClientTypeEnum) {
8792
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["SUBSCRIBED"] = 2000] = "SUBSCRIBED";
8793
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["UNSUBSCRIBED"] = 2001] = "UNSUBSCRIBED";
8794
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["SUBSCRIPTION_UPDATE"] = 2004] = "SUBSCRIPTION_UPDATE";
8795
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["SUBSCRIPTION_TRIAL_UPDATE"] = 2005] = "SUBSCRIPTION_TRIAL_UPDATE";
8796
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CLIENT_INVITE"] = 2010] = "CLIENT_INVITE";
8797
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CLIENT_INVITE_TO_REGISTER"] = 2011] = "CLIENT_INVITE_TO_REGISTER";
8798
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_ACCEPTED"] = 2012] = "FIRM_INVITE_ACCEPTED";
8799
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_REJECTED"] = 2013] = "FIRM_INVITE_REJECTED";
8800
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_REGISTERED"] = 2014] = "FIRM_INVITE_REGISTERED";
8801
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE"] = 2020] = "PROPERTY_SHARE_INVITE";
8802
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_TO_REGISTER"] = 2021] = "PROPERTY_SHARE_INVITE_TO_REGISTER";
8803
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_ACCEPTED"] = 2022] = "PROPERTY_SHARE_INVITE_ACCEPTED";
8804
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_REJECTED"] = 2023] = "PROPERTY_SHARE_INVITE_REJECTED";
8805
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_REGISTERED"] = 2024] = "PROPERTY_SHARE_INVITE_REGISTERED";
8806
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_CHANGE_REQUESTED"] = 2025] = "PROPERTY_SHARE_CHANGE_REQUESTED";
8807
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_CHANGE_ACCEPTED"] = 2026] = "PROPERTY_SHARE_CHANGE_ACCEPTED";
8808
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_CHANGE_REJECTED"] = 2027] = "PROPERTY_SHARE_CHANGE_REJECTED";
8809
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_NEW_ACCOUNTS"] = 2030] = "BASIQ_NEW_ACCOUNTS";
8810
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_FIRST_IMPORT_COMPLETE"] = 2031] = "BASIQ_FIRST_IMPORT_COMPLETE";
8811
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_AUTHORIZATION_FAIL"] = 2032] = "BASIQ_AUTHORIZATION_FAIL";
8812
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["TRANSACTION_ALLOCATE_REMINDER"] = 2033] = "TRANSACTION_ALLOCATE_REMINDER";
8813
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["REGISTRATION_INVITE"] = 2040] = "REGISTRATION_INVITE";
8814
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["REGISTRATION_INVITE_ACCEPTED"] = 2041] = "REGISTRATION_INVITE_ACCEPTED";
8815
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["EMAIL_CONFIRMED"] = 2050] = "EMAIL_CONFIRMED";
8816
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["TAX_REVIEW_REQUESTED"] = 2060] = "TAX_REVIEW_REQUESTED";
8817
+ })(exports.UserEventTypeClientTypeEnum || (exports.UserEventTypeClientTypeEnum = {}));
8818
+
8761
8819
  exports.UserMedicareExemptionEnum = void 0;
8762
8820
  (function (UserMedicareExemptionEnum) {
8763
8821
  UserMedicareExemptionEnum[UserMedicareExemptionEnum["NO"] = 0] = "NO";
@@ -10333,6 +10391,34 @@
10333
10391
  classTransformer.Type(function () { return PropertySaleTaxExemptionMetadata$1; })
10334
10392
  ], PropertySale.prototype, "taxExemptionMetadata", void 0);
10335
10393
 
10394
+ /**
10395
+ * @Todo TT-2143 should be removed when PropertySaleCostBaseForm refactored (cut property to separated form)
10396
+ */
10397
+ var PropertySaleCostBase = /** @class */ (function () {
10398
+ function PropertySaleCostBase() {
10399
+ }
10400
+ PropertySaleCostBase.createFrom = function (property, propertySale, depreciations, holdingCosts) {
10401
+ var _a, _b, _c;
10402
+ return classTransformer.plainToClass(PropertySaleCostBase, {
10403
+ property: classTransformer.plainToClass(Property, property),
10404
+ sale: classTransformer.plainToClass(PropertySale, Object.assign({}, propertySale, {
10405
+ holdingCosts: (_a = propertySale.holdingCosts) !== null && _a !== void 0 ? _a : Math.abs(holdingCosts.sumBy('amount')),
10406
+ structuralImprovementsWDV: (_b = propertySale.structuralImprovementsWDV) !== null && _b !== void 0 ? _b : depreciations.getWithCapitalProject().getCloseBalanceByYear(),
10407
+ buildingAtCostClaimed: (_c = propertySale.buildingAtCostClaimed) !== null && _c !== void 0 ? _c : depreciations.getWithoutCapitalProject().getClaimedAmountByYear(),
10408
+ })),
10409
+ });
10410
+ };
10411
+ return PropertySaleCostBase;
10412
+ }());
10413
+
10414
+ var PropertySaleTaxExemptionMetadata = /** @class */ (function (_super) {
10415
+ __extends(PropertySaleTaxExemptionMetadata, _super);
10416
+ function PropertySaleTaxExemptionMetadata() {
10417
+ return _super !== null && _super.apply(this, arguments) || this;
10418
+ }
10419
+ return PropertySaleTaxExemptionMetadata;
10420
+ }(PropertySaleTaxExemptionMetadata$1));
10421
+
10336
10422
  var TaxExemption$1 = /** @class */ (function (_super) {
10337
10423
  __extends(TaxExemption, _super);
10338
10424
  function TaxExemption() {
@@ -10365,14 +10451,6 @@
10365
10451
  return TaxExemptionMetadata;
10366
10452
  }(TaxExemptionMetadata$1));
10367
10453
 
10368
- var PropertySaleTaxExemptionMetadata = /** @class */ (function (_super) {
10369
- __extends(PropertySaleTaxExemptionMetadata, _super);
10370
- function PropertySaleTaxExemptionMetadata() {
10371
- return _super !== null && _super.apply(this, arguments) || this;
10372
- }
10373
- return PropertySaleTaxExemptionMetadata;
10374
- }(PropertySaleTaxExemptionMetadata$1));
10375
-
10376
10454
  /**
10377
10455
  * @Todo waiting for the Sole tank implementation
10378
10456
  */
@@ -12848,9 +12926,12 @@
12848
12926
  * Get list of property holding costs (transactions related to vacant land property)
12849
12927
  */
12850
12928
  TransactionService.prototype.getPropertyHoldingCosts = function (propertyId) {
12851
- return this.http.get(this.environment.apiV2 + "/" + this.url + "?propertyId=" + propertyId + "&propertyCategoryId=" + exports.PropertyCategoryListEnum.VACANT_LAND)
12852
- .pipe(operators.map(function (transactionsBase) {
12853
- return transactionsBase.map(function (transactionBase) { return classTransformer.plainToClass(Transaction, transactionBase); });
12929
+ return this.get()
12930
+ .pipe(operators.map(function (transactions) {
12931
+ return new TransactionCollection(transactions)
12932
+ .filterBy('property.id', propertyId)
12933
+ .filterBy('property.category.id', exports.PropertyCategoryListEnum.VACANT_LAND)
12934
+ .toArray();
12854
12935
  }));
12855
12936
  };
12856
12937
  /**
@@ -13338,7 +13419,7 @@
13338
13419
  BankService.prototype.get = function () {
13339
13420
  return _super.prototype.get.call(this).pipe(operators.map(function (banks) {
13340
13421
  // exclude basiq banks without login fields (basiq may return broken banks without loginFields)
13341
- return banks.filter(function (bank) { return !bank.externalId || (bank.externalId && bank.loginFields); });
13422
+ return banks.filter(function (bank) { return bank.isManual || (bank.externalId && bank.loginFields); });
13342
13423
  }));
13343
13424
  };
13344
13425
  return BankService;
@@ -13508,7 +13589,7 @@
13508
13589
  BankTransactionService.prototype.listenBankTransactionsImport = function () {
13509
13590
  var _this = this;
13510
13591
  this.eventDispatcherService.on(exports.AppEventTypeEnum.NOTIFICATION_ADDED).subscribe(function (notification) {
13511
- if (!notification.isRead && notification.eventType === exports.UserEventTypeClientTypeEnum.BASIQ_FIRST_IMPORT_COMPLETE) {
13592
+ if (!notification.isRead && notification.eventType === UserEventTypeTypeEnum.BASIQ_FIRST_IMPORT_COMPLETE) {
13512
13593
  _this.resetCache();
13513
13594
  }
13514
13595
  });
@@ -14070,7 +14151,7 @@
14070
14151
  ClientInviteService.prototype.listenNotifications = function () {
14071
14152
  var _this = this;
14072
14153
  this.eventDispatcherService.on(exports.AppEventTypeEnum.NOTIFICATION_ADDED).subscribe(function (notification) {
14073
- if (!notification.isRead && (notification.eventType === exports.UserEventTypeClientTypeEnum.FIRM_INVITE_ACCEPTED || notification.eventType === exports.UserEventTypeClientTypeEnum.CLIENT_INVITE)) {
14154
+ if (!notification.isRead && (notification.eventType === UserEventTypeTypeEnum.FIRM_INVITE_ACCEPTED || notification.eventType === UserEventTypeTypeEnum.CLIENT_INVITE)) {
14074
14155
  _this.resetCache();
14075
14156
  }
14076
14157
  });
@@ -14149,7 +14230,7 @@
14149
14230
  ClientMovementService.prototype.listenNotifications = function () {
14150
14231
  var _this = this;
14151
14232
  this.eventDispatcherService.on(exports.AppEventTypeEnum.NOTIFICATION_ADDED).subscribe(function (notification) {
14152
- if (!notification.isRead && notification.eventType === exports.UserEventTypeClientTypeEnum.FIRM_INVITE_ACCEPTED) {
14233
+ if (!notification.isRead && notification.eventType === UserEventTypeTypeEnum.FIRM_INVITE_ACCEPTED) {
14153
14234
  _this.resetCache();
14154
14235
  }
14155
14236
  });
@@ -15231,6 +15312,7 @@
15231
15312
  }
15232
15313
  _this.cache = cache;
15233
15314
  _this.cacheSubject.next(_this.cache);
15315
+ // @TODO TT-2280 Alex wrong event, it's updated, added or deleted. Not just added
15234
15316
  _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.NOTIFICATION_ADDED, notification));
15235
15317
  });
15236
15318
  };
@@ -16260,7 +16342,7 @@
16260
16342
  TaxReviewService.prototype.listenNotifications = function () {
16261
16343
  var _this = this;
16262
16344
  this.eventDispatcherService.on(exports.AppEventTypeEnum.NOTIFICATION_ADDED).subscribe(function (notification) {
16263
- if (!notification.isRead && notification.eventType === exports.UserEventTypeClientTypeEnum.FIRM_INVITE_ACCEPTED) {
16345
+ if (!notification.isRead && notification.eventType === UserEventTypeTypeEnum.FIRM_INVITE_ACCEPTED) {
16264
16346
  _this.resetCache();
16265
16347
  }
16266
16348
  });
@@ -17650,6 +17732,199 @@
17650
17732
  return UserInviteForm;
17651
17733
  }(AbstractForm));
17652
17734
 
17735
+ /**
17736
+ * @Todo TT-2143 remove Property stuff and use this form just for PropertySale
17737
+ * @Todo TT-2143 create and extend from abstract PropertySale form
17738
+ */
17739
+ var PropertySaleCostBaseForm = /** @class */ (function (_super) {
17740
+ __extends(PropertySaleCostBaseForm, _super);
17741
+ function PropertySaleCostBaseForm(propertySaleCostBase) {
17742
+ var _this = _super.call(this, {
17743
+ property: new forms.FormGroup({
17744
+ purchasePrice: new forms.FormControl(propertySaleCostBase.property.purchasePrice, forms.Validators.required),
17745
+ contractDate: new forms.FormControl(propertySaleCostBase.property.contractDate, forms.Validators.required),
17746
+ stampDuty: new forms.FormControl(propertySaleCostBase.property.stampDuty, forms.Validators.required),
17747
+ legalFees: new forms.FormControl(propertySaleCostBase.property.legalFees, forms.Validators.required),
17748
+ otherCapitalCosts: new forms.FormControl(propertySaleCostBase.property.otherCapitalCosts, forms.Validators.required),
17749
+ }),
17750
+ sale: new forms.FormGroup({
17751
+ holdingCosts: new forms.FormControl(propertySaleCostBase.sale.holdingCosts),
17752
+ structuralImprovementsWDV: new forms.FormControl(propertySaleCostBase.sale.structuralImprovementsWDV),
17753
+ buildingAtCostClaimed: new forms.FormControl(propertySaleCostBase.sale.buildingAtCostClaimed)
17754
+ })
17755
+ }, propertySaleCostBase) || this;
17756
+ _this.propertySaleCostBase = propertySaleCostBase;
17757
+ return _this;
17758
+ }
17759
+ PropertySaleCostBaseForm.prototype.getProperty = function () {
17760
+ return classTransformer.plainToClass(Property, Object.assign({}, this.propertySaleCostBase.property, this.get('property').value));
17761
+ };
17762
+ PropertySaleCostBaseForm.prototype.getPropertySale = function () {
17763
+ return classTransformer.plainToClass(PropertySale, Object.assign({}, this.propertySaleCostBase.sale, this.get('sale').value));
17764
+ };
17765
+ PropertySaleCostBaseForm.prototype.submit = function (data) {
17766
+ if (data === void 0) { data = {}; }
17767
+ Object.assign(data, { property: classTransformer.plainToClass(Property, Object.assign({}, this.propertySaleCostBase.property, this.get('property').value)) }, { sale: classTransformer.plainToClass(PropertySale, Object.assign({}, this.propertySaleCostBase.sale, this.get('sale').value)) });
17768
+ return _super.prototype.submit.call(this, data);
17769
+ };
17770
+ return PropertySaleCostBaseForm;
17771
+ }(AbstractForm));
17772
+
17773
+ /**
17774
+ * @Todo TT-2143 Create and extend from abstract PropertySale form
17775
+ */
17776
+ var PropertySaleCostSaleForm = /** @class */ (function (_super) {
17777
+ __extends(PropertySaleCostSaleForm, _super);
17778
+ function PropertySaleCostSaleForm(propertySale, property) {
17779
+ var _this = _super.call(this, {
17780
+ price: new forms.FormControl(propertySale.price, forms.Validators.required),
17781
+ contractDate: new forms.FormControl(propertySale.contractDate, forms.Validators.required),
17782
+ settlementDate: new forms.FormControl(propertySale.settlementDate, forms.Validators.required),
17783
+ commission: new forms.FormControl(propertySale.commission || 0, forms.Validators.required),
17784
+ legalFees: new forms.FormControl(propertySale.legalFees || 0, forms.Validators.required),
17785
+ otherCost: new forms.FormControl(propertySale.otherCost || 0, forms.Validators.required),
17786
+ capitalLoss: new forms.FormControl(propertySale.capitalLoss || 0, forms.Validators.required),
17787
+ // capital gain tax
17788
+ grossCGT: new forms.FormControl({ value: propertySale.grossCGT, disabled: true }, forms.Validators.required),
17789
+ }, propertySale) || this;
17790
+ _this.propertySale = propertySale;
17791
+ _this.property = property;
17792
+ _this.updateGrossCGT();
17793
+ _this.listenEvents();
17794
+ return _this;
17795
+ }
17796
+ PropertySaleCostSaleForm.prototype.listenEvents = function () {
17797
+ this.listenCommissionUpdated();
17798
+ this.listenLegalFeesUpdated();
17799
+ this.listenOtherCostUpdated();
17800
+ this.listenPriceUpdated();
17801
+ this.listenCapitalLossUpdated();
17802
+ };
17803
+ /**
17804
+ * Get property instance based on provided property and form value to get actual form calculations
17805
+ * @Todo TT-2143 Move to parent abstract PropertySale form
17806
+ */
17807
+ PropertySaleCostSaleForm.prototype.getPropertySale = function () {
17808
+ return classTransformer.plainToClass(PropertySale, Object.assign({}, this.propertySale, this.getRawValue()));
17809
+ };
17810
+ PropertySaleCostSaleForm.prototype.submit = function (data) {
17811
+ if (data === void 0) { data = {}; }
17812
+ // 'grossCGT' field is always disabled, but we need it to submit result
17813
+ Object.assign(data, { grossCGT: this.get('grossCGT').value });
17814
+ return _super.prototype.submit.call(this, data);
17815
+ };
17816
+ PropertySaleCostSaleForm.prototype.updateGrossCGT = function () {
17817
+ this.get('grossCGT').setValue(Math.round(this.property.calculateCGT(this.getPropertySale())).toFixed());
17818
+ };
17819
+ PropertySaleCostSaleForm.prototype.listenCommissionUpdated = function () {
17820
+ var _this = this;
17821
+ this.get('commission').valueChanges.subscribe(function () {
17822
+ _this.updateGrossCGT();
17823
+ });
17824
+ };
17825
+ PropertySaleCostSaleForm.prototype.listenLegalFeesUpdated = function () {
17826
+ var _this = this;
17827
+ this.get('legalFees').valueChanges.subscribe(function () {
17828
+ _this.updateGrossCGT();
17829
+ });
17830
+ };
17831
+ PropertySaleCostSaleForm.prototype.listenOtherCostUpdated = function () {
17832
+ var _this = this;
17833
+ this.get('otherCost').valueChanges.subscribe(function () {
17834
+ _this.updateGrossCGT();
17835
+ });
17836
+ };
17837
+ PropertySaleCostSaleForm.prototype.listenPriceUpdated = function () {
17838
+ var _this = this;
17839
+ this.get('price').valueChanges.subscribe(function () {
17840
+ _this.updateGrossCGT();
17841
+ });
17842
+ };
17843
+ PropertySaleCostSaleForm.prototype.listenCapitalLossUpdated = function () {
17844
+ var _this = this;
17845
+ this.get('capitalLoss').valueChanges.subscribe(function () {
17846
+ _this.updateGrossCGT();
17847
+ });
17848
+ };
17849
+ return PropertySaleCostSaleForm;
17850
+ }(AbstractForm));
17851
+
17852
+ /**
17853
+ * @Todo TT-2143 Create and extend from abstract PropertySale form
17854
+ */
17855
+ var PropertySaleExemptionsForm = /** @class */ (function (_super) {
17856
+ __extends(PropertySaleExemptionsForm, _super);
17857
+ function PropertySaleExemptionsForm(propertySale, property, taxExemptions) {
17858
+ var _this = this;
17859
+ var _a, _b;
17860
+ _this = _super.call(this, {
17861
+ taxExemption: new forms.FormControl(taxExemptions.findBy('id', (_b = (_a = propertySale.taxExemption) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : property.getCGTExemption(propertySale))),
17862
+ taxExemptionMetadata: new forms.FormArray([]),
17863
+ netCGT: new forms.FormControl(propertySale.netCGT)
17864
+ }, propertySale) || this;
17865
+ _this.propertySale = propertySale;
17866
+ _this.property = property;
17867
+ _this.taxExemptions = taxExemptions;
17868
+ if (propertySale.taxExemption) {
17869
+ _this.setFormMetadataControls();
17870
+ }
17871
+ _this.updateNetCGT();
17872
+ _this.listenEvents();
17873
+ return _this;
17874
+ }
17875
+ PropertySaleExemptionsForm.prototype.listenEvents = function () {
17876
+ this.listenTaxExemptionUpdated();
17877
+ };
17878
+ /**
17879
+ * @Todo TT-2143 Move to parent abstract PropertySale form
17880
+ */
17881
+ PropertySaleExemptionsForm.prototype.getPropertySale = function () {
17882
+ return classTransformer.plainToClass(PropertySale, Object.assign({}, this.propertySale, this.getRawValue()));
17883
+ };
17884
+ PropertySaleExemptionsForm.prototype.updateNetCGT = function () {
17885
+ this.get('netCGT').setValue(this.property.calculateNetCGT(this.getPropertySale()));
17886
+ };
17887
+ PropertySaleExemptionsForm.prototype.listenTaxExemptionUpdated = function () {
17888
+ var _this = this;
17889
+ this.get('taxExemption').valueChanges.subscribe(function (taxExemption) {
17890
+ _this.updateNetCGT();
17891
+ _this.setFormMetadataControls(taxExemption);
17892
+ });
17893
+ };
17894
+ /**
17895
+ * show metadata related to passed tax exemption or existing property sale metadata
17896
+ */
17897
+ PropertySaleExemptionsForm.prototype.setFormMetadataControls = function (taxExemption) {
17898
+ var _this = this;
17899
+ // use property sale tax exemption if it exists to preselect data
17900
+ var currentTaxExemption = this.propertySale.taxExemption ?
17901
+ this.taxExemptions.findBy('id', this.propertySale.taxExemption.id) :
17902
+ taxExemption;
17903
+ var formArray = this.get('taxExemptionMetadata');
17904
+ // clean up
17905
+ formArray.clear();
17906
+ // show all tax exemption metadata fields
17907
+ currentTaxExemption.metadata.forEach(function (metadata) {
17908
+ // use property sale tax exemption metadata value if it exists
17909
+ var metadataValue = _this.propertySale.taxExemption ?
17910
+ _this.propertySale.taxExemptionMetadata
17911
+ .find(function (saleMetadata) { return saleMetadata.metadata.id === metadata.id; }).value :
17912
+ null;
17913
+ var validators = [
17914
+ // claim percent is optional
17915
+ metadata.id !== exports.TaxExemptionMetadataEnum.CLAIM_PERCENT && forms.Validators.required,
17916
+ // ppr days can't be more than ownership days
17917
+ metadata.id === exports.TaxExemptionMetadataEnum.PPR_DAYS && forms.Validators.max(_this.property.getOwnershipDuration(_this.propertySale))
17918
+ ].filter(Boolean);
17919
+ formArray.push(new forms.FormGroup({
17920
+ metadata: new forms.FormControl(metadata),
17921
+ value: new forms.FormControl(metadataValue, validators)
17922
+ }));
17923
+ });
17924
+ };
17925
+ return PropertySaleExemptionsForm;
17926
+ }(AbstractForm));
17927
+
17653
17928
  /**
17654
17929
  * @Todo waiting for the Sole tank implementation
17655
17930
  */
@@ -18401,6 +18676,10 @@
18401
18676
  exports.PropertyReportItemTransactionCollection = PropertyReportItemTransactionCollection;
18402
18677
  exports.PropertySale = PropertySale;
18403
18678
  exports.PropertySaleCollection = PropertySaleCollection;
18679
+ exports.PropertySaleCostBase = PropertySaleCostBase;
18680
+ exports.PropertySaleCostBaseForm = PropertySaleCostBaseForm;
18681
+ exports.PropertySaleCostSaleForm = PropertySaleCostSaleForm;
18682
+ exports.PropertySaleExemptionsForm = PropertySaleExemptionsForm;
18404
18683
  exports.PropertySaleService = PropertySaleService;
18405
18684
  exports.PropertySaleTaxExemptionMetadata = PropertySaleTaxExemptionMetadata;
18406
18685
  exports.PropertyService = PropertyService;