taxtank-core 0.32.21 → 0.32.23

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.
@@ -4,7 +4,7 @@ import * as i1$1 from '@angular/common';
4
4
  import { formatDate, CommonModule, CurrencyPipe, DatePipe } from '@angular/common';
5
5
  import * as i1 from '@angular/common/http';
6
6
  import { HttpParams, HttpClient, HttpErrorResponse, HTTP_INTERCEPTORS } from '@angular/common/http';
7
- import { map, mergeMap, filter, catchError, first as first$1, last as last$1, take, switchMap, finalize, debounceTime, distinctUntilChanged, startWith, delay } from 'rxjs/operators';
7
+ import { map, mergeMap, filter, catchError, first as first$1, take, switchMap, finalize, debounceTime, distinctUntilChanged, startWith, delay } from 'rxjs/operators';
8
8
  import { ReplaySubject, Subject, BehaviorSubject, throwError, Observable, combineLatest, forkJoin, of, from, merge as merge$1 } from 'rxjs';
9
9
  import { plainToClass, Type, Transform, Exclude, Expose, classToPlain } from 'class-transformer';
10
10
  import get from 'lodash/get';
@@ -11057,9 +11057,7 @@ let RestService$1 = class RestService extends DataService {
11057
11057
  if (!this.mercureTopic) {
11058
11058
  return;
11059
11059
  }
11060
- console.log(this.mercureTopic);
11061
11060
  this.sseService.on(this.mercureTopic).pipe(map((response) => {
11062
- console.log(response);
11063
11061
  let model = this.createModelInstance(response);
11064
11062
  let method;
11065
11063
  if (model.id) {
@@ -11068,11 +11066,10 @@ let RestService$1 = class RestService extends DataService {
11068
11066
  else {
11069
11067
  method = 'delete';
11070
11068
  // we got empty body when item deleted, so we should get id from Api Platform data (@id)
11071
- model = merge(model, { id: +last$1(model['@id'].split('/')) });
11069
+ model = merge(model, { id: +last(model['@id'].split('/')) });
11072
11070
  }
11073
11071
  return { method, model };
11074
11072
  })).subscribe((change) => {
11075
- console.log(change);
11076
11073
  this.handleResponse([change.model], change.method);
11077
11074
  });
11078
11075
  }
@@ -11211,10 +11208,10 @@ class BankConnectionService extends RestService$1 {
11211
11208
  .pipe(map((response) => {
11212
11209
  const result = plainToClass(BankConnection, response);
11213
11210
  if (bankConnection.id) {
11214
- this.handleResponse([result], 'put');
11211
+ // this.handleResponse([result], 'put');
11215
11212
  }
11216
11213
  else {
11217
- this.handleResponse([result], 'post');
11214
+ // this.handleResponse([result], 'post');
11218
11215
  if (result.isBasiq()) {
11219
11216
  switch (true) {
11220
11217
  case result.isLoginSuccess():
@@ -12258,7 +12255,7 @@ class ClientInviteService extends RestService$1 {
12258
12255
  // TaxReviewService is listening client invites acception. With the new rest we are using listenCSE method, but old rest does not have this method.
12259
12256
  // We need to refactor TaxReviewService with new rest first, then we can listenCSE and remove manual events
12260
12257
  this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.CLIENT_INVITE_ACCEPTED, null));
12261
- this.handleResponse([invite], 'delete');
12258
+ // this.handleResponse([invite], 'delete');
12262
12259
  }));
12263
12260
  }
12264
12261
  /**
@@ -12273,10 +12270,9 @@ class ClientInviteService extends RestService$1 {
12273
12270
  resend(invite) {
12274
12271
  // cant use parent method because of custom specific handler
12275
12272
  return this.http.post(`${this.apiUrl}/${invite.id}/resend`, null)
12276
- .pipe(map((inviteBase) => plainToClass(ClientInvite, inviteBase)), map((resentInvite) => {
12277
- this.handleResponse([resentInvite], 'put');
12278
- return resentInvite;
12279
- }));
12273
+ .pipe(map((inviteBase) => plainToClass(ClientInvite, inviteBase)), map((resentInvite) =>
12274
+ // this.handleResponse([resentInvite], 'put');
12275
+ resentInvite));
12280
12276
  }
12281
12277
  /**
12282
12278
  * Send invitation from client to firm
@@ -12334,7 +12330,9 @@ class ClientMovementService extends RestService$1 {
12334
12330
  }
12335
12331
  listenEvents() {
12336
12332
  // client invite accept triggers client movement update
12337
- this.listenCSE(ClientInvite, this.refreshCache, ['post', 'put', 'delete']);
12333
+ this.eventDispatcherService.on([AppEventTypeEnum.CLIENT_INVITE_ACCEPTED]).subscribe(() => {
12334
+ this.refreshCache();
12335
+ });
12338
12336
  // @TODO remove when TT-3826 is ready
12339
12337
  this.listenSSE();
12340
12338
  }
@@ -12356,8 +12354,8 @@ class ClientMovementService extends RestService$1 {
12356
12354
  // extend base 'add' method and pass into it movement without id
12357
12355
  return super.post(plainToClass(ClientMovement, Object.assign({}, movement, { id: null }))).pipe(map((updatedMovement) => {
12358
12356
  // remove provided movement from cache
12359
- this.cache = this.cache.filter((item) => item.id !== movement.id);
12360
- this.updateCache([updatedMovement], 'post');
12357
+ // this.cache = this.cache.filter((item: ClientMovement) => item.id !== movement.id);
12358
+ // this.updateCache([updatedMovement], 'post');
12361
12359
  this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.CLIENT_TRANSFER_TO_OTHER_EMPLOYEE, [updatedMovement.client]));
12362
12360
  return updatedMovement;
12363
12361
  }));
@@ -12379,8 +12377,8 @@ class ClientMovementService extends RestService$1 {
12379
12377
  .pipe(map(() => {
12380
12378
  // @TODO remove when TaxReviewService refactored with the new rest and use there listenCSE instead
12381
12379
  this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.CLIENT_MOVEMENT_CLOSED, null));
12382
- this.cache = this.cache.filter((movement) => movement.id !== clientMovement.id);
12383
- this.updateCache([clientMovement], 'delete');
12380
+ // this.cache = this.cache.filter((movement: ClientMovement): boolean => movement.id !== clientMovement.id);
12381
+ // this.updateCache([clientMovement], 'delete');
12384
12382
  }));
12385
12383
  }
12386
12384
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ClientMovementService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
@@ -14082,6 +14080,7 @@ class ServicePaymentMethodService extends RestService$1 {
14082
14080
  this.endpointUri = 'service-payment-methods';
14083
14081
  this.collectionClass = Collection;
14084
14082
  this.modelClass = ServicePaymentMethod;
14083
+ this.mercureTopic = 'servicePaymentMethods';
14085
14084
  this.listenEvents();
14086
14085
  }
14087
14086
  listenEvents() {
@@ -14162,12 +14161,7 @@ class SubscriptionService extends RestService$1 {
14162
14161
  this.listenSSE();
14163
14162
  }
14164
14163
  startTrial(subscription) {
14165
- return this.http.post(`${this.apiUrl}/trial`, subscription)
14166
- .pipe(map((response) => {
14167
- const newSubscription = plainToClass(ServiceSubscription, response);
14168
- this.handleResponse([newSubscription], 'post');
14169
- return newSubscription;
14170
- }));
14164
+ return this.post(subscription, null, `${this.apiUrl}/trial`);
14171
14165
  }
14172
14166
  postStripeSubscription(subscription) {
14173
14167
  return this.http.post(this.apiUrl, classToPlain(subscription))
@@ -15596,11 +15590,9 @@ class UserService extends RestService$1 {
15596
15590
  */
15597
15591
  listenServiceSubscriptionUpdated() {
15598
15592
  this.listenCSE(ServiceSubscription, (response) => {
15599
- console.log(response);
15600
15593
  // @TODO vik test and remove
15601
15594
  setTimeout(() => {
15602
15595
  this.refreshCache();
15603
- this.toastService.success('Subscription successfully updated');
15604
15596
  }, 2000);
15605
15597
  }, ['post', 'put']);
15606
15598
  }
@@ -18951,13 +18943,13 @@ class PropertyCalculationService {
18951
18943
  // best performance properties could be only from active properties list
18952
18944
  const activeProperties = properties.getActiveProperties();
18953
18945
  const bestPerformanceGrowthProperty = activeProperties.getBestPerformanceGrowthProperty();
18954
- const bestPerformanceTaxProperty = activeProperties.getBestPerformanceTaxProperty(transactions, depreciations);
18946
+ const bestPerformanceTaxProperty = activeProperties.getTaxInclusive().getBestPerformanceTaxProperty(transactions, depreciations);
18955
18947
  switch (true) {
18956
18948
  case !property.isActive:
18957
18949
  return new Badge('Inactive', BadgeColorEnum.GRAY);
18958
- case property.id === bestPerformanceTaxProperty.id && property.id === bestPerformanceGrowthProperty.id:
18950
+ case property.id === bestPerformanceTaxProperty?.id && property.id === bestPerformanceGrowthProperty.id:
18959
18951
  return new Badge('Best performance growth & tax', BadgeColorEnum.GOLD);
18960
- case property.id === bestPerformanceTaxProperty.id:
18952
+ case property.id === bestPerformanceTaxProperty?.id:
18961
18953
  return new Badge('Best performance tax', BadgeColorEnum.GOLD);
18962
18954
  case property.id === bestPerformanceGrowthProperty.id:
18963
18955
  return new Badge('Best performance growth', BadgeColorEnum.GREEN);
@@ -19411,9 +19403,9 @@ const ENDPOINTS = {
19411
19403
  CLIENTS_INVITES_GET: new Endpoint('GET', '\\/clients\\/\\invites'),
19412
19404
  CLIENTS_INVITES_POST: new Endpoint('POST', '\\/clients\\/\\invites'),
19413
19405
  CLIENTS_INVITES_DELETE: new Endpoint('DELETE', '\\/clients\\/\\invites\\/\\d+'),
19414
- CLIENTS_INVITES_ACCEPT_POST: new Endpoint('POST', '\\/clients\\/\\invites\\/\\d+\\/accept'),
19415
- CLIENTS_INVITES_REJECT_POST: new Endpoint('POST', '\\/clients\\/\\invites\\/\\d+\\/reject'),
19416
- CLIENTS_INVITES_RESEND_POST: new Endpoint('POST', '\\/clients\\/\\invites\\/\\d+\\/resend'),
19406
+ CLIENTS_INVITES_ACCEPT: new Endpoint('PUT', '\\/clients\\/\\invites\\/\\d+\\/accept'),
19407
+ CLIENTS_INVITES_REJECT: new Endpoint('PUT', '\\/clients\\/\\invites\\/\\d+\\/reject'),
19408
+ CLIENTS_INVITES_RESEND: new Endpoint('POST', '\\/clients\\/\\invites\\/\\d+\\/resend'),
19417
19409
  CLIENT_MOVEMENTS_CLOSE: new Endpoint('PUT', '\\/client-movements\\/\\d+\\/close'),
19418
19410
  CLIENT_MOVEMENTS_GET: new Endpoint('GET', '\\/client-movements'),
19419
19411
  CLIENT_MOVEMENTS_POST: new Endpoint('POST', '\\/client-movements'),
@@ -22025,7 +22017,6 @@ class PropertyCategoryMovementForm extends AbstractForm {
22025
22017
  }, movement);
22026
22018
  this.get('valuation').get('date').valueChanges.subscribe((value) => {
22027
22019
  this.get('fromDate').setValue(value);
22028
- console.log(this.get('fromDate').value);
22029
22020
  });
22030
22021
  }
22031
22022
  submit() {