taxtank-core 0.24.0 → 0.24.3

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.
@@ -0,0 +1,8 @@
1
+ import { Collection } from './collection';
2
+ import { ClientInvite } from '../models/client/client-invite';
3
+ /**
4
+ * Collection of tax review
5
+ */
6
+ export declare class ClientInviteCollection extends Collection<ClientInvite> {
7
+ getPending(): this;
8
+ }
@@ -39,11 +39,16 @@ export declare enum AppEventTypeEnum {
39
39
  TRANSACTION_CREATED = 37,
40
40
  TRANSACTION_DELETED = 38,
41
41
  TRANSACTION_UPDATED = 39,
42
- TRANSACTIONS_CREATED = 40,
43
- USER_UPDATED = 41,
44
- VEHICLE_CLAIM_UPDATED = 42,
45
- VEHICLE_CLAIM_CREATED = 43,
46
- VEHICLE_LOGBOOK_CREATED = 44,
47
- VEHICLE_LOGBOOK_UPDATED = 45,
48
- VEHICLE_LOGBOOK_DELETED = 46
42
+ TRANSACTION_CREATED_WITH_NEW_RECEIPT = 40,
43
+ TRANSACTION_UPDATED_WITH_NEW_RECEIPT = 41,
44
+ TRANSACTION_UPDATED_WITH_DELETED_RECEIPT = 42,
45
+ TRANSACTION_RECEIPT_CREATED = 43,
46
+ TRANSACTION_RECEIPT_DELETED = 44,
47
+ TRANSACTIONS_CREATED = 45,
48
+ USER_UPDATED = 46,
49
+ VEHICLE_CLAIM_UPDATED = 47,
50
+ VEHICLE_CLAIM_CREATED = 48,
51
+ VEHICLE_LOGBOOK_CREATED = 49,
52
+ VEHICLE_LOGBOOK_UPDATED = 50,
53
+ VEHICLE_LOGBOOK_DELETED = 51
49
54
  }
@@ -0,0 +1,28 @@
1
+ import { Transaction } from '../../../../models/transaction/transaction';
2
+ import { HttpClient } from '@angular/common/http';
3
+ import { EventDispatcherService } from '../../../event/event-dispatcher.service';
4
+ import { IEventListener } from '../../../../interfaces/event-listener.interface';
5
+ import * as i0 from "@angular/core";
6
+ export declare class TransactionReceiptService implements IEventListener {
7
+ private http;
8
+ private eventDispatcherService;
9
+ private environment;
10
+ url: string;
11
+ constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
12
+ /**
13
+ * Transaction instance is necessary to take the ID and the receipt file from it.
14
+ */
15
+ add(transaction: Transaction): void;
16
+ /**
17
+ * Transaction instance is necessary to take the ID and the receipt ID from it.
18
+ */
19
+ delete(transaction: Transaction): void;
20
+ listenEvents(): void;
21
+ private listenTransactionWithReceiptUpdated;
22
+ /**
23
+ * Case when transaction was updated, but receipt was removed
24
+ */
25
+ private listenTransactionWithoutReceiptUpdated;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<TransactionReceiptService, never>;
27
+ static ɵprov: i0.ɵɵInjectableDeclaration<TransactionReceiptService>;
28
+ }
@@ -5,14 +5,24 @@ import { RestService } from '../rest/rest.service';
5
5
  import { Transaction } from '../../../models/transaction/transaction';
6
6
  import { ChartAccounts } from '../../../models/chart-accounts/chart-accounts';
7
7
  import { ChartAccountsTaxLabelsEnum } from '../../../models/chart-accounts/chart-accounts-tax-labels.enum';
8
+ import { TransactionReceiptService } from './transaction-receipt/transaction-receipt.service';
9
+ import { HttpClient } from '@angular/common/http';
10
+ import { EventDispatcherService } from '../../event/event-dispatcher.service';
11
+ import { ToastService } from '../../toast/toast.service';
8
12
  import * as i0 from "@angular/core";
9
13
  /**
10
14
  * Service for transactions business logic
11
15
  */
12
16
  export declare class TransactionService extends RestService<TransactionBase, Transaction> {
17
+ protected http: HttpClient;
18
+ protected eventDispatcherService: EventDispatcherService;
19
+ protected environment: any;
20
+ protected toastService: ToastService;
21
+ private transactionReceiptService;
13
22
  url: string;
14
23
  modelClass: typeof Transaction;
15
24
  transactionDeleted: EventEmitter<Transaction>;
25
+ constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, toastService: ToastService, transactionReceiptService: TransactionReceiptService);
16
26
  /**
17
27
  * Listen events from Event Dispatcher services
18
28
  */
@@ -62,11 +72,6 @@ export declare class TransactionService extends RestService<TransactionBase, Tra
62
72
  * @param model
63
73
  */
64
74
  delete(model: Transaction): Observable<void>;
65
- /**
66
- * upload transaction receipt image
67
- * @param transaction Еhe transaction for which the receipt will be imported
68
- */
69
- uploadReceipt(transaction: Transaction): void;
70
75
  /**
71
76
  * calculate gross income amount based on transaction amount and taxes (fees)
72
77
  * @param transaction Transaction instance for calculation
@@ -85,6 +90,8 @@ export declare class TransactionService extends RestService<TransactionBase, Tra
85
90
  * Listen to EventDispatcherService event related to Property Share changing
86
91
  */
87
92
  private listenPropertyShareUpdate;
93
+ private listenReceiptAdded;
94
+ private listenReceiptDeleted;
88
95
  static ɵfac: i0.ɵɵFactoryDeclaration<TransactionService, never>;
89
96
  static ɵprov: i0.ɵɵInjectableDeclaration<TransactionService>;
90
97
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.24.0",
3
+ "version": "0.24.3",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",
package/public-api.d.ts CHANGED
@@ -40,11 +40,13 @@ export * from './lib/collections/user-event-setting.collection';
40
40
  export * from './lib/collections/vehicle.collection';
41
41
  export * from './lib/collections/vehicle-logbook.collection';
42
42
  export * from './lib/collections/exportable.collection';
43
+ export * from './lib/collections/client-invite.collection';
43
44
  /**
44
45
  * DB models
45
46
  */
46
47
  export * from './lib/db/Models/abstract-model';
47
48
  export * from './lib/db/Models/transaction/transaction-base';
49
+ export * from './lib/models/chart-accounts/chart-accounts-category.e-collection';
48
50
  /**
49
51
  * DB enums
50
52
  */