taxtank-core 0.32.115 → 0.32.117
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/esm2022/lib/collections/collection.mjs +8 -1
- package/esm2022/lib/collections/vehicle/vehicle-logbook.collection.mjs +13 -1
- package/esm2022/lib/forms/vehicle/vehicle-claim-details.form.mjs +1 -1
- package/esm2022/lib/forms/vehicle/vehicle-claim.form.mjs +1 -3
- package/esm2022/lib/forms/vehicle/vehicle-logbook.form.mjs +3 -4
- package/esm2022/lib/services/http/rest/rest.service.mjs +7 -2
- package/esm2022/lib/services/http/vehicle/vehicle-logbook/vehicle-logbook.service.mjs +3 -2
- package/fesm2022/taxtank-core.mjs +27 -5
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/lib/collections/collection.d.ts +4 -0
- package/lib/collections/vehicle/vehicle-logbook.collection.d.ts +6 -0
- package/lib/forms/vehicle/vehicle-claim.form.d.ts +0 -2
- package/lib/services/http/rest/rest.service.d.ts +5 -0
- package/lib/services/http/vehicle/vehicle-logbook/vehicle-logbook.service.d.ts +2 -1
- package/package.json +1 -1
@@ -43,6 +43,10 @@ export declare class Collection<Model extends AbstractModel> implements Iterable
|
|
43
43
|
findBy(path: string, value: any): Model | null;
|
44
44
|
findIndexBy(path: string, value: any): number;
|
45
45
|
push(...items: Model[]): this;
|
46
|
+
/**
|
47
|
+
* @TODO performance check this.create performance and why we do it instead of changing collection
|
48
|
+
*/
|
49
|
+
unshift(...items: Model[]): this;
|
46
50
|
remove(...items: Model[]): this;
|
47
51
|
/**
|
48
52
|
* @TODO it's filter, not remove
|
@@ -1,6 +1,9 @@
|
|
1
1
|
import { Collection } from '../collection';
|
2
2
|
import { VehicleClaim, VehicleLogbook } from '../../models';
|
3
3
|
import { BestVehicleLogbookCollection } from './best-vehicle-logbook.collection';
|
4
|
+
/**
|
5
|
+
* this collection sorted by date desc, that's why first/last methods works different
|
6
|
+
*/
|
4
7
|
export declare class VehicleLogbookCollection extends Collection<VehicleLogbook> {
|
5
8
|
/**
|
6
9
|
* Calculate total kilometers traveled
|
@@ -12,4 +15,7 @@ export declare class VehicleLogbookCollection extends Collection<VehicleLogbook>
|
|
12
15
|
* get collection of logbooks with the biggest work usage for {@link BestVehicleLogbookCollection.periodDuration}
|
13
16
|
*/
|
14
17
|
getBest(): BestVehicleLogbookCollection | null;
|
18
|
+
get first(): VehicleLogbook;
|
19
|
+
get last(): VehicleLogbook;
|
20
|
+
get preLast(): VehicleLogbook;
|
15
21
|
}
|
@@ -5,8 +5,6 @@ import { VehicleClaimDetails } from '../../models';
|
|
5
5
|
* Add/Edit Vehicle Claim form
|
6
6
|
*/
|
7
7
|
export declare class VehicleClaimForm extends AbstractForm<VehicleClaim> {
|
8
|
-
private vehicleClaim;
|
9
|
-
private details;
|
10
8
|
/**
|
11
9
|
* @param vehicleClaim required even for the new claim, because claim needs business for sole tank
|
12
10
|
* @param details required for form controls disabled state management
|
@@ -36,6 +36,11 @@ export declare abstract class RestService<BaseModel, Model extends AbstractModel
|
|
36
36
|
protected toastService: ToastService;
|
37
37
|
protected http: HttpClient;
|
38
38
|
protected eventDispatcherService: EventDispatcherService;
|
39
|
+
/**
|
40
|
+
* adds new entities to the beginning when true
|
41
|
+
* @TODO make true by default when all services refactored
|
42
|
+
*/
|
43
|
+
protected orderByDesc: boolean;
|
39
44
|
roles: UserRolesEnum[];
|
40
45
|
mercureTopic: string;
|
41
46
|
constructor(environment: any);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { VehicleLogbook as VehicleLogbookBase } from '../../../../db/Models/vehicle/vehicle-logbook';
|
2
2
|
import { VehicleLogbook } from '../../../../models';
|
3
|
-
import { RestService } from '../../rest
|
3
|
+
import { RestService } from '../../rest';
|
4
4
|
import { VehicleLogbookCollection } from '../../../../collections';
|
5
5
|
import * as i0 from "@angular/core";
|
6
6
|
/**
|
@@ -8,6 +8,7 @@ import * as i0 from "@angular/core";
|
|
8
8
|
*/
|
9
9
|
export declare class VehicleLogbookService extends RestService<VehicleLogbookBase, VehicleLogbook, VehicleLogbookCollection> {
|
10
10
|
protected endpointUri: string;
|
11
|
+
protected orderByDesc: boolean;
|
11
12
|
collectionClass: typeof VehicleLogbookCollection;
|
12
13
|
modelClass: typeof VehicleLogbook;
|
13
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<VehicleLogbookService, never>;
|