taxtank-core 0.28.6 → 0.28.8-1

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 (24) hide show
  1. package/bundles/taxtank-core.umd.js +120 -38
  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/forms/bank/bank-account/bank-account-import.form.js +3 -3
  5. package/esm2015/lib/forms/loan/loan.form.js +5 -1
  6. package/esm2015/lib/models/loan/loan-max-number-of-payments.enum.js +3 -2
  7. package/esm2015/lib/models/notification/notification.js +1 -1
  8. package/esm2015/lib/models/service-subscription/service-subscription.js +20 -1
  9. package/esm2015/lib/services/http/bank/bank-connection/bank-connection.service.js +13 -4
  10. package/esm2015/lib/services/http/bank/bank-transaction/bank-transaction.service.js +3 -3
  11. package/esm2015/lib/services/http/bank/basiq/basiq.service.js +3 -3
  12. package/esm2015/lib/services/http/firm/client-invite/client-invite.service.js +3 -3
  13. package/esm2015/lib/services/http/firm/client-movement/client-movement.service.js +3 -3
  14. package/esm2015/lib/services/http/service-notification/service-notification.service.js +2 -1
  15. package/esm2015/lib/services/http/tax-review/tax-review.service.js +3 -3
  16. package/fesm2015/taxtank-core.js +120 -38
  17. package/fesm2015/taxtank-core.js.map +1 -1
  18. package/lib/db/Enums/user-event-type-type.enum.d.ts +46 -0
  19. package/lib/forms/loan/loan.form.d.ts +1 -0
  20. package/lib/models/loan/loan-max-number-of-payments.enum.d.ts +2 -1
  21. package/lib/models/notification/notification.d.ts +2 -4
  22. package/lib/models/service-subscription/service-subscription.d.ts +9 -0
  23. package/lib/services/http/bank/bank-connection/bank-connection.service.d.ts +3 -1
  24. package/package.json +1 -1
@@ -1177,35 +1177,6 @@
1177
1177
  type: i0.Injectable
1178
1178
  }], ctorParameters: function () { return [{ type: PreloaderService }]; } });
1179
1179
 
1180
- exports.UserEventTypeClientTypeEnum = void 0;
1181
- (function (UserEventTypeClientTypeEnum) {
1182
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["SUBSCRIBED"] = 2000] = "SUBSCRIBED";
1183
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["UNSUBSCRIBED"] = 2001] = "UNSUBSCRIBED";
1184
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["SUBSCRIPTION_UPDATE"] = 2004] = "SUBSCRIPTION_UPDATE";
1185
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["SUBSCRIPTION_TRIAL_UPDATE"] = 2005] = "SUBSCRIPTION_TRIAL_UPDATE";
1186
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CLIENT_INVITE"] = 2010] = "CLIENT_INVITE";
1187
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CLIENT_INVITE_TO_REGISTER"] = 2011] = "CLIENT_INVITE_TO_REGISTER";
1188
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_ACCEPTED"] = 2012] = "FIRM_INVITE_ACCEPTED";
1189
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_REJECTED"] = 2013] = "FIRM_INVITE_REJECTED";
1190
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_REGISTERED"] = 2014] = "FIRM_INVITE_REGISTERED";
1191
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE"] = 2020] = "PROPERTY_SHARE_INVITE";
1192
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_TO_REGISTER"] = 2021] = "PROPERTY_SHARE_INVITE_TO_REGISTER";
1193
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_ACCEPTED"] = 2022] = "PROPERTY_SHARE_INVITE_ACCEPTED";
1194
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_REJECTED"] = 2023] = "PROPERTY_SHARE_INVITE_REJECTED";
1195
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_REGISTERED"] = 2024] = "PROPERTY_SHARE_INVITE_REGISTERED";
1196
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_CHANGE_REQUESTED"] = 2025] = "PROPERTY_SHARE_CHANGE_REQUESTED";
1197
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_CHANGE_ACCEPTED"] = 2026] = "PROPERTY_SHARE_CHANGE_ACCEPTED";
1198
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_CHANGE_REJECTED"] = 2027] = "PROPERTY_SHARE_CHANGE_REJECTED";
1199
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_NEW_ACCOUNTS"] = 2030] = "BASIQ_NEW_ACCOUNTS";
1200
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_FIRST_IMPORT_COMPLETE"] = 2031] = "BASIQ_FIRST_IMPORT_COMPLETE";
1201
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_AUTHORIZATION_FAIL"] = 2032] = "BASIQ_AUTHORIZATION_FAIL";
1202
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["TRANSACTION_ALLOCATE_REMINDER"] = 2033] = "TRANSACTION_ALLOCATE_REMINDER";
1203
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["REGISTRATION_INVITE"] = 2040] = "REGISTRATION_INVITE";
1204
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["REGISTRATION_INVITE_ACCEPTED"] = 2041] = "REGISTRATION_INVITE_ACCEPTED";
1205
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["EMAIL_CONFIRMED"] = 2050] = "EMAIL_CONFIRMED";
1206
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["TAX_REVIEW_REQUESTED"] = 2060] = "TAX_REVIEW_REQUESTED";
1207
- })(exports.UserEventTypeClientTypeEnum || (exports.UserEventTypeClientTypeEnum = {}));
1208
-
1209
1180
  // replace array element with the new one (only arrays of objects)
