taxtank-core 0.32.1 → 0.32.4

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.
@@ -74,6 +74,10 @@ export declare class BankAccountCollection extends Collection<BankAccount> {
74
74
  get propertiesMonthlyRepaymentAmount(): number;
75
75
  getPropertyMonthlyRepaymentAmount(propertyId: number): number;
76
76
  getLVR(property: Property): number;
77
+ /**
78
+ * @TODO Alex/Vik: maybe we should get it from jwtToken or think about some localStorageService?
79
+ * get own bankAccounts active for current financial year
80
+ */
77
81
  getOwn(): this;
78
82
  getActiveLoanAccountsByProperties(ids: number[]): BankAccountCollection;
79
83
  }
@@ -1,4 +1,4 @@
1
- import { VehicleClaim } from '../../models';
1
+ import { VehicleLogbook } from '../../models';
2
2
  import { VehicleLogbookCollection } from './vehicle-logbook.collection';
3
3
  import { DateRange } from 'moment-range';
4
4
  /**
@@ -6,7 +6,6 @@ import { DateRange } from 'moment-range';
6
6
  * Docs: https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/211517441/Logbook+Vehicle
7
7
  */
8
8
  export declare class BestVehicleLogbookCollection extends VehicleLogbookCollection {
9
- private isSole;
10
9
  /**
11
10
  * Logbook claimable period duration in milliseconds.
12
11
  * https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/211517441/Logbook+Vehicle
@@ -24,8 +23,14 @@ export declare class BestVehicleLogbookCollection extends VehicleLogbookCollecti
24
23
  /**
25
24
  * Best period may be calculated only when user has logbooks minimum for VehicleLogbook.bestPeriodWeeks
26
25
  */
27
- isBestPeriodExist(logbooks?: VehicleLogbookCollection): boolean;
28
- getWorkUsageByClaim(claim: VehicleClaim): number;
26
+ static isBestPeriodExist(logbooks: VehicleLogbookCollection): boolean;
27
+ static getPeriods(logbooks: VehicleLogbookCollection): DateRange[];
28
+ /**
29
+ * Get claimable date range for passed logbook
30
+ * @param logbook logbook instance for range calculation
31
+ * @param isBackward Flag false - range for logbook + duration; flag true - range for logbook - duration. Used for extra case, when we should add an extra date range for the last logbook
32
+ */
33
+ static getPeriodByLogbook(logbook: VehicleLogbook, isBackward?: boolean): DateRange;
29
34
  /**
30
35
  * Set Date Range with the biggest work usage percent
31
36
  * Range duration is defined as BestVehicleLogbookCollection.periodDuration by the ATO
@@ -39,12 +44,5 @@ export declare class BestVehicleLogbookCollection extends VehicleLogbookCollecti
39
44
  * Find and return range with the biggest workUsage percent.
40
45
  */
41
46
  private calculateBestPeriod;
42
- private getPeriods;
43
- /**
44
- * Get claimable date range for passed logbook
45
- * @param logbook logbook instance for range calculation
46
- * @param isBackward Flag false - range for logbook + duration; flag true - range for logbook - duration. Used for extra case, when we should add an extra date range for the last logbook
47
- */
48
- private getPeriodByLogbook;
49
- static fromLogbooks(logbooks: VehicleLogbookCollection, isSole?: boolean): BestVehicleLogbookCollection | null;
47
+ static fromLogbooks(logbooks: VehicleLogbookCollection): BestVehicleLogbookCollection | null;
50
48
  }
@@ -2,27 +2,14 @@ import { Collection } from '../collection';
2
2
  import { VehicleClaim, VehicleLogbook } from '../../models';
3
3
  import { BestVehicleLogbookCollection } from './best-vehicle-logbook.collection';
4
4
  export declare class VehicleLogbookCollection extends Collection<VehicleLogbook> {
5
- /**
6
- * Get collection of non-personal logbooks (work-related, sole-related).
7
- * @TODO Vik: Best period: move this and related logic to backend
8
- */
9
- getClaimableLogbooks(isSole?: boolean): this;
10
5
  /**
11
6
  * Calculate total kilometers traveled
12
7
  */
13
8
  get kilometers(): number;
14
- /**
15
- * Calculate work usage (percent of business-related kilometers from total kilometers)
16
- * @TODO Alex: TT-2089 replace with getter
17
- */
18
- get workUsage(): number;
19
- getWorkUsageByTank(isSole: boolean): number;
20
- /**
21
- * Get list of logbooks related to passed vehicle claim
22
- */
23
- getByVehicleClaim(vehicleClaim: VehicleClaim): this;
9
+ getWorkUsage(vehicleClaim?: VehicleClaim): number;
10
+ getClaimable(vehicleClaim?: VehicleClaim): this;
24
11
  /**
25
12
  * get collection of logbooks with the biggest work usage for {@link BestVehicleLogbookCollection.periodDuration}
26
13
  */
27
- getBest(isSole?: boolean): BestVehicleLogbookCollection | null;
14
+ getBest(): BestVehicleLogbookCollection | null;
28
15
  }
@@ -2,7 +2,7 @@ export declare class FinancialYear {
2
2
  static weeksInYear: number;
3
3
  static monthsInYear: number;
4
4
  static startMonthIndex: number;
5
- static year: number;
5
+ static get year(): number;
6
6
  year: number;
7
7
  startDate: Date;
8
8
  endDate: Date;
@@ -6,6 +6,4 @@ export declare class VehicleLogbook extends VehicleLogbookBase {
6
6
  business: SoleBusiness;
7
7
  get kilometers(): number;
8
8
  get tankType(): TankTypeEnum;
9
- isWorkTank(): boolean;
10
- isSoleTank(): boolean;
11
9
  }
@@ -17,11 +17,6 @@ export declare class VehicleClaimService extends RestService<VehicleClaimBase, V
17
17
  * when details method changed, all claims current values become 0
18
18
  */
19
19
  private listenVehicleClaimDetailsChanges;
20
- /**
21
- * Update workUsage for all vehicle claims if logbook best period changed
22
- * @TODO Vik: Best period move this and related logic to backend
23
- */
24
- private updateWorkUsage;
25
20
  static ɵfac: i0.ɵɵFactoryDeclaration<VehicleClaimService, never>;
26
21
  static ɵprov: i0.ɵɵInjectableDeclaration<VehicleClaimService>;
27
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.32.1",
3
+ "version": "0.32.4",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/compiler": "^16.2.12",