taxtank-core 0.33.7 → 0.33.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. package/esm2022/src/lib/collections/depreciation.collection.mjs +10 -4
  2. package/esm2022/src/lib/collections/exportable.collection.mjs +2 -6
  3. package/esm2022/src/lib/collections/holding/holding.collection.mjs +8 -1
  4. package/esm2022/src/lib/collections/transaction/index.mjs +2 -1
  5. package/esm2022/src/lib/collections/transaction/transaction-base.collection.mjs +4 -0
  6. package/esm2022/src/lib/collections/transaction/transaction.collection.mjs +3 -3
  7. package/esm2022/src/lib/db/Models/bank/bank-account.mjs +1 -1
  8. package/esm2022/src/lib/forms/transaction/transaction-base-filter.form.mjs +7 -2
  9. package/esm2022/src/lib/models/report/report.interface.mjs +1 -1
  10. package/esm2022/src/lib/models/report/reports.const.mjs +107 -72
  11. package/esm2022/src/lib/models/user/user.mjs +18 -28
  12. package/esm2022/src/lib/services/http/holding/holding-sale.service.mjs +3 -1
  13. package/esm2022/src/lib/services/http/property/property-sale/property-sale.service.mjs +3 -1
  14. package/esm2022/src/lib/services/http/property/property.service.mjs +3 -2
  15. package/fesm2022/taxtank-core.mjs +152 -108
  16. package/fesm2022/taxtank-core.mjs.map +1 -1
  17. package/package.json +1 -1
  18. package/src/lib/collections/depreciation.collection.d.ts +5 -2
  19. package/src/lib/collections/exportable.collection.d.ts +2 -2
  20. package/src/lib/collections/holding/holding.collection.d.ts +1 -0
  21. package/src/lib/collections/transaction/index.d.ts +1 -0
  22. package/src/lib/collections/transaction/transaction-base.collection.d.ts +4 -0
  23. package/src/lib/collections/transaction/transaction.collection.d.ts +2 -2
  24. package/src/lib/db/Models/bank/bank-account.d.ts +1 -0
  25. package/src/lib/forms/transaction/transaction-base-filter.form.d.ts +3 -2
  26. package/src/lib/models/report/report.interface.d.ts +4 -3
  27. package/src/lib/models/report/reports.const.d.ts +2 -2
  28. package/src/lib/models/user/user.d.ts +2 -14
  29. package/src/lib/services/http/holding/holding-sale.service.d.ts +2 -0
  30. package/src/lib/services/http/property/property-sale/property-sale.service.d.ts +2 -0
  31. package/src/lib/services/http/property/property.service.d.ts +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.33.7",
3
+ "version": "0.33.9",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^17.0.0",
@@ -1,11 +1,12 @@
1
1
  import { TankTypeEnum } from '../db/Enums/tank-type.enum';
2
- import { Collection } from './collection';
3
2
  import { Depreciation } from '../models';
4
3
  import { DepreciationCapitalProject } from '../models';
5
4
  import { TransactionCollection } from './transaction';
6
5
  import { ChartAccountsCategoryEnum } from '../db/Enums';
7
6
  import { VehicleClaim } from '../models';
