taxtank-core 0.11.0 → 0.12.2

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 (131) hide show
  1. package/bundles/taxtank-core.umd.js +2760 -2780
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/collection.js +4 -1
  4. package/esm2015/lib/collections/depreciation.collection.js +24 -10
  5. package/esm2015/lib/collections/transaction.collection.js +28 -1
  6. package/esm2015/lib/collections/vehicle-logbook.collection.js +88 -0
  7. package/esm2015/lib/collections/vehicle.collection.js +9 -0
  8. package/esm2015/lib/db/Enums/chart-accounts-heading-vehicle-list.enum.js +3 -1
  9. package/esm2015/lib/db/Enums/chart-accounts-list.enum.js +4 -3
  10. package/esm2015/lib/db/Models/client-income-types.js +1 -1
  11. package/esm2015/lib/db/Models/vehicle-claim.js +1 -1
  12. package/esm2015/lib/db/Models/vehicle.js +1 -1
  13. package/esm2015/lib/forms/client/client-income-types.form.js +3 -3
  14. package/esm2015/lib/forms/index.js +3 -1
  15. package/esm2015/lib/forms/vehicle/vehicle-claim.form.js +114 -0
  16. package/esm2015/lib/forms/vehicle/vehicle.form.js +20 -0
  17. package/esm2015/lib/interfaces/event-listener.interface.js +1 -1
  18. package/esm2015/lib/interfaces/expense.interface.js +2 -0
  19. package/esm2015/lib/interfaces/tank.interface.js +1 -1
  20. package/esm2015/lib/models/chart-accounts/chart-accounts-value.js +4 -0
  21. package/esm2015/lib/models/chart-accounts/chart-accounts.js +34 -1
  22. package/esm2015/lib/models/depreciation/depreciation.js +5 -1
  23. package/esm2015/lib/models/event/app-event-type.enum.js +4 -1
  24. package/esm2015/lib/models/logbook/logbook-period.js +8 -1
  25. package/esm2015/lib/models/logbook/vehicle-claim.js +63 -4
  26. package/esm2015/lib/models/logbook/vehicle-logbook.js +9 -3
  27. package/esm2015/lib/models/logbook/vehicle.js +7 -29
  28. package/esm2015/lib/models/pdf/pdf-settings.js +10 -0
  29. package/esm2015/lib/models/transaction/transaction.js +1 -1
  30. package/esm2015/lib/services/account-setup/account-setup.service.js +8 -23
  31. package/esm2015/lib/services/http/bank/bank-account/bank-account.service.js +6 -15
  32. package/esm2015/lib/services/http/bank/bank-connection/bank-connection.service.js +6 -15
  33. package/esm2015/lib/services/http/bank/bank-transaction/bank-transaction.service.js +6 -15
  34. package/esm2015/lib/services/http/bank/basiq/basiq.service.js +6 -15
  35. package/esm2015/lib/services/http/chart-accounts/chart-accounts.service.js +1 -1
  36. package/esm2015/lib/services/http/chat/chat.service.js +8 -12
  37. package/esm2015/lib/services/http/chat/message/message.service.js +8 -12
  38. package/esm2015/lib/services/http/chat/message-document/message-document.service.js +1 -1
  39. package/esm2015/lib/services/http/depreciation/depreciation.service.js +6 -23
  40. package/esm2015/lib/services/http/document/document-folder/document-folder.service.js +6 -14
  41. package/esm2015/lib/services/http/firm/client-movement/client-movement.service.js +6 -15
  42. package/esm2015/lib/services/http/income-source/income-source-forecast/income-source-forecast.service.js +6 -15
  43. package/esm2015/lib/services/http/income-source/income-source.service.js +6 -14
  44. package/esm2015/lib/services/http/income-source/salary-forecast/salary-forecast.service.js +6 -15
  45. package/esm2015/lib/services/http/income-source/sole-forecast/sole-forecast.service.js +6 -15
  46. package/esm2015/lib/services/http/loan/loan.service.js +6 -15
  47. package/esm2015/lib/services/http/property/property-document/property-document.service.js +6 -15
  48. package/esm2015/lib/services/http/property/property-share/property-share.service.js +6 -15
  49. package/esm2015/lib/services/http/property/property.service.js +6 -15
  50. package/esm2015/lib/services/http/rest/rest.service.js +31 -4
  51. package/esm2015/lib/services/http/service-notification/service-notification.service.js +8 -12
  52. package/esm2015/lib/services/http/subscription/subscription.service.js +1 -4
  53. package/esm2015/lib/services/http/tax-review/tax-review-history/tax-review-history.service.js +15 -16
  54. package/esm2015/lib/services/http/tax-review/tax-review.service.js +6 -15
  55. package/esm2015/lib/services/http/tax-summary/tax-summary.service.js +1 -1
  56. package/esm2015/lib/services/http/transaction/transaction-allocation/transaction-allocation.service.js +6 -15
  57. package/esm2015/lib/services/http/transaction/transaction.service.js +6 -25
  58. package/esm2015/lib/services/http/user/user-event-setting/user-event-setting.service.js +6 -14
  59. package/esm2015/lib/services/http/user/user-event-type/user-event-type.service.js +6 -14
  60. package/esm2015/lib/services/http/vehicle/messages.enum.js +13 -0
  61. package/esm2015/lib/services/http/vehicle/vehicle-claim.service.js +24 -0
  62. package/esm2015/lib/services/http/vehicle/vehicle-logbook.service.js +59 -0
  63. package/esm2015/lib/services/http/vehicle/vehicle.service.js +49 -213
  64. package/esm2015/lib/services/pdf/pdf.service.js +11 -11
  65. package/esm2015/public-api.js +8 -2
  66. package/fesm2015/taxtank-core.js +2482 -2450
  67. package/fesm2015/taxtank-core.js.map +1 -1
  68. package/lib/collections/collection.d.ts +1 -0
  69. package/lib/collections/depreciation.collection.d.ts +5 -4
  70. package/lib/collections/transaction.collection.d.ts +9 -0
  71. package/lib/collections/vehicle-logbook.collection.d.ts +30 -0
  72. package/lib/collections/vehicle.collection.d.ts +6 -0
  73. package/lib/db/Enums/chart-accounts-heading-vehicle-list.enum.d.ts +3 -1
  74. package/lib/db/Enums/chart-accounts-list.enum.d.ts +4 -3
  75. package/lib/db/Models/client-income-types.d.ts +2 -2
  76. package/lib/db/Models/vehicle-claim.d.ts +2 -0
  77. package/lib/db/Models/vehicle.d.ts +2 -0
  78. package/lib/forms/index.d.ts +2 -0
  79. package/lib/forms/vehicle/vehicle-claim.form.d.ts +43 -0
  80. package/lib/forms/vehicle/vehicle.form.d.ts +11 -0
  81. package/lib/interfaces/event-listener.interface.d.ts +1 -0
  82. package/lib/interfaces/expense.interface.d.ts +12 -0
  83. package/lib/interfaces/tank.interface.d.ts +2 -0
  84. package/lib/models/chart-accounts/chart-accounts-value.d.ts +3 -0
  85. package/lib/models/chart-accounts/chart-accounts.d.ts +18 -0
  86. package/lib/models/depreciation/depreciation.d.ts +6 -2
  87. package/lib/models/event/app-event-type.enum.d.ts +4 -1
  88. package/lib/models/logbook/logbook-period.d.ts +4 -0
  89. package/lib/models/logbook/vehicle-claim.d.ts +20 -3
  90. package/lib/models/logbook/vehicle-logbook.d.ts +8 -2
  91. package/lib/models/logbook/vehicle.d.ts +5 -7
  92. package/lib/models/pdf/pdf-settings.d.ts +9 -0
  93. package/lib/models/transaction/transaction.d.ts +2 -2
  94. package/lib/services/account-setup/account-setup.service.d.ts +3 -7
  95. package/lib/services/http/bank/bank-account/bank-account.service.d.ts +2 -7
  96. package/lib/services/http/bank/bank-connection/bank-connection.service.d.ts +2 -7
  97. package/lib/services/http/bank/bank-transaction/bank-transaction.service.d.ts +3 -8
  98. package/lib/services/http/bank/basiq/basiq.service.d.ts +2 -7
  99. package/lib/services/http/chat/chat.service.d.ts +4 -7
  100. package/lib/services/http/chat/message/message.service.d.ts +4 -7
  101. package/lib/services/http/chat/message-document/message-document.service.d.ts +3 -3
  102. package/lib/services/http/depreciation/depreciation.service.d.ts +2 -11
  103. package/lib/services/http/document/document-folder/document-folder.service.d.ts +0 -6
  104. package/lib/services/http/firm/client-movement/client-movement.service.d.ts +2 -7
  105. package/lib/services/http/income-source/income-source-forecast/income-source-forecast.service.d.ts +2 -7
  106. package/lib/services/http/income-source/income-source.service.d.ts +0 -6
  107. package/lib/services/http/income-source/salary-forecast/salary-forecast.service.d.ts +1 -7
  108. package/lib/services/http/income-source/sole-forecast/sole-forecast.service.d.ts +2 -7
  109. package/lib/services/http/loan/loan.service.d.ts +2 -7
  110. package/lib/services/http/property/property-document/property-document.service.d.ts +3 -8
  111. package/lib/services/http/property/property-share/property-share.service.d.ts +2 -7
  112. package/lib/services/http/property/property.service.d.ts +2 -7
  113. package/lib/services/http/rest/rest.service.d.ts +17 -2
  114. package/lib/services/http/service-notification/service-notification.service.d.ts +4 -7
  115. package/lib/services/http/subscription/subscription.service.d.ts +0 -1
  116. package/lib/services/http/tax-review/tax-review-history/tax-review-history.service.d.ts +7 -7
  117. package/lib/services/http/tax-review/tax-review.service.d.ts +1 -7
  118. package/lib/services/http/tax-summary/tax-summary.service.d.ts +2 -1
  119. package/lib/services/http/transaction/transaction-allocation/transaction-allocation.service.d.ts +3 -8
  120. package/lib/services/http/transaction/transaction.service.d.ts +0 -12
  121. package/lib/services/http/user/user-event-setting/user-event-setting.service.d.ts +0 -6
  122. package/lib/services/http/user/user-event-type/user-event-type.service.d.ts +0 -6
  123. package/lib/services/http/vehicle/messages.enum.d.ts +11 -0
  124. package/lib/services/http/vehicle/vehicle-claim.service.d.ts +13 -0
  125. package/lib/services/http/vehicle/vehicle-logbook.service.d.ts +22 -0
  126. package/lib/services/http/vehicle/vehicle.service.d.ts +17 -80
  127. package/lib/services/pdf/pdf.service.d.ts +3 -3
  128. package/package.json +1 -1
  129. package/public-api.d.ts +7 -1
  130. package/esm2015/lib/collections/logbook.collection.js +0 -97
  131. package/lib/collections/logbook.collection.d.ts +0 -19
