taxtank-core 2.1.54 → 2.1.56

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.
@@ -22,7 +22,7 @@ import uniq from 'lodash/uniq';
22
22
  import moment from 'moment';
23
23
  import { DateRange as DateRange$1 } from 'moment-range';
24
24
  import * as i3 from 'taxtank-core/common';
25
- import { UserRolesEnum as UserRolesEnum$1, MixpanelService as MixpanelService$1 } from 'taxtank-core/common';
25
+ import { UserRolesEnum as UserRolesEnum$1, MixpanelService as MixpanelService$1, JwtService as JwtService$1 } from 'taxtank-core/common';
26
26
  import range from 'lodash/range';
27
27
  import { Validators, FormGroup, FormArray, UntypedFormControl, UntypedFormArray, UntypedFormGroup, FormControl } from '@angular/forms';
28
28
  import compact from 'lodash/compact';
@@ -7197,7 +7197,7 @@ class Transaction extends Transaction$1 {
7197
7197
  * Check if transaction is completely allocated
7198
7198
  */
7199
7199
  isAllocated(allocations) {
7200
- return Math.abs(this.getAllocatedAmount(allocations)) - Math.abs(this.netAmount) >= -0.01;
7200
+ return Math.abs(this.getAllocatedAmount(allocations)) - Math.abs(this.netAmount) >= -0.001;
7201
7201
  }
7202
7202
  getAllocatedAmount(allocations) {
7203
7203
  return allocations.filterBy('transaction.id', this.id).sumBy('amount');
@@ -18443,8 +18443,9 @@ class UserService extends RestService$1 {
18443
18443
  this.modelClass = User;
18444
18444
  this.collectionClass = Collection;
18445
18445
  this.endpointUri = 'users';
18446
- this.disabledMethods = ['postBatch', 'putBatch', 'deleteBatch', 'delete'];
18446
+ this.disabledMethods = ['postBatch', 'putBatch', 'deleteBatch'];
18447
18447
  this.mpService = inject(MixpanelService$1);
18448
+ this.jwtService = inject(JwtService$1);
18448
18449
  this.listenEvents();
18449
18450
  }
18450
18451
  listenEvents() {
@@ -18504,11 +18505,10 @@ class UserService extends RestService$1 {
18504
18505
  finishOnboarding(user) {
18505
18506
  return this.put(user, `${this.apiUrl}/status`);
18506
18507
  }
18507
- deactivate(user) {
18508
- return this.put(user, `${this.apiUrl}/${user.id}/delete`).pipe(map((user) => {
18509
- // localStorage.removeItem('userId');
18508
+ delete(user) {
18509
+ return super.delete(user).pipe(map(() => {
18510
+ this.jwtService.destroyTokens();
18510
18511
  location.replace('/login');
18511
- return user;
18512
18512
  }));
18513
18513
  }
18514
18514
  updatePhoto(photo) {