taxtank-core 0.32.117 → 0.32.119

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.
@@ -724,7 +724,7 @@ let SoleBusinessLossOffsetRule$1 = class SoleBusinessLossOffsetRule extends Abst
724
724
  let SoleBusinessLoss$1 = class SoleBusinessLoss extends AbstractModel {
725
725
  };
726
726
 
727
- let SoleBusiness$1 = class SoleBusiness extends AbstractModel {
727
+ let SoleBusiness$1 = class SoleBusiness extends ObservableModel {
728
728
  };
729
729
 
730
730
  let SoleContact$1 = class SoleContact extends AbstractModel {
@@ -9529,7 +9529,7 @@ class HoldingSaleCollection extends ExportableCollection {
9529
9529
  getExportBody(holdingsById) {
9530
9530
  return this.items.map((sale) => [
9531
9531
  plainToClass(ExportCell, {
9532
- value: holdingsById.get(sale.holding.id).type.ticker,
9532
+ value: holdingsById.get(sale.holding.id).type.ticker || '',
9533
9533
  type: ExportCellTypeEnum.STRING
9534
9534
  }),
9535
9535
  plainToClass(ExportCell, {
@@ -10372,26 +10372,25 @@ var AppEventTypeEnum;
10372
10372
  AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_ADDED"] = 36] = "PROPERTY_SUBSCRIPTION_ADDED";
10373
10373
  AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 37] = "PROPERTY_SUBSCRIPTION_DELETED";
10374
10374
  AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 38] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
10375
- AppEventTypeEnum[AppEventTypeEnum["SOLE_BUSINESS_CREATED"] = 39] = "SOLE_BUSINESS_CREATED";
10376
- AppEventTypeEnum[AppEventTypeEnum["SOLE_DEPRECIATION_METHOD_UPDATED"] = 40] = "SOLE_DEPRECIATION_METHOD_UPDATED";
10377
- AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_CREATED"] = 41] = "SOLE_DETAILS_CREATED";
10378
- AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_UPDATED"] = 42] = "SOLE_DETAILS_UPDATED";
10379
- AppEventTypeEnum[AppEventTypeEnum["SOLE_INVOICE_PUBLISHED"] = 43] = "SOLE_INVOICE_PUBLISHED";
10380
- AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 44] = "TAX_REVIEW_UPDATED";
10381
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_ALLOCATION_CREATED"] = 45] = "TRANSACTION_ALLOCATION_CREATED";
10382
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_ALLOCATION_DELETED"] = 46] = "TRANSACTION_ALLOCATION_DELETED";
10383
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 47] = "TRANSACTION_CREATED";
10384
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 48] = "TRANSACTION_DELETED";
10385
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 49] = "TRANSACTION_UPDATED";
10386
- AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 50] = "TRANSACTIONS_CREATED";
10387
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 51] = "VEHICLE_CLAIM_UPDATED";
10388
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 52] = "VEHICLE_CLAIM_CREATED";
10389
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 53] = "VEHICLE_CLAIM_DETAILS_UPDATED";
10390
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 54] = "VEHICLE_CLAIM_DETAILS_CREATED";
10391
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 55] = "VEHICLE_LOGBOOK_CREATED";
10392
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 56] = "VEHICLE_LOGBOOK_UPDATED";
10393
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 57] = "VEHICLE_LOGBOOK_DELETED";
10394
- AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 58] = "VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED";
10375
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_DEPRECIATION_METHOD_UPDATED"] = 39] = "SOLE_DEPRECIATION_METHOD_UPDATED";
10376
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_CREATED"] = 40] = "SOLE_DETAILS_CREATED";
10377
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_DETAILS_UPDATED"] = 41] = "SOLE_DETAILS_UPDATED";
10378
+ AppEventTypeEnum[AppEventTypeEnum["SOLE_INVOICE_PUBLISHED"] = 42] = "SOLE_INVOICE_PUBLISHED";
10379
+ AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 43] = "TAX_REVIEW_UPDATED";
10380
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_ALLOCATION_CREATED"] = 44] = "TRANSACTION_ALLOCATION_CREATED";
10381
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_ALLOCATION_DELETED"] = 45] = "TRANSACTION_ALLOCATION_DELETED";
10382
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 46] = "TRANSACTION_CREATED";
10383
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 47] = "TRANSACTION_DELETED";
10384
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 48] = "TRANSACTION_UPDATED";
10385
+ AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 49] = "TRANSACTIONS_CREATED";
10386
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 50] = "VEHICLE_CLAIM_UPDATED";
10387
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 51] = "VEHICLE_CLAIM_CREATED";
10388
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_UPDATED"] = 52] = "VEHICLE_CLAIM_DETAILS_UPDATED";
10389
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_DETAILS_CREATED"] = 53] = "VEHICLE_CLAIM_DETAILS_CREATED";
10390
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_CREATED"] = 54] = "VEHICLE_LOGBOOK_CREATED";
10391
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_UPDATED"] = 55] = "VEHICLE_LOGBOOK_UPDATED";
10392
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_DELETED"] = 56] = "VEHICLE_LOGBOOK_DELETED";
10393
+ AppEventTypeEnum[AppEventTypeEnum["VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED"] = 57] = "VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED";
10395
10394
  })(AppEventTypeEnum || (AppEventTypeEnum = {}));
