taxtank-core 0.30.37 → 0.30.38
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/esm2020/lib/collections/collection.mjs +3 -8
- package/esm2020/lib/db/Json/holding/holding-type-exchange.json +79 -0
- package/esm2020/lib/db/Models/holding/index.mjs +2 -1
- package/esm2020/lib/db-static/chart-accounts/chart-accounts-values.mjs +2 -2
- package/esm2020/lib/models/holding/index.mjs +2 -1
- package/esm2020/lib/services/asset/assets.service.mjs +2 -2
- package/esm2020/lib/services/data.service.mjs +36 -0
- package/esm2020/lib/services/http/holding/index.mjs +2 -1
- package/esm2020/lib/services/http/rest/rest.service.mjs +7 -25
- package/esm2020/lib/services/intercom/intercom.service.mjs +1 -1
- package/esm2020/lib/services/json/holding/holding-type-exchange.service.mjs +23 -0
- package/fesm2015/taxtank-core.mjs +138 -30
- package/fesm2015/taxtank-core.mjs.map +1 -1
- package/fesm2020/taxtank-core.mjs +138 -30
- package/fesm2020/taxtank-core.mjs.map +1 -1
- package/lib/collections/collection.d.ts +2 -1
- package/lib/db/Models/holding/index.d.ts +1 -0
- package/lib/models/holding/index.d.ts +1 -0
- package/lib/services/asset/assets.service.d.ts +2 -2
- package/lib/services/data.service.d.ts +32 -0
- package/lib/services/http/holding/index.d.ts +1 -0
- package/lib/services/http/rest/rest.service.d.ts +2 -24
- package/lib/services/intercom/intercom.service.d.ts +1 -1
- package/lib/services/json/holding/holding-type-exchange.service.d.ts +12 -0
- package/package.json +1 -1
- /package/esm2020/lib/db/{static → Json}/chart-accounts/chart-accounts-value.json +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CollectionDictionary } from './collection-dictionary';
|
|
2
2
|
import { AbstractModel } from '../db/Models';
|
|
3
|
+
import { Dictionary } from '../models';
|
|
3
4
|
/**
|
|
4
5
|
* Base collection class. Contains common properties and methods for all collections
|
|
5
6
|
*/
|
|
@@ -31,7 +32,7 @@ export declare class Collection<Model extends AbstractModel> implements Iterable
|
|
|
31
32
|
*/
|
|
32
33
|
sumBy(path: string, abs?: boolean): number;
|
|
33
34
|
groupBy(path?: string): CollectionDictionary<this>;
|
|
34
|
-
indexBy(path: string):
|
|
35
|
+
indexBy(path: string): Dictionary<Model>;
|
|
35
36
|
filter(callback: (item: Model) => boolean): this;
|
|
36
37
|
filterBy(path: string, values: any): this;
|
|
37
38
|
filterByRange(path: string, from: any, to: any): this;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
|
-
import { IAsset } from '../../interfaces
|
|
4
|
-
import { UserSwitcherService } from '../user
|
|
3
|
+
import { IAsset } from '../../interfaces';
|
|
4
|
+
import { UserSwitcherService } from '../user';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
/**
|
|
7
7
|
* Service to work with assets (documents, receipts, e.t.c.)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Collection } from '../collections';
|
|
2
|
+
import { AbstractModel } from '../db/Models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare abstract class DataService<BaseModel, Model extends AbstractModel, CollectionModel extends Collection<Model>> {
|
|
5
|
+
data: BaseModel[];
|
|
6
|
+
/**
|
|
7
|
+
* Model class for instances creating
|
|
8
|
+
*/
|
|
9
|
+
abstract modelClass: any;
|
|
10
|
+
/**
|
|
11
|
+
* Collection Model class for instances creating
|
|
12
|
+
*/
|
|
13
|
+
abstract collectionClass: any;
|
|
14
|
+
/**
|
|
15
|
+
* Cached array of service class instances
|
|
16
|
+
*/
|
|
17
|
+
protected cache: CollectionModel;
|
|
18
|
+
/**
|
|
19
|
+
* @TODO use excludeExtraneousValues when all models refactored (exposed all needed properties)
|
|
20
|
+
* Create new instance of class
|
|
21
|
+
* @param model Single object or array from which will be created model instance(s)
|
|
22
|
+
*/
|
|
23
|
+
protected createModelInstance(model: BaseModel): Model;
|
|
24
|
+
protected createCollectionInstance(collectionClass: new (items: Model[]) => CollectionModel, items: Model[]): CollectionModel;
|
|
25
|
+
/**
|
|
26
|
+
* never return cache directly to prevent update
|
|
27
|
+
*/
|
|
28
|
+
getCache(): CollectionModel;
|
|
29
|
+
setCache(data: BaseModel[]): void;
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DataService<any, any, any>, never>;
|
|
31
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DataService<any, any, any>>;
|
|
32
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './holding.service';
|
|
2
2
|
export * from './holding-type.service';
|
|
3
3
|
export * from './holding-sale.service';
|
|
4
|
+
export * from '../../json/holding/holding-type-exchange.service';
|
|
4
5
|
export * from './holding-messages.enum';
|
|
5
6
|
export * from './holding-sale-messages.enum';
|
|
6
7
|
export * from './holding-type-messages.enum';
|
|
@@ -6,6 +6,7 @@ import { Collection } from '../../../collections';
|
|
|
6
6
|
import { AbstractModel, ObservableModel } from '../../../db/Models';
|
|
7
7
|
import { RestMethod } from './rest-method.type';
|
|
8
8
|
import { HttpMethod } from './http-method.type';
|
|
9
|
+
import { DataService } from '../../data.service';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
/**
|
|
11
12
|
* Abstract base service that implements common services functionality
|
|
@@ -14,7 +15,7 @@ import * as i0 from "@angular/core";
|
|
|
14
15
|
* BaseModel - base entity model that extends by Model
|
|
15
16
|
* CollectionModel - entity collection class
|
|
16
17
|
*/
|
|
17
|
-
export declare abstract class RestService<BaseModel, Model extends AbstractModel, CollectionModel extends Collection<Model>> implements IEventListener {
|
|
18
|
+
export declare abstract class RestService<BaseModel, Model extends AbstractModel, CollectionModel extends Collection<Model>> extends DataService<BaseModel, Model, CollectionModel> implements IEventListener {
|
|
18
19
|
protected http: HttpClient;
|
|
19
20
|
protected eventDispatcherService: EventDispatcherService;
|
|
20
21
|
protected environment: any;
|
|
@@ -22,18 +23,6 @@ export declare abstract class RestService<BaseModel, Model extends AbstractModel
|
|
|
22
23
|
* Url part for service entity API
|
|
23
24
|
*/
|
|
24
25
|
protected abstract endpointUri: string;
|
|
25
|
-
/**
|
|
26
|
-
* Model class for instances creating
|
|
27
|
-
*/
|
|
28
|
-
abstract modelClass: any;
|
|
29
|
-
/**
|
|
30
|
-
* Collection Model class for instances creating
|
|
31
|
-
*/
|
|
32
|
-
abstract collectionClass: any;
|
|
33
|
-
/**
|
|
34
|
-
* Cached array of service class instances
|
|
35
|
-
*/
|
|
36
|
-
protected cache: CollectionModel;
|
|
37
26
|
/**
|
|
38
27
|
* Subject for service cache
|
|
39
28
|
*/
|
|
@@ -50,10 +39,6 @@ export declare abstract class RestService<BaseModel, Model extends AbstractModel
|
|
|
50
39
|
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
|
|
51
40
|
protected get apiUrl(): string;
|
|
52
41
|
get(): Observable<CollectionModel>;
|
|
53
|
-
/**
|
|
54
|
-
* never return cache directly to prevent update
|
|
55
|
-
*/
|
|
56
|
-
getCache(): Model;
|
|
57
42
|
getSingle(): Observable<Model>;
|
|
58
43
|
getArray(): Observable<Model[]>;
|
|
59
44
|
/**
|
|
@@ -100,13 +85,6 @@ export declare abstract class RestService<BaseModel, Model extends AbstractModel
|
|
|
100
85
|
* Generate and dispatch rest event
|
|
101
86
|
*/
|
|
102
87
|
protected dispatchEvent(method: HttpMethod, items: Model[]): void;
|
|
103
|
-
/**
|
|
104
|
-
* @TODO use excludeExtraneousValues when all models refactored (exposed all needed properties)
|
|
105
|
-
* Create new instance of class
|
|
106
|
-
* @param model Single object or array from which will be created model instance(s)
|
|
107
|
-
*/
|
|
108
|
-
protected createModelInstance(model: BaseModel): Model;
|
|
109
|
-
protected createCollectionInstance(collectionClass: new (items: Model[]) => CollectionModel, items: Model[]): CollectionModel;
|
|
110
88
|
/**
|
|
111
89
|
* Check if method is not disabled. Throw exception otherwise.
|
|
112
90
|
* Some entities does not have endpoints for all methods.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HoldingTypeExchange as HoldingTypeExchangeBase } from '../../../db/Models';
|
|
2
|
+
import { Collection } from '../../../collections';
|
|
3
|
+
import { HoldingTypeExchange } from '../../../models';
|
|
4
|
+
import { DataService } from '../../data.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class HoldingTypeExchangeService extends DataService<HoldingTypeExchangeBase, HoldingTypeExchange, Collection<HoldingTypeExchange>> {
|
|
7
|
+
modelClass: typeof HoldingTypeExchange;
|
|
8
|
+
collectionClass: typeof Collection;
|
|
9
|
+
constructor();
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HoldingTypeExchangeService, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<HoldingTypeExchangeService>;
|
|
12
|
+
}
|
package/package.json
CHANGED
|
File without changes
|