1210
1181
  function replace(array, item, matchField) {
1211
1182
  if (matchField === void 0) { matchField = 'id'; }
@@ -2652,6 +2623,25 @@
2652
2623
  ServiceSubscription.prototype.isPastDue = function () {
2653
2624
  return this.status === exports.ServiceSubscriptionStatusEnum.PAST_DUE;
2654
2625
  };
2626
+ /**
2627
+ * Check if current subscription has provided subscription item
2628
+ */
2629
+ ServiceSubscription.prototype.hasItem = function (itemToCheck) {
2630
+ return !!this.items.find(function (item) { return item.price.id === itemToCheck.price.id; });
2631
+ };
2632
+ /**
2633
+ * Recommended number of properties to buy,
2634
+ * based on the property service product and the number of properties the user has
2635
+ */
2636
+ ServiceSubscription.prototype.getRecommendedPropertiesQty = function (propertyItem, propertiesQty) {
2637
+ var max = propertyItem.price.product.maxQty;
2638
+ var min = propertyItem.price.product.minQty;
2639
+ // if user has property subscription and number of properties doesn't exceed the maximum in the service product - return one more
2640
+ if (this.hasItem(propertyItem)) {
2641
+ propertiesQty = propertiesQty < max ? propertiesQty + 1 : max;
2642
+ }
2643
+ return Math.max(min, propertiesQty);
2644
+ };
2655
2645
  return ServiceSubscription;
2656
2646
  }(ServiceSubscription$1));
2657
2647
  __decorate([
@@ -5888,6 +5878,54 @@
5888
5878
  return BankAccountCollection;
5889
5879
  }(Collection));
5890
5880
 
