taxtank-core 0.10.6 → 0.12.0

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 (162) hide show
  1. package/bundles/taxtank-core.umd.js +1723 -1351
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/account-setup-item.collection.js +11 -0
  4. package/esm2015/lib/collections/bank-transaction.collection.js +2 -2
  5. package/esm2015/lib/collections/collection-dictionary.js +4 -4
  6. package/esm2015/lib/collections/collection.js +4 -1
  7. package/esm2015/lib/collections/depreciation.collection.js +24 -10
  8. package/esm2015/lib/collections/transaction-allocation.collection.js +2 -2
  9. package/esm2015/lib/collections/transaction.collection.js +28 -1
  10. package/esm2015/lib/collections/vehicle-logbook.collection.js +88 -0
  11. package/esm2015/lib/collections/vehicle.collection.js +9 -0
  12. package/esm2015/lib/db/Enums/chart-accounts-heading-vehicle-list.enum.js +3 -1
  13. package/esm2015/lib/db/Enums/chart-accounts-list.enum.js +4 -3
  14. package/esm2015/lib/db/Enums/property/property-category-list.enum.js +2 -1
  15. package/esm2015/lib/db/Enums/user-status.enum.js +1 -2
  16. package/esm2015/lib/db/Models/client-details.js +1 -1
  17. package/esm2015/lib/db/Models/client-income-types.js +3 -0
  18. package/esm2015/lib/db/Models/vehicle-claim.js +1 -1
  19. package/esm2015/lib/db/Models/vehicle.js +1 -1
  20. package/esm2015/lib/forms/client/client-income-types.form.js +22 -0
  21. package/esm2015/lib/forms/index.js +4 -1
  22. package/esm2015/lib/forms/vehicle/vehicle-claim.form.js +114 -0
  23. package/esm2015/lib/forms/vehicle/vehicle.form.js +20 -0
  24. package/esm2015/lib/interfaces/event-listener.interface.js +1 -1
  25. package/esm2015/lib/interfaces/expense.interface.js +2 -0
  26. package/esm2015/lib/interfaces/tank.interface.js +1 -1
  27. package/esm2015/lib/models/account-setup/account-setup-item.js +6 -0
  28. package/esm2015/lib/models/account-setup/account-setup-items.const.js +44 -0
  29. package/esm2015/lib/models/account-setup/account-setup-items.enum.js +14 -0
  30. package/esm2015/lib/models/chart-accounts/chart-accounts-value.js +4 -0
  31. package/esm2015/lib/models/chart-accounts/chart-accounts.js +34 -1
  32. package/esm2015/lib/models/client/client-income-types.js +10 -0
  33. package/esm2015/lib/models/depreciation/depreciation.js +5 -1
  34. package/esm2015/lib/models/event/app-event-type.enum.js +4 -1
  35. package/esm2015/lib/models/export/export-data-table.js +6 -0
  36. package/esm2015/lib/models/logbook/logbook-period.js +8 -1
  37. package/esm2015/lib/models/logbook/vehicle-claim.js +63 -4
  38. package/esm2015/lib/models/logbook/vehicle-logbook.js +9 -3
  39. package/esm2015/lib/models/logbook/vehicle.js +7 -29
  40. package/esm2015/lib/models/pdf/pdf-config.js +2 -2
  41. package/esm2015/lib/models/pdf/pdf-orientation.enum.js +6 -0
  42. package/esm2015/lib/models/transaction/transaction.js +1 -1
  43. package/esm2015/lib/services/account-setup/account-setup.service.js +109 -0
  44. package/esm2015/lib/services/http/bank/bank-account/bank-account.service.js +6 -15
  45. package/esm2015/lib/services/http/bank/bank-connection/bank-connection.service.js +6 -15
  46. package/esm2015/lib/services/http/bank/bank-transaction/bank-transaction.service.js +6 -15
  47. package/esm2015/lib/services/http/bank/basiq/basiq.service.js +6 -15
  48. package/esm2015/lib/services/http/chart-accounts/chart-accounts.service.js +1 -1
  49. package/esm2015/lib/services/http/chat/chat.service.js +8 -12
  50. package/esm2015/lib/services/http/chat/message/message.service.js +8 -12
  51. package/esm2015/lib/services/http/chat/message-document/message-document.service.js +1 -1
  52. package/esm2015/lib/services/http/depreciation/depreciation.service.js +6 -23
  53. package/esm2015/lib/services/http/document/document-folder/document-folder.service.js +6 -14
  54. package/esm2015/lib/services/http/firm/client-income/client-income-types.service.js +50 -0
  55. package/esm2015/lib/services/http/firm/client-movement/client-movement.service.js +6 -15
  56. package/esm2015/lib/services/http/income-source/income-source-forecast/income-source-forecast.service.js +6 -15
  57. package/esm2015/lib/services/http/income-source/income-source.service.js +6 -14
  58. package/esm2015/lib/services/http/income-source/salary-forecast/salary-forecast.service.js +6 -15
  59. package/esm2015/lib/services/http/income-source/sole-forecast/sole-forecast.service.js +6 -15
  60. package/esm2015/lib/services/http/loan/loan.service.js +6 -15
  61. package/esm2015/lib/services/http/property/property-document/property-document.service.js +6 -15
  62. package/esm2015/lib/services/http/property/property-share/property-share.service.js +6 -15
  63. package/esm2015/lib/services/http/property/property.service.js +6 -15
  64. package/esm2015/lib/services/http/rest/rest.service.js +31 -4
  65. package/esm2015/lib/services/http/service-notification/service-notification.service.js +8 -12
  66. package/esm2015/lib/services/http/subscription/subscription.service.js +1 -4
  67. package/esm2015/lib/services/http/tax-review/tax-review-history/tax-review-history.service.js +15 -16
  68. package/esm2015/lib/services/http/tax-review/tax-review.service.js +6 -15
  69. package/esm2015/lib/services/http/tax-summary/tax-summary.service.js +1 -1
  70. package/esm2015/lib/services/http/transaction/transaction-allocation/transaction-allocation.service.js +6 -15
  71. package/esm2015/lib/services/http/transaction/transaction.service.js +16 -25
  72. package/esm2015/lib/services/http/user/user-event-setting/user-event-setting.service.js +6 -14
  73. package/esm2015/lib/services/http/user/user-event-type/user-event-type.service.js +6 -14
  74. package/esm2015/lib/services/http/vehicle/messages.enum.js +13 -0
  75. package/esm2015/lib/services/http/vehicle/vehicle-claim.service.js +24 -0
  76. package/esm2015/lib/services/http/vehicle/vehicle-logbook.service.js +59 -0
  77. package/esm2015/lib/services/http/vehicle/vehicle.service.js +49 -213
  78. package/esm2015/lib/services/pdf/pdf.service.js +51 -26
  79. package/esm2015/lib/services/property/property-holding-costs/property-holding-costs.service.js +53 -0
  80. package/esm2015/lib/validators/at-least-one.validator.js +11 -0
  81. package/esm2015/lib/validators/index.js +2 -0
  82. package/esm2015/public-api.js +16 -2
  83. package/fesm2015/taxtank-core.js +1536 -1155
  84. package/fesm2015/taxtank-core.js.map +1 -1
  85. package/lib/collections/account-setup-item.collection.d.ts +6 -0
  86. package/lib/collections/collection.d.ts +1 -0
  87. package/lib/collections/depreciation.collection.d.ts +5 -4
  88. package/lib/collections/transaction.collection.d.ts +9 -0
  89. package/lib/collections/vehicle-logbook.collection.d.ts +30 -0
  90. package/lib/collections/vehicle.collection.d.ts +6 -0
  91. package/lib/db/Enums/chart-accounts-heading-vehicle-list.enum.d.ts +3 -1
  92. package/lib/db/Enums/chart-accounts-list.enum.d.ts +4 -3
  93. package/lib/db/Enums/property/property-category-list.enum.d.ts +2 -1
  94. package/lib/db/Enums/user-status.enum.d.ts +1 -2
  95. package/lib/db/Models/client-details.d.ts +5 -1
  96. package/lib/db/Models/client-income-types.d.ts +11 -0
  97. package/lib/db/Models/vehicle-claim.d.ts +2 -0
  98. package/lib/db/Models/vehicle.d.ts +2 -0
  99. package/lib/forms/client/client-income-types.form.d.ts +7 -0
  100. package/lib/forms/index.d.ts +3 -0
  101. package/lib/forms/vehicle/vehicle-claim.form.d.ts +43 -0
  102. package/lib/forms/vehicle/vehicle.form.d.ts +11 -0
  103. package/lib/interfaces/event-listener.interface.d.ts +1 -0
  104. package/lib/interfaces/expense.interface.d.ts +12 -0
  105. package/lib/interfaces/tank.interface.d.ts +2 -0
  106. package/lib/models/account-setup/account-setup-item.d.ts +9 -0
  107. package/lib/models/account-setup/account-setup-items.const.d.ts +7 -0
  108. package/lib/models/account-setup/account-setup-items.enum.d.ts +12 -0
  109. package/lib/models/chart-accounts/chart-accounts-value.d.ts +3 -0
  110. package/lib/models/chart-accounts/chart-accounts.d.ts +18 -0
  111. package/lib/models/client/client-income-types.d.ts +7 -0
  112. package/lib/models/depreciation/depreciation.d.ts +6 -2
  113. package/lib/models/event/app-event-type.enum.d.ts +4 -1
  114. package/lib/models/export/export-data-table.d.ts +9 -0
  115. package/lib/models/logbook/logbook-period.d.ts +4 -0
  116. package/lib/models/logbook/vehicle-claim.d.ts +20 -3
  117. package/lib/models/logbook/vehicle-logbook.d.ts +8 -2
  118. package/lib/models/logbook/vehicle.d.ts +5 -7
  119. package/lib/models/pdf/pdf-orientation.enum.d.ts +4 -0
  120. package/lib/models/transaction/transaction.d.ts +2 -2
  121. package/lib/services/account-setup/account-setup.service.d.ts +43 -0
  122. package/lib/services/http/bank/bank-account/bank-account.service.d.ts +2 -7
  123. package/lib/services/http/bank/bank-connection/bank-connection.service.d.ts +2 -7
  124. package/lib/services/http/bank/bank-transaction/bank-transaction.service.d.ts +3 -8
  125. package/lib/services/http/bank/basiq/basiq.service.d.ts +2 -7
  126. package/lib/services/http/chat/chat.service.d.ts +4 -7
  127. package/lib/services/http/chat/message/message.service.d.ts +4 -7
  128. package/lib/services/http/chat/message-document/message-document.service.d.ts +3 -3
  129. package/lib/services/http/depreciation/depreciation.service.d.ts +2 -11
  130. package/lib/services/http/document/document-folder/document-folder.service.d.ts +0 -6
  131. package/lib/services/http/firm/client-income/client-income-types.service.d.ts +18 -0
  132. package/lib/services/http/firm/client-movement/client-movement.service.d.ts +2 -7
  133. package/lib/services/http/income-source/income-source-forecast/income-source-forecast.service.d.ts +2 -7
  134. package/lib/services/http/income-source/income-source.service.d.ts +0 -6
  135. package/lib/services/http/income-source/salary-forecast/salary-forecast.service.d.ts +1 -7
  136. package/lib/services/http/income-source/sole-forecast/sole-forecast.service.d.ts +2 -7
  137. package/lib/services/http/loan/loan.service.d.ts +2 -7
  138. package/lib/services/http/property/property-document/property-document.service.d.ts +3 -8
  139. package/lib/services/http/property/property-share/property-share.service.d.ts +2 -7
  140. package/lib/services/http/property/property.service.d.ts +2 -7
  141. package/lib/services/http/rest/rest.service.d.ts +17 -2
  142. package/lib/services/http/service-notification/service-notification.service.d.ts +4 -7
  143. package/lib/services/http/subscription/subscription.service.d.ts +0 -1
  144. package/lib/services/http/tax-review/tax-review-history/tax-review-history.service.d.ts +7 -7
  145. package/lib/services/http/tax-review/tax-review.service.d.ts +1 -7
  146. package/lib/services/http/tax-summary/tax-summary.service.d.ts +2 -1
  147. package/lib/services/http/transaction/transaction-allocation/transaction-allocation.service.d.ts +3 -8
  148. package/lib/services/http/transaction/transaction.service.d.ts +4 -12
  149. package/lib/services/http/user/user-event-setting/user-event-setting.service.d.ts +0 -6
  150. package/lib/services/http/user/user-event-type/user-event-type.service.d.ts +0 -6
  151. package/lib/services/http/vehicle/messages.enum.d.ts +11 -0
  152. package/lib/services/http/vehicle/vehicle-claim.service.d.ts +13 -0
  153. package/lib/services/http/vehicle/vehicle-logbook.service.d.ts +22 -0
  154. package/lib/services/http/vehicle/vehicle.service.d.ts +17 -80
  155. package/lib/services/pdf/pdf.service.d.ts +16 -2
  156. package/lib/services/property/property-holding-costs/property-holding-costs.service.d.ts +24 -0
  157. package/lib/validators/at-least-one.validator.d.ts +6 -0
  158. package/lib/validators/index.d.ts +1 -0
  159. package/package.json +1 -1
  160. package/public-api.d.ts +15 -1
  161. package/esm2015/lib/collections/logbook.collection.js +0 -97
  162. package/lib/collections/logbook.collection.d.ts +0 -19