@@ -8,9 +8,9 @@ import * as i0 from "@angular/core";
8
8
  * Service for work with Message Documents
9
9
  */
10
10
  export declare class MessageDocumentService implements IEventListener {
11
- protected http: HttpClient;
12
- protected eventDispatcherService: EventDispatcherService;
13
- protected environment: any;
11
+ private http;
12
+ private eventDispatcherService;
13
+ private environment;
14
14
  url: string;
15
15
  cache: Readonly<Array<Readonly<MessageDocument>>>;
16
16
  cacheSubject: ReplaySubject<Readonly<Array<Readonly<MessageDocument>>>>;
@@ -1,17 +1,12 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { Depreciation as DepreciationBase } from '../../../db/Models/depreciation';
3
- import { HttpClient } from '@angular/common/http';
4
3
  import { RestService } from '../rest/rest.service';
5
4
  import { Depreciation } from '../../../models/depreciation/depreciation';
6
- import { EventDispatcherService } from '../../event/event-dispatcher.service';
5
+ import { IEventListener } from '../../../interfaces/event-listener.interface';
7
6
  import * as i0 from "@angular/core";
8
- export declare class DepreciationService extends RestService<DepreciationBase, Depreciation> {
9
- protected http: HttpClient;
10
- protected eventDispatcherService: EventDispatcherService;
11
- protected environment: any;
7
+ export declare class DepreciationService extends RestService<DepreciationBase, Depreciation> implements IEventListener {
12
8
  modelClass: typeof Depreciation;
13
9
  url: string;
14
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
15
10
  /**
16
11
  * Add a single depreciation
17
12
  * @TODO add auto-generation for events
@@ -26,10 +21,6 @@ export declare class DepreciationService extends RestService<DepreciationBase, D
26
21
  * Listen to Depreciations events
27
22
  */
28
23
  listenEvents(): void;
29
- /**
30
- * Get depreciations related to Vehicle category
31
- */
32
- getVehicleDepreciations(): Observable<Depreciation[]>;
33
24
  getOpenBalance(depreciation: Depreciation): Observable<number>;
34
25
  /**
35
26
  * @TODO wrong place, move to collection model
@@ -1,21 +1,15 @@
1
1
  import { DocumentFolder as DocumentFolderBase } from '../../../../db/Models/document-folder';
2
- import { HttpClient } from '@angular/common/http';
3
2
  import { Document } from '../../../../models/document/document';
4
3
  import { Observable } from 'rxjs';
5
4
  import { RestService } from '../../rest/rest.service';
6
5
  import { DocumentFolder } from '../../../../models/document/document-folder';
7
- import { EventDispatcherService } from '../../../event/event-dispatcher.service';
8
6
  import * as i0 from "@angular/core";
9
7
  /**
10
8
  * Service to handle document-folders and depending documents logic
11
9
  */
12
10
  export declare class DocumentFolderService extends RestService<DocumentFolderBase, DocumentFolder> {
13
- protected http: HttpClient;
14
- protected eventDispatcherService: EventDispatcherService;
15
- protected environment: any;
16
11
  url: string;
17
12
  modelClass: typeof DocumentFolder;
18
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
19
13
  /**
20
14
  * Add new document to the folder
21
15
  * @param file to be uploaded to the folder
@@ -2,19 +2,14 @@ import { ClientMovement as ClientMovementBase } from '../../../../db/Models/clie
2
2
  import { Observable } from 'rxjs';
3
3
  import { ClientMovementCollection } from '../../../../collections/client-movement.collection';
4
4
  import { FirmTypeEnum } from '../../../../db/Enums/firm-type.enum';
5
- import { HttpClient } from '@angular/common/http';
6
5
  import { RestService } from '../../rest/rest.service';
7
6
  import { ClientMovement } from '../../../../models/client/client-movement';
8
- import { EventDispatcherService } from '../../../event/event-dispatcher.service';
7
+ import { IEventListener } from '../../../../interfaces/event-listener.interface';
9
8
  import * as i0 from "@angular/core";
10
- export declare class ClientMovementService extends RestService<ClientMovementBase, ClientMovement> {
11
- protected http: HttpClient;
12
- protected eventDispatcherService: EventDispatcherService;
13
- protected environment: any;
9
+ export declare class ClientMovementService extends RestService<ClientMovementBase, ClientMovement> implements IEventListener {
14
10
  modelClass: typeof ClientMovement;
15
11
  url: string;
16
12
  isHydra: boolean;
17
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
18
13
  /**
19
14
  * @TODO BaseRestService should return collection
20
15
  */
@@ -1,19 +1,14 @@
1
- import { HttpClient } from '@angular/common/http';
2
1
  import { IncomeSourceForecast as IncomeSourceForecastBase } from '../../../../db/Models/income-source-forecast';
3
2
  import { RestService } from '../../rest/rest.service';
4
3
  import { IncomeSourceForecast } from '../../../../models/income-source/income-source-forecast';
5
- import { EventDispatcherService } from '../../../event/event-dispatcher.service';
4
+ import { IEventListener } from '../../../../interfaces/event-listener.interface';
6
5
  import * as i0 from "@angular/core";
7
6
  /**
8
7
  * Service to work with Other Income Forecasts
9
8
  */
10
- export declare class IncomeSourceForecastService extends RestService<IncomeSourceForecastBase, IncomeSourceForecast> {
11
- protected http: HttpClient;
12
- protected eventDispatcherService: EventDispatcherService;
13
- protected environment: any;
9
+ export declare class IncomeSourceForecastService extends RestService<IncomeSourceForecastBase, IncomeSourceForecast> implements IEventListener {
14
10
  modelClass: typeof IncomeSourceForecast;
15
11
  url: string;
16
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
17
12
  /**
18
13
  * Listen to Income Sources events
19
14
  */
@@ -1,25 +1,19 @@
1
1
  import { Observable, ReplaySubject } from 'rxjs';
2
- import { HttpClient } from '@angular/common/http';
3
2
  import { IncomeSource as IncomeSourceBase } from '../../../db/Models/income-source';
4
3
  import { RestService } from '../rest/rest.service';
5
4
  import { IncomeSourceType } from '../../../models/income-source/income-source-type';
6
5
  import { SalaryForecast } from '../../../models/income-source/salary-forecast';
7
6
  import { IncomeSourceTypeEnum } from '../../../db/Enums/income-source-type.enum';
8
- import { EventDispatcherService } from '../../event/event-dispatcher.service';
9
7
  import { IncomeSource } from '../../../models/income-source/income-source';
10
8
  import * as i0 from "@angular/core";
11
9
  /**
12
10
  * Service to work with income sources
13
11
  */
14
12
  export declare class IncomeSourceService extends RestService<IncomeSourceBase, IncomeSource> {
15
- protected http: HttpClient;
16
- protected eventDispatcherService: EventDispatcherService;
17
- protected environment: any;
18
13
  url: string;
19
14
  modelClass: typeof IncomeSource;
20
15
  incomeSourceTypes: IncomeSourceType[];
21
16
  incomeSourceTypeSubject: ReplaySubject<IncomeSourceType[]>;
22
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
23
17
  /**
24
18
  * Get income sources tax calculation
25
19
  * @param salaryForecast for which tax should be calculated
@@ -1,20 +1,14 @@
1
1
  import { SalaryForecast as SalaryForecastBase } from '../../../../db/Models/salary-forecast';
2
- import { HttpClient } from '@angular/common/http';
3
2
  import { RestService } from '../../rest/rest.service';
4
- import { IEventListener } from '../../../../interfaces/event-listener.interface';
5
3
  import { SalaryForecast } from '../../../../models/income-source/salary-forecast';
6
- import { EventDispatcherService } from '../../../event/event-dispatcher.service';
4
+ import { IEventListener } from '../../../../interfaces/event-listener.interface';
7
5
  import * as i0 from "@angular/core";
8
6
  /**
9
7
  * Service to work with Salary Forecasts
10
8
  */
11
9
  export declare class SalaryForecastService extends RestService<SalaryForecastBase, SalaryForecast> implements IEventListener {
12
- protected http: HttpClient;
13
- protected eventDispatcherService: EventDispatcherService;
14
- protected environment: any;
15
10
  modelClass: typeof SalaryForecast;
16
11
  url: string;
17
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
18
12
  /**
19
13
  * Listen to Income Sources events
20
14
  */
@@ -1,16 +1,11 @@
1
- import { HttpClient } from '@angular/common/http';
2
1
  import { SoleForecast as SoleForecastBase } from '../../../../db/Models/sole-forecast';
3
2
  import { RestService } from '../../rest/rest.service';
4
3
  import { SoleForecast } from '../../../../models/income-source/sole-forecast';
5
- import { EventDispatcherService } from '../../../event/event-dispatcher.service';
4
+ import { IEventListener } from '../../../../interfaces/event-listener.interface';
6
5
  import * as i0 from "@angular/core";
7
- export declare class SoleForecastService extends RestService<SoleForecastBase, SoleForecast> {
8
- protected http: HttpClient;
9
- protected eventDispatcherService: EventDispatcherService;
10
- protected environment: any;
6
+ export declare class SoleForecastService extends RestService<SoleForecastBase, SoleForecast> implements IEventListener {
11
7
  modelClass: typeof SoleForecast;
12
8
  url: string;
13
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
14
9
  /**
15
10
  * Listen to Income Sources events
16
11
  */
@@ -1,21 +1,16 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { Loan as LoanBase } from '../../../db/Models/loan';
3
- import { HttpClient } from '@angular/common/http';
4
3
  import { RestService } from '../rest/rest.service';
5
4
  import { Loan } from '../../../models/loan/loan';
6
- import { EventDispatcherService } from '../../event/event-dispatcher.service';
7
5
  import { LoanPayout } from '../../../models/loan/loan-payout';
6
+ import { IEventListener } from '../../../interfaces/event-listener.interface';
8
7
  import * as i0 from "@angular/core";
9
8
  /**
10
9
  * Service that handling loans logic
11
10
  */
12
- export declare class LoanService extends RestService<LoanBase, Loan> {
13
- protected http: HttpClient;
14
- protected eventDispatcherService: EventDispatcherService;
15
- protected environment: any;
11
+ export declare class LoanService extends RestService<LoanBase, Loan> implements IEventListener {
16
12
  url: string;
17
13
  modelClass: typeof Loan;
18
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
19
14
  /**
20
15
  * Listen to Loans events
21
16
  */
@@ -1,20 +1,15 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { PropertyDocument as PropertyDocumentBase } from '../../../../db/Models/property/property-document';
3
- import { HttpClient } from '@angular/common/http';
4
- import { EventDispatcherService } from '../../../event/event-dispatcher.service';
5
3
  import { PropertyDocument } from '../../../../models/property/property-document';
6
4
  import { RestService } from '../../rest/rest.service';
5
+ import { IEventListener } from '../../../../interfaces/event-listener.interface';
7
6
  import * as i0 from "@angular/core";
8
7
  /**
9
8
  * Class for work with Property Documents
10
9
  */
11
- export declare class PropertyDocumentService extends RestService<PropertyDocumentBase, PropertyDocument> {
12
- protected http: HttpClient;
13
- protected eventDispatcherService: EventDispatcherService;
14
- protected environment: any;
10
+ export declare class PropertyDocumentService extends RestService<PropertyDocumentBase, PropertyDocument> implements IEventListener {
15
11
  modelClass: typeof PropertyDocument;
16
12
  url: string;
17
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
18
13
  /**
19
14
  * Add new Property Document
20
15
  */
@@ -24,7 +19,7 @@ export declare class PropertyDocumentService extends RestService<PropertyDocumen
24
19
  * @param propertyId to get desired documents
25
20
  */
26
21
  getByPropertyId(propertyId: number): Observable<PropertyDocument[]>;
27
- private listenEvents;
22
+ listenEvents(): void;
28
23
  private listenPropertyUpdateWithDocument;
29
24
  static ɵfac: i0.ɵɵFactoryDeclaration<PropertyDocumentService, never>;
30
25
  static ɵprov: i0.ɵɵInjectableDeclaration<PropertyDocumentService>;
@@ -1,17 +1,12 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { PropertyShare as PropertyShareBase } from '../../../../db/Models/property/property-share';
3
- import { HttpClient } from '@angular/common/http';
4
- import { EventDispatcherService } from '../../../event/event-dispatcher.service';
5
3
  import { PropertyShare } from '../../../../models/property/property-share';
6
4
  import { RestService } from '../../rest/rest.service';
5
+ import { IEventListener } from '../../../../interfaces/event-listener.interface';
7
6
  import * as i0 from "@angular/core";
8
- export declare class PropertyShareService extends RestService<PropertyShareBase, PropertyShare> {
9
- protected http: HttpClient;
10
- protected eventDispatcherService: EventDispatcherService;
11
- protected environment: any;
7
+ export declare class PropertyShareService extends RestService<PropertyShareBase, PropertyShare> implements IEventListener {
12
8
  url: string;
13
9
  modelClass: typeof PropertyShare;
14
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
15
10
  /**
16
11
  * Listen to Event Dispatcher events
17
12
  */
@@ -1,20 +1,15 @@
1
1
  import { Property as PropertyBase } from '../../../db/Models/property/property';
2
2
  import { Observable } from 'rxjs';
3
- import { HttpClient } from '@angular/common/http';
4
3
  import { RestService } from '../rest/rest.service';
5
4
  import { Property } from '../../../models/property/property';
6
- import { EventDispatcherService } from '../../event/event-dispatcher.service';
5
+ import { IEventListener } from '../../../interfaces/event-listener.interface';
7
6
  import * as i0 from "@angular/core";
8
7
  /**
9
8
  * Service for work with Property
10
9
  */
11
- export declare class PropertyService extends RestService<PropertyBase, Property> {
12
- protected http: HttpClient;
13
- protected eventDispatcherService: EventDispatcherService;
14
- protected environment: any;
10
+ export declare class PropertyService extends RestService<PropertyBase, Property> implements IEventListener {
15
11
  modelClass: typeof Property;
16
12
  url: string;
17
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
18
13
  listenEvents(): void;
19
14
  /**
20
15
  * Update cache when share invitation accepted
@@ -1,23 +1,34 @@
1
1
  import { Observable, ReplaySubject } from 'rxjs';
2
2
  import { HttpClient } from '@angular/common/http';
3
3
  import { EventDispatcherService } from '../../event/event-dispatcher.service';
4
+ import { ToastService } from '../../toast/toast.service';
5
+ import { IEventListener } from '../../../interfaces/event-listener.interface';
4
6
  import * as i0 from "@angular/core";
5
7
  /**
6
8
  * Abstract base service that implements common services functionality
7
9
  * and describe abstract methods/properties that have to be implemented in child services
8
10
  * Model - entity service is working with
9
11
  * BaseModel - base entity model that extends by Model
12
+ * @TODO Alex: refactor all services for work with collections instead of arrays
13
+ * @TODO Alex: implement smart system of default toast messages
10
14
  */
11
- export declare abstract class RestService<BaseModel, Model extends BaseModel> {
15
+ export declare abstract class RestService<BaseModel, Model extends BaseModel> implements IEventListener {
12
16
  protected http: HttpClient;
13
17
  protected eventDispatcherService: EventDispatcherService;
14
18
  protected environment: any;
19
+ protected toastService: ToastService;
15
20
  abstract url: string;
16
21
  abstract modelClass: any;
17
22
  protected cache: Model[];
18
23
  protected cacheSubject: ReplaySubject<Model[]>;
19
24
  protected isHydra: boolean;
20
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
25
+ messageCreated: string;
26
+ messageCreatedBatch: string;
27
+ messageUpdated: string;
28
+ messageUpdatedBatch: string;
29
+ messageDeleted: string;
30
+ messageDeletedBatch: string;
31
+ constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, toastService: ToastService);
21
32
  /**
22
33
  * get cached list of all instances
23
34
  */
@@ -86,6 +97,10 @@ export declare abstract class RestService<BaseModel, Model extends BaseModel> {
86
97
  * @param baseModel base model instance that we will use as constructor options
87
98
  */
88
99
  protected createModelInstance(model: new (bm: BaseModel) => Model, baseModel: BaseModel): Model;
100
+ /**
101
+ * Method that call all listeners. Empty by default. Should be redefined by child services if required
102
+ */
103
+ listenEvents(): void;
89
104
  static ɵfac: i0.ɵɵFactoryDeclaration<RestService<any, any>, never>;
90
105
  static ɵprov: i0.ɵɵInjectableDeclaration<RestService<any, any>>;
91
106
  }
@@ -1,27 +1,24 @@
1
1
  import { ServiceNotification as NotificationBase } from '../../../db/Models/service-notification';
2
2
  import { Notification } from '../../../models/notification/notification';
3
3
  import { HttpClient } from '@angular/common/http';
4
- import { IEventListener } from '../../../interfaces/event-listener.interface';
5
4
  import { RestService } from '../rest/rest.service';
6
5
  import { EventDispatcherService } from '../../event/event-dispatcher.service';
7
6
  import { SseService } from '../../event/sse.service';
7
+ import { ToastService } from '../../toast/toast.service';
8
8
  import * as i0 from "@angular/core";
9
9
  /**
10
10
  * Service to handle service notifications logic
11
11
  */
12
- export declare class ServiceNotificationService extends RestService<NotificationBase, Notification> implements IEventListener {
12
+ export declare class ServiceNotificationService extends RestService<NotificationBase, Notification> {
13
13
  protected http: HttpClient;
14
14
  protected eventDispatcherService: EventDispatcherService;
15
15
  protected environment: any;
16
+ protected toastService: ToastService;
16
17
  private sseService;
17
18
  modelClass: typeof Notification;
18
19
  url: string;
19
20
  isHydra: boolean;
20
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, sseService: SseService);
21
- /**
22
- * SSE and Event Dispatcher Services listeners
23
- */
24
- listenEvents(): void;
21
+ constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, toastService: ToastService, sseService: SseService);
25
22
  /**
26
23
  * subscribe to new chat messages
27
24
  */
@@ -21,7 +21,6 @@ export declare class SubscriptionService {
21
21
  _servicePayments: ServicePayment[];
22
22
  subscriptionChangeSubject: BehaviorSubject<ServiceSubscription>;
23
23
  constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, sseService: SseService, environment: any);
24
- listenEvents(): void;
25
24
  getSubscription(force?: boolean): Observable<ServiceSubscription>;
26
25
  /**
27
26
  * @TODO right now we have only monthly prices, the function should be refactored to support other options in future
@@ -1,19 +1,19 @@
1
1
  import { TaxReview as TaxReviewBase } from '../../../../db/Models/tax-review';
2
- import { HttpClient } from '@angular/common/http';
3
2
  import { RestService } from '../../rest/rest.service';
4
3
  import { TaxReview } from '../../../../models/tax-review/tax-review';
5
- import { EventDispatcherService } from '../../../event/event-dispatcher.service';
4
+ import { IEventListener } from '../../../../interfaces/event-listener.interface';
6
5
  import * as i0 from "@angular/core";
7
6
  /**
8
7
  * Service to work with tax review history
9
8
  */
10
- export declare class TaxReviewHistoryService extends RestService<TaxReviewBase, TaxReview> {
11
- protected http: HttpClient;
12
- protected eventDispatcherService: EventDispatcherService;
13
- protected environment: any;
9
+ export declare class TaxReviewHistoryService extends RestService<TaxReviewBase, TaxReview> implements IEventListener {
14
10
  url: string;
15
11
  modelClass: typeof TaxReview;
16
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
12
+ listenEvents(): void;
13
+ /**
14
+ * Update tax review history cache when single tax review updated.
15
+ */
16
+ private listenTaxReviewUpdate;
17
17
  static ɵfac: i0.ɵɵFactoryDeclaration<TaxReviewHistoryService, never>;
18
18
  static ɵprov: i0.ɵɵInjectableDeclaration<TaxReviewHistoryService>;
19
19
  }
@@ -1,21 +1,15 @@
1
1
  import { TaxReview as TaxReviewBase } from '../../../db/Models/tax-review';
2
2
  import { Observable } from 'rxjs';
3
- import { HttpClient } from '@angular/common/http';
4
3
  import { RestService } from '../rest/rest.service';
5
- import { IEventListener } from '../../../interfaces/event-listener.interface';
6
4
  import { TaxReview } from '../../../models/tax-review/tax-review';
7
- import { EventDispatcherService } from '../../event/event-dispatcher.service';
5
+ import { IEventListener } from '../../../interfaces/event-listener.interface';
8
6
  import * as i0 from "@angular/core";
9
7
  /**
10
8
  * Service to work with tax review
11
9
  */
12
10
  export declare class TaxReviewService extends RestService<TaxReviewBase, TaxReview> implements IEventListener {
13
- protected http: HttpClient;
14
- protected eventDispatcherService: EventDispatcherService;
15
- protected environment: any;
16
11
  url: string;
17
12
  modelClass: typeof TaxReview;
18
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
19
13
  /**
20
14
  * Listen events from SSE and Event Dispatcher services
21
15
  */
@@ -2,11 +2,12 @@ import { HttpClient } from '@angular/common/http';
2
2
  import { Observable, ReplaySubject } from 'rxjs';
3
3
  import { TaxSummary } from '../../../models/tax-summary/tax-summary';
4
4
  import { EventDispatcherService } from '../../event/event-dispatcher.service';
5
+ import { IEventListener } from '../../../interfaces/event-listener.interface';
5
6
  import * as i0 from "@angular/core";
6
7
  /**
7
8
  * Service to work with tax summary logic
8
9
  */
9
- export declare class TaxSummaryService {
10
+ export declare class TaxSummaryService implements IEventListener {
10
11
  private http;
11
12
  private eventDispatcherService;
12
13
  protected environment: any;
@@ -1,22 +1,17 @@
1
- import { HttpClient } from '@angular/common/http';
2
1
  import { TransactionAllocation as TransactionAllocationBase } from '../../../../db/Models/transaction-allocation';
3
2
  import { TransactionAllocation } from '../../../../models/transaction/transaction-allocation';
4
3
  import { Transaction } from '../../../../models/transaction/transaction';
5
4
  import { RestService } from '../../rest/rest.service';
6
- import { EventDispatcherService } from '../../../event/event-dispatcher.service';
7
5
  import { Observable } from 'rxjs';
6
+ import { IEventListener } from '../../../../interfaces/event-listener.interface';
8
7
  import * as i0 from "@angular/core";
9
8
  /**
10
9
  * Service for transaction allocations business logic
11
10
  * @TODO alex refactor
12
11
  */
13
- export declare class TransactionAllocationService extends RestService<TransactionAllocationBase, TransactionAllocation> {
14
- protected http: HttpClient;
15
- protected eventDispatcherService: EventDispatcherService;
16
- protected environment: any;
12
+ export declare class TransactionAllocationService extends RestService<TransactionAllocationBase, TransactionAllocation> implements IEventListener {
17
13
  url: string;
18
14
  modelClass: typeof TransactionAllocation;
19
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
20
15
  /**
21
16
  * Add single transaction allocation
22
17
  */
@@ -25,7 +20,7 @@ export declare class TransactionAllocationService extends RestService<Transactio
25
20
  * get list of transactions allocations related with passed bank transactions list
26
21
  */
27
22
  getByTransactions(transactions: Transaction[]): Observable<TransactionAllocation[]>;
28
- private listenEvents;
23
+ listenEvents(): void;
29
24
  /**
30
25
  * Reset cache on transactions created
31
26
  */
@@ -1,26 +1,18 @@
1
1
  import { EventEmitter } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
3
  import { Transaction as TransactionBase } from '../../../db/Models/transaction';
4
- import { HttpClient } from '@angular/common/http';
5
- import { EventDispatcherService } from '../../event/event-dispatcher.service';
6
4
  import { RestService } from '../rest/rest.service';
7
5
  import { Transaction } from '../../../models/transaction/transaction';
8
6
  import { ChartAccounts } from '../../../models/chart-accounts/chart-accounts';
9
7
  import { ChartAccountsTaxLabelsEnum } from '../../../models/chart-accounts/chart-accounts-tax-labels.enum';
10
- import { ToastService } from '../../toast/toast.service';
11
8
  import * as i0 from "@angular/core";
12
9
  /**
13
10
  * Service for transactions business logic
14
11
  */
15
12
  export declare class TransactionService extends RestService<TransactionBase, Transaction> {
16
- protected http: HttpClient;
17
- protected eventDispatcherService: EventDispatcherService;
18
- protected environment: any;
19
- protected toastService: ToastService;
20
13
  url: string;
21
14
  modelClass: typeof Transaction;
22
15
  transactionDeleted: EventEmitter<Transaction>;
23
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, toastService: ToastService);
24
16
  /**
25
17
  * Listen events from Event Dispatcher services
26
18
  */
@@ -85,10 +77,6 @@ export declare class TransactionService extends RestService<TransactionBase, Tra
85
77
  * tax type depends of chart account heading or category.
86
78
  */
87
79
  getTaxLabel(chartAccounts: ChartAccounts): ChartAccountsTaxLabelsEnum;
88
- /**
89
- * Get transactions related to Vehicle category
90
- */
91
- getVehicleTransactions(): Observable<Transaction[]>;
92
80
  /**
93
81
  * Listen to EventDispatcherService event related to Depreciation changing
94
82
  */
@@ -1,18 +1,12 @@
1
- import { HttpClient } from '@angular/common/http';
2
1
  import { UserEventSetting } from '../../../../models/user-event/user-event-setting';
3
2
  import { UserEventSetting as UserEventSettingBase } from '../../../../db/Models/user-event-setting';
4
- import { EventDispatcherService } from '../../../event/event-dispatcher.service';
5
3
  import { RestService } from '../../rest/rest.service';
6
4
  import { Observable } from 'rxjs';
7
5
  import * as i0 from "@angular/core";
8
6
  export declare class UserEventSettingService extends RestService<UserEventSettingBase, UserEventSetting> {
9
- protected http: HttpClient;
10
- protected eventDispatcherService: EventDispatcherService;
11
- protected environment: any;
12
7
  modelClass: typeof UserEventSetting;
13
8
  url: string;
14
9
  isHydra: boolean;
15
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
16
10
  /**
17
11
  * Send batch to add/updated settings
18
12
  */
@@ -1,17 +1,11 @@
1
- import { HttpClient } from '@angular/common/http';
2
1
  import { UserEventType as UserEventTypeBase } from '../../../../db/Models/user-event-type';
3
2
  import { UserEventType } from '../../../../models/user-event/user-event-type';
4
- import { EventDispatcherService } from '../../../event/event-dispatcher.service';
5
3
  import { RestService } from '../../rest/rest.service';
6
4
  import * as i0 from "@angular/core";
7
5
  export declare class UserEventTypeService extends RestService<UserEventTypeBase, UserEventType> {
8
- protected http: HttpClient;
9
- protected eventDispatcherService: EventDispatcherService;
10
- protected environment: any;
11
6
  modelClass: typeof UserEventType;
12
7
  url: string;
13
8
  isHydra: boolean;
14
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
15
9
  static ɵfac: i0.ɵɵFactoryDeclaration<UserEventTypeService, never>;
16
10
  static ɵprov: i0.ɵɵInjectableDeclaration<UserEventTypeService>;
17
11
  }
@@ -0,0 +1,11 @@
1
+ export declare enum MessagesEnum {
2
+ VEHICLE_CREATED = "Vehicle created successfully",
3
+ VEHICLE_UPDATED = "Vehicle updated successfully",
4
+ VEHICLE_DELETED = "Vehicle deleted successfully",
5
+ VEHICLE_CLAIM_CREATED = "Vehicle claim created successfully",
6
+ VEHICLE_CLAIM_UPDATED = "Vehicle claim updated successfully",
7
+ VEHICLE_CLAIM_DELETED = "Vehicle claim deleted successfully",
8
+ VEHICLE_LOGBOOK_CREATED = "Vehicle logbook created successfully",
9
+ VEHICLE_LOGBOOK_UPDATED = "Vehicle logbook updated successfully",
10
+ VEHICLE_LOGBOOK_DELETED = "Vehicle logbook deleted successfully"
11
+ }
@@ -0,0 +1,13 @@
1
+ import { VehicleClaim as VehicleClaimBase } from '../../../db/Models/vehicle-claim';
2
+ import { VehicleClaim } from '../../../models/logbook/vehicle-claim';
3
+ import { RestService } from '../rest/rest.service';
4
+ import * as i0 from "@angular/core";
5
+ export declare class VehicleClaimService extends RestService<VehicleClaimBase, VehicleClaim> {
6
+ modelClass: typeof VehicleClaim;
7
+ url: string;
8
+ messageCreated: string;
9
+ messageUpdated: string;
10
+ messageDeleted: string;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<VehicleClaimService, never>;
12
+ static ɵprov: i0.ɵɵInjectableDeclaration<VehicleClaimService>;
13
+ }
@@ -0,0 +1,22 @@
1
+ import { VehicleLogbook } from '../../../models/logbook/vehicle-logbook';
2
+ import { Observable } from 'rxjs';
3
+ import { HttpClient } from '@angular/common/http';
4
+ import { EventDispatcherService } from '../../event/event-dispatcher.service';
5
+ import { ToastService } from '../../toast/toast.service';
6
+ import * as i0 from "@angular/core";
7
+ /**
8
+ * Vehicle logbook service. Allows user to add, update or delete vehicle trips
9
+ * @TODO extend rest service after it refactored
10
+ */
11
+ export declare class VehicleLogbookService {
12
+ private http;
13
+ private eventDispatcherService;
14
+ private environment;
15
+ private toastService;
16
+ constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, toastService: ToastService);
17
+ add(logbook: VehicleLogbook, vehicleId: number): Observable<VehicleLogbook>;
18
+ update(logbook: VehicleLogbook, vehicleId: number): Observable<any>;
19
+ delete(logbook: VehicleLogbook, vehicleId: number): Observable<void>;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<VehicleLogbookService, never>;
21
+ static ɵprov: i0.ɵɵInjectableDeclaration<VehicleLogbookService>;
22
+ }