5881
+ var UserEventTypeTypeEnum;
5882
+ (function (UserEventTypeTypeEnum) {
5883
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTERED"] = 1000] = "REGISTERED";
5884
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PASSWORD_RESET_REQUEST"] = 1001] = "PASSWORD_RESET_REQUEST";
5885
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["APP_FEATURES"] = 1010] = "APP_FEATURES";
5886
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIBED"] = 2000] = "SUBSCRIBED";
5887
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["UNSUBSCRIBED"] = 2001] = "UNSUBSCRIBED";
5888
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_UPDATE"] = 2004] = "SUBSCRIPTION_UPDATE";
5889
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_TRIAL_UPDATE"] = 2005] = "SUBSCRIPTION_TRIAL_UPDATE";
5890
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["SUBSCRIPTION_PAYMENT_FAILED"] = 2006] = "SUBSCRIPTION_PAYMENT_FAILED";
5891
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE"] = 2010] = "CLIENT_INVITE";
5892
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_TO_REGISTER"] = 2011] = "CLIENT_INVITE_TO_REGISTER";
5893
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_ACCEPTED"] = 2012] = "FIRM_INVITE_ACCEPTED";
5894
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_REJECTED"] = 2013] = "FIRM_INVITE_REJECTED";
5895
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_REGISTERED"] = 2014] = "FIRM_INVITE_REGISTERED";
5896
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE"] = 2020] = "PROPERTY_SHARE_INVITE";
5897
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_TO_REGISTER"] = 2021] = "PROPERTY_SHARE_INVITE_TO_REGISTER";
5898
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_ACCEPTED"] = 2022] = "PROPERTY_SHARE_INVITE_ACCEPTED";
5899
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_REJECTED"] = 2023] = "PROPERTY_SHARE_INVITE_REJECTED";
5900
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_INVITE_REGISTERED"] = 2024] = "PROPERTY_SHARE_INVITE_REGISTERED";
5901
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_REQUESTED"] = 2025] = "PROPERTY_SHARE_CHANGE_REQUESTED";
5902
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_ACCEPTED"] = 2026] = "PROPERTY_SHARE_CHANGE_ACCEPTED";
5903
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["PROPERTY_SHARE_CHANGE_REJECTED"] = 2027] = "PROPERTY_SHARE_CHANGE_REJECTED";
5904
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["OWNER_SUBSCRIBED"] = 2028] = "OWNER_SUBSCRIBED";
5905
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["OWNER_UNSUBSCRIBED"] = 2029] = "OWNER_UNSUBSCRIBED";
5906
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_NEW_ACCOUNTS"] = 2030] = "BASIQ_NEW_ACCOUNTS";
5907
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_FIRST_IMPORT_COMPLETE"] = 2031] = "BASIQ_FIRST_IMPORT_COMPLETE";
5908
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["BASIQ_AUTHORIZATION_FAIL"] = 2032] = "BASIQ_AUTHORIZATION_FAIL";
5909
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["TRANSACTION_ALLOCATE_REMINDER"] = 2033] = "TRANSACTION_ALLOCATE_REMINDER";
5910
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTRATION_INVITE"] = 2040] = "REGISTRATION_INVITE";
5911
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["REGISTRATION_INVITE_ACCEPTED"] = 2041] = "REGISTRATION_INVITE_ACCEPTED";
5912
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_EMAIL_CONFIRMED"] = 2050] = "CLIENT_EMAIL_CONFIRMED";
5913
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["TAX_REVIEW_REQUESTED"] = 2060] = "TAX_REVIEW_REQUESTED";
5914
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE_TO_REGISTER"] = 3000] = "FIRM_INVITE_TO_REGISTER";
5915
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_INVITE"] = 3001] = "FIRM_INVITE";
5916
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_ACCEPTED"] = 3002] = "CLIENT_INVITE_ACCEPTED";
5917
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_REJECTED"] = 3003] = "CLIENT_INVITE_REJECTED";
5918
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["CLIENT_INVITE_REGISTERED"] = 3004] = "CLIENT_INVITE_REGISTERED";
5919
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_NEW_CLIENT"] = 3005] = "FIRM_NEW_CLIENT";
5920
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["FIRM_LOST_CLIENT"] = 3006] = "FIRM_LOST_CLIENT";
5921
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_INVITE"] = 3010] = "EMPLOYEE_INVITE";
5922
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_LOST_CLIENT"] = 3011] = "EMPLOYEE_LOST_CLIENT";
5923
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_NEW_CLIENT"] = 3012] = "EMPLOYEE_NEW_CLIENT";
5924
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_INVITE_ACCEPTED"] = 3013] = "EMPLOYEE_INVITE_ACCEPTED";
5925
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["EMPLOYEE_EMAIL_CONFIRMED"] = 3020] = "EMPLOYEE_EMAIL_CONFIRMED";
5926
+ UserEventTypeTypeEnum[UserEventTypeTypeEnum["TAX_REVIEW_RECEIVED"] = 3030] = "TAX_REVIEW_RECEIVED";
5927
+ })(UserEventTypeTypeEnum || (UserEventTypeTypeEnum = {}));
5928
+
5891
5929
  /**
5892
5930
  * any event happened in the app, which needs to be handled somehow (distributed to other part of the app)
5893
5931
  */