8
- export declare class DepreciationCollection extends Collection<Depreciation> {
7
+ import { TransactionBaseCollection } from './transaction';
8
+ import { ExportCell } from '../models/export/export-cell';
9
+ export declare class DepreciationCollection extends TransactionBaseCollection<Depreciation> {
9
10
  getSoleDepreciations(): this;
10
11
  getCurrentYearBuy(): this;
11
12
  /**
@@ -44,4 +45,6 @@ export declare class DepreciationCollection extends Collection<Depreciation> {
44
45
  * Get depreciations by vehicle claim. Only vehicle depreciations may be related to vehicle claim
45
46
  */
46
47
  getByVehicleClaim(vehicleClaim: VehicleClaim): this;
48
+ getExportBody(params: object): ExportCell[][];
49
+ getExportHeader(): string[];
47
50
  }
@@ -1,10 +1,10 @@
1
1
  import { Collection } from './collection';
2
2
  import { ExportDataTable } from '../models/export/export-data-table';
3
3
  import { ExportCell } from '../models/export/export-cell';
4
- import { AbstractModel } from '../db/Models/abstract-model';
4
+ import { AbstractModel } from '../db/Models';
5
5
  export declare abstract class ExportableCollection<Model extends AbstractModel> extends Collection<Model> {
6
6
  abstract getExportHeader(): string[];
7
- abstract getExportBody(params: {}): ExportCell[][];
7
+ abstract getExportBody(params: object): ExportCell[][];
8
8
  getExportFooter(): ExportCell[];
9
9
  getBodyAoa(exportData: any): any;
10
10
  export(params?: any): ExportDataTable;
@@ -10,6 +10,7 @@ export declare class HoldingCollection extends ExportableCollection<Holding> {
10
10
  getOthers(): this;
11
11
  getPurchaseValue(): number;
12
12
  get marketValue(): number;
13
+ get sharedMarketValue(): number;
13
14
  getGrowthCoefficient(): number;
14
15
  getUnsold(): this;
15
16
  }
@@ -1,2 +1,3 @@
1
1
  export * from './transaction.collection';
2
2
  export * from './transaction-allocation.collection';
3
+ export * from './transaction-base.collection';
@@ -0,0 +1,4 @@
1
+ import { ExportableCollection } from '../exportable.collection';
2
+ import { TransactionBase } from '../../db/Models';
3
+ export declare abstract class TransactionBaseCollection<Model extends TransactionBase> extends ExportableCollection<Model> {
4
+ }
@@ -2,16 +2,16 @@ import { Dictionary, Transaction, TransactionMetaField, VehicleClaim } from '../
2
2
  import { TransactionAllocationCollection } from './transaction-allocation.collection';
3
3
  import { ChartAccountsCategoryEnum } from '../../db/Enums';
4
4
  import { TankTypeEnum } from '../../db/Enums/tank-type.enum';
5
- import { ExportableCollection } from '../exportable.collection';
6
5
  import { ExportCell } from '../../models/export/export-cell';
7
6
  import { Collection } from '../collection';
8
7
  import { ChartData } from '../../models/chart/chart-data';
9
8
  import { Depreciation } from '../../models';
10
9
  import { SoleInvoiceCollection } from '../sole';
10
+ import { TransactionBaseCollection } from './transaction-base.collection';
11
11
  /**
12
12
  * Collection of transactions
13
13
  */
14
- export declare class TransactionCollection extends ExportableCollection<Transaction> {
14
+ export declare class TransactionCollection extends TransactionBaseCollection<Transaction> {
15
15
  /**
16
16
  * we use depreciations as expense transactions a lot
17
17
  */
@@ -15,6 +15,7 @@ export declare class BankAccount extends ObservableModel {
15
15
  nickname?: string;
16
16
  accountNumber?: string;
17
17
  currentBalance?: number;
18
+ closeBalance?: number;
18
19
  currency?: string;
19
20
  migrateFrom?: Date;
20
21
  migrateTo?: Date;
@@ -2,17 +2,18 @@ import { FormControl, FormGroup } from '@angular/forms';
2
2
  import { ControlsInterface } from '../abstract.form';
3
3
  import { Collection } from '../../collections';
4
4
  import { TankTypeEnum } from '../../db/Enums/tank-type.enum';
5
- import { SoleBusiness } from '../../models';
5
+ import { Property, SoleBusiness } from '../../models';
6
6
  import { IEventListener } from '../../interfaces';
7
7
  import { TransactionBase } from '../../db/Models';
8
8
  interface ITransactionBaseFilterControls extends ControlsInterface {
9
9
  tankType: FormControl<TankTypeEnum>;
10
10
  business: FormControl<SoleBusiness>;
11
+ properties: FormControl<Property[]>;
11
12
  dateFrom: FormControl<Date>;
12
13
  dateTo: FormControl<Date>;
13
14
  }
14
15
  export declare class TransactionBaseFilterForm extends FormGroup<ITransactionBaseFilterControls> implements IEventListener {
15
- constructor(tankType?: TankTypeEnum, business?: SoleBusiness);
16
+ constructor(tankType?: TankTypeEnum, business?: SoleBusiness, properties?: Property[]);
16
17
  listenEvents(): void;
17
18
  filter<ModelClass extends TransactionBase, CollectionClass extends Collection<ModelClass>>(collection: CollectionClass): CollectionClass;
18
19
  }
@@ -1,7 +1,8 @@
1
- import { UserRolesEnum } from 'taxtank-core/common';
2
1
  export interface IReport {
3
2
  title: string;
4
3
  description: string;
5
- route: string;
6
- roles: UserRolesEnum[];
4
+ routerLink: string;
5
+ queryParams?: {
6
+ [key: string]: number;
7
+ };
7
8
  }
@@ -1,3 +1,3 @@
1
1
  import { IReport } from './report.interface';
2
- import { Collection } from '../../collections';
3
- export declare const REPORTS: Collection<IReport>;
2
+ import { UserRolesEnum } from 'taxtank-core/common';
3
+ export declare const REPORTS: Partial<Record<UserRolesEnum, IReport[]>>;
@@ -5,10 +5,10 @@ import { ClientDetails } from '../client';
5
5
  import { EmployeeDetails } from '../employee/employee-details';
6
6
  import { Phone } from '../phone/phone';
7
7
  import { ServiceSubscription } from '../service-subscription';
8
- import { ServiceSubscriptionItem } from '../service-subscription';
9
8
  import { SoleDetails } from '../sole';
10
9
  import { AppFile } from '../file';
11
10
  import { AccountSetupItem } from '../account-setup/account-setup-item';
11
+ import { TankTypeEnum } from '../../db/Enums/tank-type.enum';
12
12
  export declare class User extends BaseUser {
13
13
  subscriptions: ServiceSubscription[];
14
14
  clientDetails: ClientDetails;
@@ -33,6 +33,7 @@ export declare class User extends BaseUser {
33
33
  * search roles including hierarchy
34
34
  */
35
35
  hasRoles(roles: UserRolesEnum | UserRolesEnum[]): boolean;
36
+ getTankTypes(): TankTypeEnum[];
36
37
  isOnboarding(): boolean;
37
38
  isInactive(): boolean;
38
39
  hasSubscription(): boolean;
@@ -48,19 +49,6 @@ export declare class User extends BaseUser {
48
49
  isFirmOwner(): boolean;
49
50
  isTopManager(): boolean;
50
51
  isManager(): boolean;
51
- /**
52
- * check if user has property tank access
53
- */
54
- hasPropertyTank(): boolean;
55
- /**
56
- * check if user has property tank access
57
- */
58
- hasWorkTank(): boolean;
59
- /**
60
- * Get user subscription role by provided role type
61
- * @param roleType by which role should be returned
62
- */
63
- getSubscriptionRole(roleType: UserRolesEnum): ServiceSubscriptionItem;
64
52
  isCurrentFinancialYear(): boolean;
65
53
  /**
66
54
  * financial years available in the app for user
@@ -2,12 +2,14 @@ import { HoldingSale as HoldingSaleBase } from '../../../db/Models';
2
2
  import { HoldingSale } from '../../../models';
3
3
  import { RestMethod, RestService } from '../rest';
4
4
  import { HoldingSaleCollection } from '../../../collections';
5
+ import { UserRolesEnum } from 'taxtank-core/common';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class HoldingSaleService extends RestService<HoldingSaleBase, HoldingSale, HoldingSaleCollection> {
7
8
  modelClass: typeof HoldingSale;
8
9
  collectionClass: typeof HoldingSaleCollection;
9
10
  endpointUri: string;
10
11
  disabledMethods: RestMethod[];
12
+ roles: UserRolesEnum[];
11
13
  static ɵfac: i0.ɵɵFactoryDeclaration<HoldingSaleService, never>;
12
14
  static ɵprov: i0.ɵɵInjectableDeclaration<HoldingSaleService>;
13
15
  }
@@ -2,12 +2,14 @@ import { PropertySale as PropertySaleBase } from '../../../../db/Models';
2
2
  import { PropertySale } from '../../../../models';
3
3
  import { RestMethod, RestService } from '../../rest';
4
4
  import { PropertySaleCollection } from '../../../../collections';
5
+ import { UserRolesEnum } from 'taxtank-core/common';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class PropertySaleService extends RestService<PropertySaleBase, PropertySale, PropertySaleCollection> {
7
8
  modelClass: typeof PropertySale;
8
9
  collectionClass: typeof PropertySaleCollection;
9
10
  endpointUri: string;
10
11
  disabledMethods: RestMethod[];
12
+ roles: UserRolesEnum[];
11
13
  static ɵfac: i0.ɵɵFactoryDeclaration<PropertySaleService, never>;
12
14
  static ɵprov: i0.ɵɵInjectableDeclaration<PropertySaleService>;
13
15
  }
@@ -4,6 +4,7 @@ import { Property } from '../../../models';
4
4
  import { IEventListener } from '../../../interfaces';
5
5
  import { RestMethod, RestService } from '../rest';
6
6
  import { PropertyCollection } from '../../../collections';
7
+ import { UserRolesEnum } from 'taxtank-core/common';
7
8
  import * as i0 from "@angular/core";
8
9
  /**
9
10
  * @Todo Alex remove functionality related to PropertyShare
@@ -16,6 +17,7 @@ export declare class PropertyService extends RestService<PropertyBase, Property,
16
17
  collectionClass: typeof PropertyCollection;
17
18
  endpointUri: string;
18
19
  disabledMethods: RestMethod[];
20
+ roles: UserRolesEnum[];
19
21
  constructor(environment: any);
20
22
  /**
21
23
  * @TODO remove when forecast moved to separated api