@@ -1,21 +1,16 @@
1
1
  import { BankTransaction as BankTransactionBase } from '../../../../db/Models/bank-transaction';
2
2
  import { Observable } from 'rxjs';
3
3
  import { RestService } from '../../rest/rest.service';
4
- import { HttpClient } from '@angular/common/http';
5
4
  import { BankTransaction } from '../../../../models/bank/bank-transaction';
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 bank transactions business logic
10
9
  */
11
- export declare class BankTransactionService extends RestService<BankTransactionBase, BankTransaction> {
12
- protected http: HttpClient;
13
- protected eventDispatcherService: EventDispatcherService;
14
- protected environment: any;
10
+ export declare class BankTransactionService extends RestService<BankTransactionBase, BankTransaction> implements IEventListener {
15
11
  url: string;
16
12
  modelClass: typeof BankTransaction;
17
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
18
- private listenEvents;
13
+ listenEvents(): void;
19
14
  /**
20
15
  * get list of bank transactions for passed bank account id
21
16
  * @param bankAccountId Id of bank account we search bank transactions for
@@ -1,25 +1,20 @@
1
- import { HttpClient } from '@angular/common/http';
2
1
  import { Observable, ReplaySubject } from 'rxjs';
3
2
  import { BankAccount as BankAccountBase } from '../../../../db/Models/bank-account';
4
3
  import { RestService } from '../../rest/rest.service';
5
4
  import { BankAccount } from '../../../../models/bank/bank-account';
6
5
  import { BasiqToken } from '../../../../models/bank/basiq-token';
7
- import { EventDispatcherService } from '../../../event/event-dispatcher.service';
8
6
  import { BankConnection } from '../../../../models/bank/bank-connection';
7
+ import { IEventListener } from '../../../../interfaces/event-listener.interface';
9
8
  import * as i0 from "@angular/core";
10
9
  /**
11
10
  * basiq is a middleman between bank and user
12
11
  * service is responsible for fetching bank related information
13
12
  */
14
- export declare class BasiqService extends RestService<BankAccountBase, BankAccount> {
15
- protected http: HttpClient;
16
- protected eventDispatcherService: EventDispatcherService;
17
- protected environment: any;
13
+ export declare class BasiqService extends RestService<BankAccountBase, BankAccount> implements IEventListener {
18
14
  token: BasiqToken;
19
15
  tokenSubject: ReplaySubject<BasiqToken>;
20
16
  url: string;
21
17
  modelClass: typeof BankAccount;
22
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
23
18
  /**
24
19
  * Listen events from Event Dispatcher service
25
20
  */
@@ -2,26 +2,23 @@ import { Chat as ChatBase } from '../../../db/Models/chat';
2
2
  import { HttpClient } from '@angular/common/http';
3
3
  import { SseService } from '../../event/sse.service';
4
4
  import { RestService } from '../rest/rest.service';
5
- import { IEventListener } from '../../../interfaces/event-listener.interface';
6
5
  import { Chat } from '../../../models/chat/chat';
7
6
  import { EventDispatcherService } from '../../event/event-dispatcher.service';
7
+ import { ToastService } from '../../toast/toast.service';
8
8
  import * as i0 from "@angular/core";
9
9
  /**
10
10
  * Service for work with chats
11
11
  */
12
- export declare class ChatService extends RestService<ChatBase, Chat> implements IEventListener {
12
+ export declare class ChatService extends RestService<ChatBase, Chat> {
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 Chat;
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
  * Listen chats events
27
24
  */
@@ -1,27 +1,24 @@
1
1
  import { Message as MessageBase } from '../../../../db/Models/message';
2
- import { IEventListener } from '../../../../interfaces/event-listener.interface';
3
2
  import { HttpClient } from '@angular/common/http';
4
3
  import { Message } from '../../../../models/chat/message';
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 for work with messages
11
11
  */
12
- export declare class MessageService extends RestService<MessageBase, Message> implements IEventListener {
12
+ export declare class MessageService extends RestService<MessageBase, Message> {
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 Message;
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
  */
@@ -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
@@ -0,0 +1,18 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable, ReplaySubject } from 'rxjs';
3
+ import { ClientIncomeTypes } from '../../../../models/client/client-income-types';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * @TODO extend rest service when it could work with single objects, not only arrays
7
+ */
8
+ export declare class ClientIncomeTypesService {
9
+ private http;
10
+ private environment;
11
+ cache: ClientIncomeTypes;
12
+ cacheSubject: ReplaySubject<ClientIncomeTypes>;
13
+ constructor(http: HttpClient, environment: any);
14
+ get(): Observable<ClientIncomeTypes>;
15
+ update(incomeTypes: ClientIncomeTypes): Observable<ClientIncomeTypes>;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<ClientIncomeTypesService, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<ClientIncomeTypesService>;
18
+ }
@@ -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
  */