@@ -5945,18 +5983,27 @@
5945
5983
  });
5946
5984
  };
5947
5985
  /**
5948
- * Update cache when basiq login failed to get actual connections statuses
5986
+ * Update cache when basiq accounts were retrieved or login to basic was failed to get actual connections statuses
5949
5987
  */
5950
5988
  BankConnectionService.prototype.listenNotifications = function () {
5951
5989
  var _this = this;
5990
+ // @TODO vik listen sse when backend updated
5952
5991
  this.eventDispatcherService.on(exports.AppEventTypeEnum.NOTIFICATION_ADDED).subscribe(function (notification) {
5953
- if (!notification.isRead && notification.eventType === exports.UserEventTypeClientTypeEnum.BASIQ_AUTHORIZATION_FAIL) {
5992
+ // @Todo TT-2280 Alex refactor ServiceNotification isRead logic. We don't need to know here whether notification was read or not
5993
+ if (!notification.isRead) {
5994
+ return;
5995
+ }
5996
+ if (BankConnectionService.userEventTypes.includes(notification.eventType)) {
5954
5997
  _this.resetCache();
5955
5998
  }
5956
5999
  });
5957
6000
  };
5958
6001
  return BankConnectionService;
5959
6002
  }(RestService));
6003
+ BankConnectionService.userEventTypes = [
6004
+ UserEventTypeTypeEnum.BASIQ_NEW_ACCOUNTS,
6005
+ UserEventTypeTypeEnum.BASIQ_AUTHORIZATION_FAIL
6006
+ ];
5960
6007
  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 });
5961
6008
  BankConnectionService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: BankConnectionService, providedIn: 'root' });