10396
10395
 
10397
10396
  /**
@@ -13456,7 +13455,7 @@ class SoleForecastService extends RestService {
13456
13455
  * Listen business created because we create sole forests together with business
13457
13456
  */
13458
13457
  listenBusinessCreated() {
13459
- this.eventDispatcherService.on(AppEventTypeEnum.SOLE_BUSINESS_CREATED).subscribe(() => {
13458
+ this.eventDispatcherService.on2(SoleBusiness.getEventName('post')).subscribe(() => {
13460
13459
  this.refreshCache();
13461
13460
  });
13462
13461
  }
@@ -13541,7 +13540,7 @@ class IncomeSourceService extends RestService {
13541
13540
  * Sole businesses create together with income source
13542
13541
  */
13543
13542
  listenSoleBusinessCreated() {
13544
- this.eventDispatcherService.on(AppEventTypeEnum.SOLE_BUSINESS_CREATED).subscribe(() => {
13543
+ this.eventDispatcherService.on2(SoleBusiness.getEventName('post')).subscribe(() => {
13545
13544
  // @TODO Alex/Vik (TT-1777): we clear cache a lot, a better and easier way required, add todo and task to refactor
13546
13545
  this.refreshCache();
13547
13546
  });
@@ -14152,17 +14151,13 @@ var SoleBusinessMessagesEnum;
14152
14151
  SoleBusinessMessagesEnum["LOGO_UPDATED"] = "Logo updated successfully";
14153
14152
  })(SoleBusinessMessagesEnum || (SoleBusinessMessagesEnum = {}));
14154
14153
 
14155
- class SoleBusinessService extends RestService {
14154
+ class SoleBusinessService extends RestService$1 {
14156
14155
  constructor() {
14157
14156
  super(...arguments);
14158
14157
  this.modelClass = SoleBusiness;
14159
- this.url = 'sole-businesses';
14160
- }
14161
- add(soleBusiness) {
14162
- return super.add(soleBusiness).pipe(map((business) => {
14163
- this.eventDispatcherService.dispatch(new AppEvent(AppEventTypeEnum.SOLE_BUSINESS_CREATED, business));
14164
- return business;
14165
- }));
14158
+ this.collectionClass = Collection;
14159
+ this.endpointUri = 'sole-businesses';
14160
+ this.roles = [UserRolesEnum.SOLE_TANK];
14166
14161
  }
14167
14162
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SoleBusinessService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
14168
14163
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SoleBusinessService, providedIn: 'root' }); }
@@ -14205,7 +14200,7 @@ class SoleBusinessLossService extends RestService {
14205
14200
  * Listen business created because we create prior year losses together with business
14206
14201
  */
14207
14202
  listenBusinessCreated() {
14208
- this.eventDispatcherService.on(AppEventTypeEnum.SOLE_BUSINESS_CREATED).subscribe(() => {
14203
+ this.eventDispatcherService.on2(SoleBusiness.getEventName('post')).subscribe(() => {
14209
14204
  this.refreshCache();
14210
14205
  });
14211
14206
  }
@@ -15652,7 +15647,8 @@ class VehicleClaimService extends RestService {
15652
15647
  }
15653
15648
  listenEvents() {
15654
15649
  this.eventDispatcherService.on([AppEventTypeEnum.VEHICLE_CLAIM_DETAILS_UPDATED]).subscribe(() => {
15655
- this.refreshCache();
15650
+ // @TODO it prevents updateWorkUsage (because cache is empty), need to make all changes either on front or back
15651
+ // this.refreshCache();
15656
15652
  });
15657
15653
  }
15658
15654
  add(model) {
@@ -18582,7 +18578,7 @@ class AccountSetupService {
18582
18578
  }
18583
18579
  // Sole business item is completed when user added at least one business
18584
18580
  if (this.user.hasRoles(UserRolesEnum.SOLE_TANK)) {
18585
- batch.push(this.setItemStatus(this.items.findBy('isSoleBusiness', true), this.soleBusinessService.get()));
18581
+ batch.push(this.setItemStatus(this.items.findBy('isSoleBusiness', true), this.soleBusinessService.getArray()));
18586
18582
  }
18587
18583
  // holdings item is completed when user added at least one holding
18588
18584
  if (this.user.hasRoles(UserRolesEnum.HOLDING_TANK)) {