taxtank-core 0.25.0 → 0.27.1
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.
- package/bundles/taxtank-core.umd.js +413 -264
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/models/endpoint/endpoints.const.js +3 -1
- package/esm2015/lib/models/event/app-event-type.enum.js +45 -42
- package/esm2015/lib/services/http/depreciation/depreciation-receipt/depreciation-receipt.service.js +40 -0
- package/esm2015/lib/services/http/depreciation/depreciation.service.js +61 -22
- package/esm2015/lib/services/http/depreciation/index.js +4 -0
- package/esm2015/lib/services/http/index.js +2 -1
- package/esm2015/lib/services/http/receipt/receipt.service.js +76 -0
- package/esm2015/lib/services/http/transaction/transaction-receipt/transaction-receipt.service.js +20 -50
- package/esm2015/lib/services/http/transaction/transaction.service.js +12 -11
- package/esm2015/lib/services/http/user/index.js +5 -0
- package/esm2015/lib/services/http/user/users-invite/users-invite.service.js +23 -0
- package/esm2015/public-api.js +2 -3
- package/fesm2015/taxtank-core.js +375 -245
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/models/event/app-event-type.enum.d.ts +44 -41
- package/lib/services/http/depreciation/depreciation-receipt/depreciation-receipt.service.d.ts +28 -0
- package/lib/services/http/depreciation/depreciation.service.d.ts +15 -7
- package/lib/services/http/depreciation/index.d.ts +3 -0
- package/lib/services/http/index.d.ts +1 -0
- package/lib/services/http/receipt/receipt.service.d.ts +62 -0
- package/lib/services/http/transaction/transaction-receipt/transaction-receipt.service.d.ts +21 -21
- package/lib/services/http/transaction/transaction.service.d.ts +1 -0
- package/lib/services/http/user/index.d.ts +4 -0
- package/lib/services/http/user/users-invite/users-invite.service.d.ts +13 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -2
|
@@ -13,45 +13,48 @@ export declare enum AppEventTypeEnum {
|
|
|
13
13
|
CURRENT_USER_GET_FAILED = 11,
|
|
14
14
|
DEPRECIATION_DELETED = 12,
|
|
15
15
|
DEPRECIATIONS_CREATED = 13,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
16
|
+
DEPRECIATION_UPDATED_WITH_RECEIPT = 14,
|
|
17
|
+
DEPRECIATION_UPDATED_WITH_DELETED_RECEIPT = 15,
|
|
18
|
+
DEPRECIATION_RECEIPT_CREATED = 16,
|
|
19
|
+
DEPRECIATION_RECEIPT_DELETED = 17,
|
|
20
|
+
INCOME_SOURCES_CREATED = 18,
|
|
21
|
+
INCOME_SOURCES_UPDATED = 19,
|
|
22
|
+
INCOME_SOURCES_FORECASTS_CREATED = 20,
|
|
23
|
+
INCOME_SOURCES_FORECASTS_UPDATED = 21,
|
|
24
|
+
LOAN_UPDATED = 22,
|
|
25
|
+
LOAN_PAYOUT_UPDATED = 23,
|
|
26
|
+
MESSAGE_CREATED = 24,
|
|
27
|
+
MESSAGE_FILE_CREATED = 25,
|
|
28
|
+
MESSAGE_FILE_DELETED = 26,
|
|
29
|
+
NOTIFICATION_ADDED = 27,
|
|
30
|
+
PROPERTY_UPDATED_WITH_DOCUMENT = 28,
|
|
31
|
+
PROPERTY_DOCUMENT_ADDED = 29,
|
|
32
|
+
PROPERTY_MOVEMENT_CREATED = 30,
|
|
33
|
+
PROPERTY_MOVEMENT_UPDATED = 31,
|
|
34
|
+
PROPERTY_MOVEMENT_DELETED = 32,
|
|
35
|
+
PROPERTY_SHARE_UPDATED = 33,
|
|
36
|
+
PROPERTY_SALE_ADDED = 34,
|
|
37
|
+
PROPERTY_SALE_DELETED = 35,
|
|
38
|
+
PROPERTY_SUBSCRIPTION_ADDED = 36,
|
|
39
|
+
PROPERTY_SUBSCRIPTION_DELETED = 37,
|
|
40
|
+
PROPERTY_VALUATION_DOCUMENT_CREATED = 38,
|
|
41
|
+
SERVICE_SUBSCRIPTION_UPDATED = 39,
|
|
42
|
+
TAX_REVIEW_UPDATED = 40,
|
|
43
|
+
TRANSACTION_CREATED = 41,
|
|
44
|
+
TRANSACTION_DELETED = 42,
|
|
45
|
+
TRANSACTION_UPDATED = 43,
|
|
46
|
+
TRANSACTION_UPDATED_WITH_RECEIPT = 44,
|
|
47
|
+
TRANSACTION_UPDATED_WITH_DELETED_RECEIPT = 45,
|
|
48
|
+
TRANSACTION_RECEIPT_CREATED = 46,
|
|
49
|
+
TRANSACTION_RECEIPT_DELETED = 47,
|
|
50
|
+
TRANSACTIONS_CREATED = 48,
|
|
51
|
+
USER_UPDATED = 49,
|
|
52
|
+
VEHICLE_CLAIM_UPDATED = 50,
|
|
53
|
+
VEHICLE_CLAIM_CREATED = 51,
|
|
54
|
+
VEHICLE_CLAIM_DETAILS_UPDATED = 52,
|
|
55
|
+
VEHICLE_CLAIM_DETAILS_CREATED = 53,
|
|
56
|
+
VEHICLE_LOGBOOK_CREATED = 54,
|
|
57
|
+
VEHICLE_LOGBOOK_UPDATED = 55,
|
|
58
|
+
VEHICLE_LOGBOOK_DELETED = 56,
|
|
59
|
+
VEHICLE_LOGBOOK_BEST_PERIOD_UPDATED = 57
|
|
57
60
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DepreciationReceipt as DepreciationReceiptBase } from '../../../../db/Models/depreciation/depreciation-receipt';
|
|
2
|
+
import { DepreciationReceipt } from '../../../../models/depreciation/depreciation-receipt';
|
|
3
|
+
import { AppEventTypeEnum } from '../../../../models/event/app-event-type.enum';
|
|
4
|
+
import { Depreciation } from '../../../../models/depreciation/depreciation';
|
|
5
|
+
import { ReceiptService } from '../../receipt/receipt.service';
|
|
6
|
+
import { AssetEntityTypeEnum } from '../../../../interfaces/asset-entity-type.enum';
|
|
7
|
+
import { HttpClient } from '@angular/common/http';
|
|
8
|
+
import { EventDispatcherService } from '../../../event/event-dispatcher.service';
|
|
9
|
+
import { ToastService } from '../../../toast/toast.service';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
/**
|
|
12
|
+
* @Todo TT-2191 refactor service when receipts API will be updated
|
|
13
|
+
*/
|
|
14
|
+
export declare class DepreciationReceiptService extends ReceiptService<Depreciation, DepreciationReceiptBase, DepreciationReceipt> {
|
|
15
|
+
protected http: HttpClient;
|
|
16
|
+
protected eventDispatcherService: EventDispatcherService;
|
|
17
|
+
protected environment: any;
|
|
18
|
+
protected toastService: ToastService;
|
|
19
|
+
modelClass: typeof DepreciationReceipt;
|
|
20
|
+
entityType: AssetEntityTypeEnum;
|
|
21
|
+
receiptCreatedEvent: AppEventTypeEnum;
|
|
22
|
+
receiptDeletedEvent: AppEventTypeEnum;
|
|
23
|
+
entityUpdatedWithDeletedReceiptEvent: AppEventTypeEnum;
|
|
24
|
+
entityUpdatedWithReceiptEvent: AppEventTypeEnum;
|
|
25
|
+
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, toastService: ToastService);
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DepreciationReceiptService, never>;
|
|
27
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DepreciationReceiptService>;
|
|
28
|
+
}
|
|
@@ -2,11 +2,20 @@ import { Observable } from 'rxjs';
|
|
|
2
2
|
import { Depreciation as DepreciationBase } from '../../../db/Models/depreciation/depreciation';
|
|
3
3
|
import { RestService } from '../rest/rest.service';
|
|
4
4
|
import { Depreciation } from '../../../models/depreciation/depreciation';
|
|
5
|
-
import {
|
|
5
|
+
import { HttpClient } from '@angular/common/http';
|
|
6
|
+
import { EventDispatcherService } from '../../event/event-dispatcher.service';
|
|
7
|
+
import { ToastService } from '../../toast/toast.service';
|
|
8
|
+
import { DepreciationReceiptService } from './depreciation-receipt/depreciation-receipt.service';
|
|
6
9
|
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class DepreciationService extends RestService<DepreciationBase, Depreciation>
|
|
10
|
+
export declare class DepreciationService extends RestService<DepreciationBase, Depreciation> {
|
|
11
|
+
protected http: HttpClient;
|
|
12
|
+
protected eventDispatcherService: EventDispatcherService;
|
|
13
|
+
protected environment: any;
|
|
14
|
+
protected toastService: ToastService;
|
|
15
|
+
private depreciationReceiptService;
|
|
8
16
|
modelClass: typeof Depreciation;
|
|
9
17
|
url: string;
|
|
18
|
+
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, toastService: ToastService, depreciationReceiptService: DepreciationReceiptService);
|
|
10
19
|
/**
|
|
11
20
|
* Add a single depreciation
|
|
12
21
|
* @TODO add auto-generation for events
|
|
@@ -17,16 +26,14 @@ export declare class DepreciationService extends RestService<DepreciationBase, D
|
|
|
17
26
|
* @TODO add auto-generation for events
|
|
18
27
|
*/
|
|
19
28
|
addBatch(depreciations: Depreciation[]): Observable<Depreciation[]>;
|
|
29
|
+
update(depreciation: Depreciation): Observable<Depreciation>;
|
|
20
30
|
/**
|
|
21
31
|
* Listen to Depreciations events
|
|
22
32
|
*/
|
|
23
33
|
listenEvents(): void;
|
|
24
34
|
getOpenBalance(depreciation: Depreciation): Observable<number>;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
* @param depreciation for which will be uploaded receipt
|
|
28
|
-
*/
|
|
29
|
-
uploadReceipt(depreciation: Depreciation): void;
|
|
35
|
+
private listenReceiptAdded;
|
|
36
|
+
private listenReceiptDeleted;
|
|
30
37
|
/**
|
|
31
38
|
* Listen to EventDispatcherService event related to updated bank loan
|
|
32
39
|
*/
|
|
@@ -39,6 +46,7 @@ export declare class DepreciationService extends RestService<DepreciationBase, D
|
|
|
39
46
|
* Listen to EventDispatcherService event related to updated vehicle claim
|
|
40
47
|
*/
|
|
41
48
|
private listenVehicleClaimChanges;
|
|
49
|
+
private replaceInCache;
|
|
42
50
|
static ɵfac: i0.ɵɵFactoryDeclaration<DepreciationService, never>;
|
|
43
51
|
static ɵprov: i0.ɵɵInjectableDeclaration<DepreciationService>;
|
|
44
52
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Type } from '@angular/core';
|
|
2
|
+
import { AssetEntityTypeEnum } from '../../../interfaces/asset-entity-type.enum';
|
|
3
|
+
import { IEventListener } from '../../../interfaces/event-listener.interface';
|
|
4
|
+
import { Transaction } from '../../../models/transaction/transaction';
|
|
5
|
+
import { Depreciation } from '../../../models/depreciation/depreciation';
|
|
6
|
+
import { AppEventTypeEnum } from '../../../models/event/app-event-type.enum';
|
|
7
|
+
import { TransactionReceipt as TransactionReceiptBase } from '../../../db/Models/transaction/transaction-receipt';
|
|
8
|
+
import { DepreciationReceipt as DepreciationReceiptBase } from '../../../db/Models/depreciation/depreciation-receipt';
|
|
9
|
+
import { Observable } from 'rxjs';
|
|
10
|
+
import { HttpClient } from '@angular/common/http';
|
|
11
|
+
import { EventDispatcherService } from '../../event/event-dispatcher.service';
|
|
12
|
+
import { ToastService } from '../../toast/toast.service';
|
|
13
|
+
import * as i0 from "@angular/core";
|
|
14
|
+
/**
|
|
15
|
+
* Abstract service class to work with transactions-like receipt files (transactions, depreciations, e.t.c.)
|
|
16
|
+
* @Todo TT-2191 refactor service when receipts API will be updated
|
|
17
|
+
*/
|
|
18
|
+
export declare abstract class ReceiptService<ParentModel extends Transaction | Depreciation, BaseModel extends TransactionReceiptBase | DepreciationReceiptBase, Model extends BaseModel> implements IEventListener {
|
|
19
|
+
protected http: HttpClient;
|
|
20
|
+
protected eventDispatcherService: EventDispatcherService;
|
|
21
|
+
protected environment: any;
|
|
22
|
+
protected toastService: ToastService;
|
|
23
|
+
/**
|
|
24
|
+
* Needed to fulfill endpoint to API
|
|
25
|
+
*/
|
|
26
|
+
abstract entityType: AssetEntityTypeEnum;
|
|
27
|
+
abstract modelClass: Type<Model>;
|
|
28
|
+
/**
|
|
29
|
+
* Event type that will be dispatched when receipt will be uploaded
|
|
30
|
+
*/
|
|
31
|
+
abstract receiptCreatedEvent: AppEventTypeEnum;
|
|
32
|
+
/**
|
|
33
|
+
* Event type that will be dispatched when receipt will be deleted
|
|
34
|
+
*/
|
|
35
|
+
abstract receiptDeletedEvent: AppEventTypeEnum;
|
|
36
|
+
/**
|
|
37
|
+
* Event type that will be dispatched when parent entity (transaction-like class) will be updated with attached receipt
|
|
38
|
+
*/
|
|
39
|
+
abstract entityUpdatedWithReceiptEvent: AppEventTypeEnum;
|
|
40
|
+
/**
|
|
41
|
+
* Event type that will be dispatched when parent entity (transaction-like class) will be updated with deleted receipt
|
|
42
|
+
*/
|
|
43
|
+
abstract entityUpdatedWithDeletedReceiptEvent: AppEventTypeEnum;
|
|
44
|
+
protected constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, toastService: ToastService);
|
|
45
|
+
listenEvents(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Entity is necessary to take the ID and the receipt file from it.
|
|
48
|
+
*/
|
|
49
|
+
add(receiptEntity: ParentModel): Observable<Model>;
|
|
50
|
+
delete(receiptEntity: ParentModel): Observable<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Parent entity was updated with attached receipt
|
|
53
|
+
*/
|
|
54
|
+
private listenParentWithReceiptUpdated;
|
|
55
|
+
/**
|
|
56
|
+
* Parent entity was updated, but receipt was removed
|
|
57
|
+
*/
|
|
58
|
+
private listenParentWithoutReceiptUpdated;
|
|
59
|
+
private createModelInstance;
|
|
60
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ReceiptService<any, any, any>, never>;
|
|
61
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ReceiptService<any, any, any>>;
|
|
62
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { Transaction } from '../../../../models/transaction/transaction';
|
|
2
|
+
import { AppEventTypeEnum } from '../../../../models/event/app-event-type.enum';
|
|
3
|
+
import { ReceiptService } from '../../receipt/receipt.service';
|
|
4
|
+
import { AssetEntityTypeEnum } from '../../../../interfaces/asset-entity-type.enum';
|
|
5
|
+
import { TransactionReceipt as TransactionReceiptBase } from '../../../../db/Models/transaction/transaction-receipt';
|
|
6
|
+
import { TransactionReceipt } from '../../../../models/transaction/transaction-receipt';
|
|
2
7
|
import { HttpClient } from '@angular/common/http';
|
|
3
8
|
import { EventDispatcherService } from '../../../event/event-dispatcher.service';
|
|
4
|
-
import {
|
|
9
|
+
import { ToastService } from '../../../toast/toast.service';
|
|
5
10
|
import * as i0 from "@angular/core";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
private listenTransactionWithReceiptUpdated;
|
|
22
|
-
/**
|
|
23
|
-
* Case when transaction was updated, but receipt was removed
|
|
24
|
-
*/
|
|
25
|
-
private listenTransactionWithoutReceiptUpdated;
|
|
11
|
+
/**
|
|
12
|
+
* @Todo TT-2191 refactor service when receipts API will be updated
|
|
13
|
+
*/
|
|
14
|
+
export declare class TransactionReceiptService extends ReceiptService<Transaction, TransactionReceiptBase, TransactionReceipt> {
|
|
15
|
+
protected http: HttpClient;
|
|
16
|
+
protected eventDispatcherService: EventDispatcherService;
|
|
17
|
+
protected environment: any;
|
|
18
|
+
protected toastService: ToastService;
|
|
19
|
+
modelClass: typeof TransactionReceipt;
|
|
20
|
+
entityType: AssetEntityTypeEnum;
|
|
21
|
+
receiptCreatedEvent: AppEventTypeEnum;
|
|
22
|
+
receiptDeletedEvent: AppEventTypeEnum;
|
|
23
|
+
entityUpdatedWithReceiptEvent: AppEventTypeEnum;
|
|
24
|
+
entityUpdatedWithDeletedReceiptEvent: AppEventTypeEnum;
|
|
25
|
+
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, toastService: ToastService);
|
|
26
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<TransactionReceiptService, never>;
|
|
27
27
|
static ɵprov: i0.ɵɵInjectableDeclaration<TransactionReceiptService>;
|
|
28
28
|
}
|
|
@@ -93,6 +93,7 @@ export declare class TransactionService extends RestService<TransactionBase, Tra
|
|
|
93
93
|
private listenReceiptAdded;
|
|
94
94
|
private listenReceiptDeleted;
|
|
95
95
|
private listenVehicleClaimChanges;
|
|
96
|
+
private replaceInCache;
|
|
96
97
|
static ɵfac: i0.ɵɵFactoryDeclaration<TransactionService, never>;
|
|
97
98
|
static ɵprov: i0.ɵɵInjectableDeclaration<TransactionService>;
|
|
98
99
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RestService } from '../../rest/rest.service';
|
|
2
|
+
import { RegistrationInvite as RegistrationInviteBase } from '../../../../db/Models/user/registration-invite';
|
|
3
|
+
import { RegistrationInvite } from '../../../../models/registration-invite/registration-invite';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Service to work with invitations for unregistered users
|
|
7
|
+
*/
|
|
8
|
+
export declare class UsersInviteService extends RestService<RegistrationInviteBase, RegistrationInvite> {
|
|
9
|
+
modelClass: typeof RegistrationInvite;
|
|
10
|
+
url: string;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UsersInviteService, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<UsersInviteService>;
|
|
13
|
+
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -314,8 +314,7 @@ export * from './lib/services/http/firm/client-invite/client-invite.service';
|
|
|
314
314
|
export * from './lib/services/http/firm/client-movement/client-movement.service';
|
|
315
315
|
export * from './lib/services/http/firm/portfolio-report/client-portfolio-report.service';
|
|
316
316
|
export * from './lib/services/http/firm/portfolio-report/client-portfolio-report.service';
|
|
317
|
-
export * from './lib/services/http/depreciation
|
|
318
|
-
export * from './lib/services/http/depreciation/depreciation.service';
|
|
317
|
+
export * from './lib/services/http/depreciation';
|
|
319
318
|
export * from './lib/services/http/document/document-folder/document-folder.service';
|
|
320
319
|
export * from './lib/services/http/firm/employee/employee.service';
|
|
321
320
|
export * from './lib/services/http/firm/employee-invite/employee-invite.service';
|