5962
6009
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: BankConnectionService, decorators: [{
@@ -6051,7 +6098,7 @@
6051
6098
  BasiqService.prototype.listenNotifications = function () {
6052
6099
  var _this = this;
6053
6100
  this.eventDispatcherService.on(exports.AppEventTypeEnum.NOTIFICATION_ADDED).subscribe(function (notification) {
6054
- if (!notification.isRead && notification.eventType === exports.UserEventTypeClientTypeEnum.BASIQ_NEW_ACCOUNTS) {
6101
+ if (!notification.isRead && notification.eventType === UserEventTypeTypeEnum.BASIQ_NEW_ACCOUNTS) {
6055
6102
  _this.resetCache();
6056
6103
  }
6057
6104
  });
@@ -8759,6 +8806,35 @@
8759
8806
  UserEventTypeEmployeeTypeEnum[UserEventTypeEmployeeTypeEnum["TAX_REVIEW_REQUESTED"] = 3030] = "TAX_REVIEW_REQUESTED";
8760
8807
  })(exports.UserEventTypeEmployeeTypeEnum || (exports.UserEventTypeEmployeeTypeEnum = {}));
8761
8808
 
8809
+ exports.UserEventTypeClientTypeEnum = void 0;
8810
+ (function (UserEventTypeClientTypeEnum) {
8811
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["SUBSCRIBED"] = 2000] = "SUBSCRIBED";
8812
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["UNSUBSCRIBED"] = 2001] = "UNSUBSCRIBED";
8813
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["SUBSCRIPTION_UPDATE"] = 2004] = "SUBSCRIPTION_UPDATE";
8814
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["SUBSCRIPTION_TRIAL_UPDATE"] = 2005] = "SUBSCRIPTION_TRIAL_UPDATE";
8815
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CLIENT_INVITE"] = 2010] = "CLIENT_INVITE";
8816
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CLIENT_INVITE_TO_REGISTER"] = 2011] = "CLIENT_INVITE_TO_REGISTER";
8817
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_ACCEPTED"] = 2012] = "FIRM_INVITE_ACCEPTED";
8818
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_REJECTED"] = 2013] = "FIRM_INVITE_REJECTED";
8819
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_REGISTERED"] = 2014] = "FIRM_INVITE_REGISTERED";
8820
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE"] = 2020] = "PROPERTY_SHARE_INVITE";
8821
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_TO_REGISTER"] = 2021] = "PROPERTY_SHARE_INVITE_TO_REGISTER";
8822
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_ACCEPTED"] = 2022] = "PROPERTY_SHARE_INVITE_ACCEPTED";
8823
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_REJECTED"] = 2023] = "PROPERTY_SHARE_INVITE_REJECTED";
8824
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_REGISTERED"] = 2024] = "PROPERTY_SHARE_INVITE_REGISTERED";
8825
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_CHANGE_REQUESTED"] = 2025] = "PROPERTY_SHARE_CHANGE_REQUESTED";
8826
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_CHANGE_ACCEPTED"] = 2026] = "PROPERTY_SHARE_CHANGE_ACCEPTED";
8827
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_CHANGE_REJECTED"] = 2027] = "PROPERTY_SHARE_CHANGE_REJECTED";
8828
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_NEW_ACCOUNTS"] = 2030] = "BASIQ_NEW_ACCOUNTS";
8829
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_FIRST_IMPORT_COMPLETE"] = 2031] = "BASIQ_FIRST_IMPORT_COMPLETE";
8830
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_AUTHORIZATION_FAIL"] = 2032] = "BASIQ_AUTHORIZATION_FAIL";
8831
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["TRANSACTION_ALLOCATE_REMINDER"] = 2033] = "TRANSACTION_ALLOCATE_REMINDER";
8832
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["REGISTRATION_INVITE"] = 2040] = "REGISTRATION_INVITE";
8833
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["REGISTRATION_INVITE_ACCEPTED"] = 2041] = "REGISTRATION_INVITE_ACCEPTED";
8834
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["EMAIL_CONFIRMED"] = 2050] = "EMAIL_CONFIRMED";
8835
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["TAX_REVIEW_REQUESTED"] = 2060] = "TAX_REVIEW_REQUESTED";
8836
+ })(exports.UserEventTypeClientTypeEnum || (exports.UserEventTypeClientTypeEnum = {}));
8837
+
8762
8838
  exports.UserMedicareExemptionEnum = void 0;
8763
8839
  (function (UserMedicareExemptionEnum) {
8764
8840
  UserMedicareExemptionEnum[UserMedicareExemptionEnum["NO"] = 0] = "NO";
@@ -9840,7 +9916,8 @@
9840
9916
  }());
9841
9917
 
9842
9918
  /**
9843
- * Enum with maximum number of payments, depending on the frequency
9919
+ * Enum with maximum number of payments, depending on the frequency.
9920
+ * Used only for vehicle loans
9844
9921
  */
9845
9922
  exports.LoanMaxNumberOfPaymentsEnum = void 0;
9846
9923
  (function (LoanMaxNumberOfPaymentsEnum) {
@@ -13532,7 +13609,7 @@
13532
13609
  BankTransactionService.prototype.listenBankTransactionsImport = function () {
13533
13610
  var _this = this;
13534
13611
  this.eventDispatcherService.on(exports.AppEventTypeEnum.NOTIFICATION_ADDED).subscribe(function (notification) {
13535
- if (!notification.isRead && notification.eventType === exports.UserEventTypeClientTypeEnum.BASIQ_FIRST_IMPORT_COMPLETE) {
13612
+ if (!notification.isRead && notification.eventType === UserEventTypeTypeEnum.BASIQ_FIRST_IMPORT_COMPLETE) {
13536
13613
  _this.resetCache();
13537
13614
  }
13538
13615
  });
@@ -14094,7 +14171,7 @@
14094
14171
  ClientInviteService.prototype.listenNotifications = function () {
14095
14172
  var _this = this;
14096
14173
  this.eventDispatcherService.on(exports.AppEventTypeEnum.NOTIFICATION_ADDED).subscribe(function (notification) {
14097
- if (!notification.isRead && (notification.eventType === exports.UserEventTypeClientTypeEnum.FIRM_INVITE_ACCEPTED || notification.eventType === exports.UserEventTypeClientTypeEnum.CLIENT_INVITE)) {
14174
+ if (!notification.isRead && (notification.eventType === UserEventTypeTypeEnum.FIRM_INVITE_ACCEPTED || notification.eventType === UserEventTypeTypeEnum.CLIENT_INVITE)) {
14098
14175
  _this.resetCache();
14099
14176
  }
14100
14177
  });
@@ -14173,7 +14250,7 @@
14173
14250
  ClientMovementService.prototype.listenNotifications = function () {
14174
14251
  var _this = this;
14175
14252
  this.eventDispatcherService.on(exports.AppEventTypeEnum.NOTIFICATION_ADDED).subscribe(function (notification) {
14176
- if (!notification.isRead && notification.eventType === exports.UserEventTypeClientTypeEnum.FIRM_INVITE_ACCEPTED) {
14253
+ if (!notification.isRead && notification.eventType === UserEventTypeTypeEnum.FIRM_INVITE_ACCEPTED) {
14177
14254
  _this.resetCache();
14178
14255
  }
14179
14256
  });
@@ -15255,6 +15332,7 @@
15255
15332
  }
15256
15333
  _this.cache = cache;
15257
15334
  _this.cacheSubject.next(_this.cache);
15335
+ // @TODO TT-2280 Alex wrong event, it's updated, added or deleted. Not just added
15258
15336
  _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.NOTIFICATION_ADDED, notification));
15259
15337
  });
15260
15338
  };
@@ -16284,7 +16362,7 @@
16284
16362
  TaxReviewService.prototype.listenNotifications = function () {
16285
16363
  var _this = this;
16286
16364
  this.eventDispatcherService.on(exports.AppEventTypeEnum.NOTIFICATION_ADDED).subscribe(function (notification) {
16287
- if (!notification.isRead && notification.eventType === exports.UserEventTypeClientTypeEnum.FIRM_INVITE_ACCEPTED) {
16365
+ if (!notification.isRead && notification.eventType === UserEventTypeTypeEnum.FIRM_INVITE_ACCEPTED) {
16288
16366
  _this.resetCache();
16289
16367
  }
16290
16368
  });
@@ -16869,6 +16947,10 @@
16869
16947
  * For vehicle loans term has a maximum value depended of repayment frequency
16870
16948
  */
16871
16949
  LoanForm.prototype.updateTermValidation = function () {
16950
+ // no need terms for bank loans
16951
+ if (!!this.loan.bankAccount) {
16952
+ return;
16953
+ }
16872
16954
  var currentRepaymentFrequency = this.get('repaymentFrequency').value;
16873
16955
  // term validation depends on selected repayment frequency, so can not validate when frequency is empty
16874
16956
  // repaymentType is required field, so we don't need to clear validation
@@ -17411,7 +17493,7 @@
17411
17493
  if (bankAccount.isLoan()) {
17412
17494
  // Attach bank account to loan for LoanForm's logic
17413
17495
  // @TODO Alex/Vik: we should use separated API for bank accounts and loans
17414
- var loan = classTransformer.plainToClass(Loan, Object.assign(bankAccount.loan, { bankAccount: Object.assign(bankAccount, { loan: null }) }));
17496
+ var loan = classTransformer.plainToClass(Loan, Object.assign(bankAccount.loan, { bankAccount: { accountId: bankAccount.accountId } }));
17415
17497
  _this.addControl('loan', new LoanForm(loan));
17416
17498
  }
17417
17499
  // basiq account import form should be disabled (unchecked) by default