taxtank-core 0.33.60 → 0.33.61

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. package/esm2022/src/lib/collections/asset-sale.collection.mjs +4 -1
  2. package/esm2022/src/lib/collections/collection-dictionary.mjs +10 -1
  3. package/esm2022/src/lib/collections/collection.mjs +1 -1
  4. package/esm2022/src/lib/collections/holding/holding-sale.collection.mjs +3 -3
  5. package/esm2022/src/lib/collections/holding/holding-trade.collection.mjs +78 -0
  6. package/esm2022/src/lib/collections/holding/holding.collection.mjs +19 -54
  7. package/esm2022/src/lib/collections/holding/index.mjs +3 -2
  8. package/esm2022/src/lib/db/Enums/holding/holding-trade-type.enum.mjs +6 -0
  9. package/esm2022/src/lib/db/Enums/holding/holding-type-category.enum.mjs +1 -1
  10. package/esm2022/src/lib/db/Enums/holding/index.mjs +2 -1
  11. package/esm2022/src/lib/db/Models/holding/holding-sale.mjs +1 -1
  12. package/esm2022/src/lib/db/Models/holding/holding-trade-import.mjs +3 -0
  13. package/esm2022/src/lib/db/Models/holding/holding-trade.mjs +3 -0
  14. package/esm2022/src/lib/db/Models/holding/index.mjs +2 -2
  15. package/esm2022/src/lib/forms/abstract.form.mjs +6 -1
  16. package/esm2022/src/lib/forms/holding/holding-reinvest.form.mjs +14 -14
  17. package/esm2022/src/lib/forms/holding/holding-sale.form.mjs +3 -2
  18. package/esm2022/src/lib/forms/holding/holding-trade/holding-trade-filter.form.mjs +25 -0
  19. package/esm2022/src/lib/forms/holding/holding-trade/holding-trade.form.mjs +30 -0
  20. package/esm2022/src/lib/forms/holding/holding-trade/index.mjs +3 -0
  21. package/esm2022/src/lib/forms/holding/holding-trade-import.form.mjs +25 -0
  22. package/esm2022/src/lib/forms/holding/index.mjs +3 -3
  23. package/esm2022/src/lib/models/endpoint/endpoints.const.mjs +9 -9
  24. package/esm2022/src/lib/models/holding/holding-reinvest.mjs +4 -4
  25. package/esm2022/src/lib/models/holding/holding-sale.mjs +10 -1
  26. package/esm2022/src/lib/models/holding/holding-trade-import.mjs +16 -0
  27. package/esm2022/src/lib/models/holding/holding-trade.mjs +77 -0
  28. package/esm2022/src/lib/models/holding/holding-type-exchange.mjs +4 -1
  29. package/esm2022/src/lib/models/holding/holding-type.mjs +4 -1
  30. package/esm2022/src/lib/models/holding/holding.mjs +44 -71
  31. package/esm2022/src/lib/models/holding/index.mjs +4 -3
  32. package/esm2022/src/lib/services/account-setup/account-setup.service.mjs +3 -3
  33. package/esm2022/src/lib/services/http/holding/holding-trade-import/holding-trade-import-messages.enum.mjs +9 -0
  34. package/esm2022/src/lib/services/http/holding/holding-trade-import/holding-trade-import.service.mjs +37 -0
  35. package/esm2022/src/lib/services/http/holding/holding-trade-messages.enum.mjs +10 -0
  36. package/esm2022/src/lib/services/http/holding/holding-trade.service.mjs +44 -0
  37. package/esm2022/src/lib/services/http/holding/index.mjs +5 -6
  38. package/fesm2022/taxtank-core.mjs +330 -185
  39. package/fesm2022/taxtank-core.mjs.map +1 -1
  40. package/package.json +1 -1
  41. package/src/lib/collections/asset-sale.collection.d.ts +3 -0
  42. package/src/lib/collections/collection-dictionary.d.ts +1 -0
  43. package/src/lib/collections/holding/holding-sale.collection.d.ts +4 -4
  44. package/src/lib/collections/holding/holding-trade.collection.d.ts +21 -0
  45. package/src/lib/collections/holding/holding.collection.d.ts +7 -10
  46. package/src/lib/collections/holding/index.d.ts +2 -1
  47. package/src/lib/db/Enums/holding/holding-trade-type.enum.d.ts +4 -0
  48. package/src/lib/db/Enums/holding/index.d.ts +1 -0
  49. package/src/lib/db/Models/holding/holding-sale.d.ts +2 -2
  50. package/src/lib/db/Models/holding/holding-trade-import.d.ts +8 -0
  51. package/src/lib/db/Models/holding/{holding.d.ts → holding-trade.d.ts} +1 -1
  52. package/src/lib/db/Models/holding/index.d.ts +1 -1
  53. package/src/lib/forms/abstract.form.d.ts +2 -0
  54. package/src/lib/forms/holding/holding-reinvest.form.d.ts +5 -5
  55. package/src/lib/forms/holding/holding-sale.form.d.ts +2 -2
  56. package/src/lib/forms/holding/holding-trade/holding-trade-filter.form.d.ts +9 -0
  57. package/src/lib/forms/holding/holding-trade/holding-trade.form.d.ts +9 -0
  58. package/src/lib/forms/holding/holding-trade/index.d.ts +2 -0
  59. package/src/lib/forms/holding/holding-trade-import.form.d.ts +8 -0
  60. package/src/lib/forms/holding/index.d.ts +2 -2
  61. package/src/lib/models/holding/holding-reinvest.d.ts +2 -2
  62. package/src/lib/models/holding/holding-sale.d.ts +16 -4
  63. package/src/lib/models/holding/holding-trade-import.d.ts +8 -0
  64. package/src/lib/models/holding/holding-trade.d.ts +41 -0
  65. package/src/lib/models/holding/holding-type-exchange.d.ts +3 -0
  66. package/src/lib/models/holding/holding-type.d.ts +3 -0
  67. package/src/lib/models/holding/holding.d.ts +18 -34
  68. package/src/lib/models/holding/index.d.ts +3 -2
  69. package/src/lib/services/account-setup/account-setup.service.d.ts +2 -2
  70. package/src/lib/services/http/holding/{holding-import/holding-import-messages.enum.d.ts → holding-trade-import/holding-trade-import-messages.enum.d.ts} +1 -1
  71. package/src/lib/services/http/holding/holding-trade-import/holding-trade-import.service.d.ts +17 -0
  72. package/src/lib/services/http/holding/{holding-messages.enum.d.ts → holding-trade-messages.enum.d.ts} +1 -1
  73. package/src/lib/services/http/holding/holding-trade.service.d.ts +20 -0
  74. package/src/lib/services/http/holding/index.d.ts +4 -5
  75. package/esm2022/src/lib/db/Models/holding/holding-import.mjs +0 -3
  76. package/esm2022/src/lib/db/Models/holding/holding.mjs +0 -3
  77. package/esm2022/src/lib/forms/holding/holding-import.form.mjs +0 -25
  78. package/esm2022/src/lib/forms/holding/holding.form.mjs +0 -28
  79. package/esm2022/src/lib/models/holding/holding-import.mjs +0 -16
  80. package/esm2022/src/lib/services/http/holding/holding-import/holding-import-messages.enum.mjs +0 -9
  81. package/esm2022/src/lib/services/http/holding/holding-import/holding-import.service.mjs +0 -37
  82. package/esm2022/src/lib/services/http/holding/holding-messages.enum.mjs +0 -10
  83. package/esm2022/src/lib/services/http/holding/holding-sale-messages.enum.mjs +0 -8
  84. package/esm2022/src/lib/services/http/holding/holding.service.mjs +0 -44
  85. package/src/lib/db/Models/holding/holding-import.d.ts +0 -8
  86. package/src/lib/forms/holding/holding-import.form.d.ts +0 -8
  87. package/src/lib/forms/holding/holding.form.d.ts +0 -8
  88. package/src/lib/models/holding/holding-import.d.ts +0 -8
  89. package/src/lib/services/http/holding/holding-import/holding-import.service.d.ts +0 -17
  90. package/src/lib/services/http/holding/holding-sale-messages.enum.d.ts +0 -6
  91. package/src/lib/services/http/holding/holding.service.d.ts +0 -20
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.33.60",
3
+ "version": "0.33.61",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^17.0.0",
@@ -3,6 +3,9 @@ import { AssetSale } from '../models';
3
3
  export declare class AssetSaleCollection extends Collection<AssetSale> {
4
4
  get grossCapitalProfit(): number;
5
5
  get fullExemptionSales(): this;
6
+ /**
7
+ * true only for isTaxFree=true
8
+ */
6
9
  get fullExemptionGrossCapitalProfit(): number;
7
10
  get halfExemptionGrossCapitalProfit(): number;
8
11
  get noExemptionGrossCapitalProfit(): number;
@@ -53,4 +53,5 @@ export declare class CollectionDictionary<Collection extends BaseCollection<obje
53
53
  * Group collection items by passed path into items object
54
54
  */
55
55
  private groupItems;
56
+ filter(callback: (collection: Collection) => boolean): CollectionDictionary<Collection>;
56
57
  }
@@ -1,10 +1,10 @@
1
- import { Dictionary, Holding, HoldingSale } from '../../models';
1
+ import { Dictionary, HoldingSale, HoldingTrade } from '../../models';
2
2
  import { ExportableCollection } from '../exportable.collection';
3
3
  import { ExportCell } from '../../models/export/export-cell';
4
- import { HoldingCollection } from './holding.collection';
4
+ import { HoldingTradeCollection } from './holding-trade.collection';
5
5
  export declare class HoldingSaleCollection extends ExportableCollection<HoldingSale> {
6
- filterByTaxFree(holdings: HoldingCollection, isTaxFree?: boolean): this;
6
+ filterByTaxFree(holdings: HoldingTradeCollection, isTaxFree?: boolean): this;
7
7
  getExportHeader(): string[];
8
8
  getExportFooter(): ExportCell[];
9
- getExportBody(holdingsById: Dictionary<Holding>): ExportCell[][];
9
+ getExportBody(holdingsById: Dictionary<HoldingTrade>): ExportCell[][];
10
10
  }
@@ -0,0 +1,21 @@
1
+ import { ExportableCollection } from '../exportable.collection';
2
+ import { HoldingTrade } from '../../models';
3
+ import { ExportCell } from '../../models/export/export-cell';
4
+ export declare class HoldingTradeCollection extends ExportableCollection<HoldingTrade> {
5
+ getExportHeader(): string[];
6
+ getExportFooter(): ExportCell[];
7
+ getExportBody(): ExportCell[][];
8
+ getPurchases(): this;
9
+ getSales(): this;
10
+ getShares(): this;
11
+ getCryptos(): this;
12
+ getOthers(): this;
13
+ /**
14
+ * @TODO vik remove, use holding.marketValue instead
15
+ */
16
+ get marketValue(): number;
17
+ /**
18
+ * @TODO vik remove, use holding.sharedMarketValue instead
19
+ */
20
+ get sharedMarketValue(): number;
21
+ }
@@ -1,17 +1,14 @@
1
- import { ExportableCollection } from '../exportable.collection';
1
+ import { Collection } from '../collection';
2
2
  import { Holding } from '../../models';
3
- import { ExportCell } from '../../models/export/export-cell';
4
- export declare class HoldingCollection extends ExportableCollection<Holding> {
5
- getExportHeader(): string[];
6
- getExportFooter(): ExportCell[];
7
- getExportBody(): ExportCell[][];
3
+ import { HoldingTradeCollection } from './holding-trade.collection';
4
+ import { HoldingTypeCollection } from './holding-type.collection';
5
+ export declare class HoldingCollection extends Collection<Holding> {
6
+ static fromTrades(trades: HoldingTradeCollection, holdingTypes: HoldingTypeCollection): HoldingCollection;
8
7
  getShares(): this;
9
8
  getCryptos(): this;
10
9
  getOthers(): this;
11
- getPurchaseValue(): number;
12
10
  get marketValue(): number;
13
- get sharedMarketValue(): number;
11
+ get purchaseValue(): number;
14
12
  getGrowthCoefficient(): number;
15
- getUnsold(): this;
16
- getUnrealisedProfit(): number;
13
+ getPnl(): number;
17
14
  }
@@ -1,3 +1,4 @@
1
- export * from './holding.collection';
1
+ export * from './holding-trade.collection';
2
2
  export * from './holding-sale.collection';
3
3
  export * from './holding-type.collection';
4
+ export * from './holding.collection';
@@ -0,0 +1,4 @@
1
+ export declare enum HoldingTradeTypeEnum {
2
+ BUY = 1,
3
+ SELL = 2
4
+ }
@@ -1,2 +1,3 @@
1
1
  export * from './holding-type-category.enum';
2
2
  export * from './holding-type-exchange-list.enum';
3
+ export * from './holding-trade-type.enum';
@@ -1,4 +1,4 @@
1
- import { Holding } from './holding';
1
+ import { HoldingTrade } from './holding-trade';
2
2
  import { File } from '../file';
3
3
  export declare class HoldingSale {
4
4
  date?: Date;
@@ -10,6 +10,6 @@ export declare class HoldingSale {
10
10
  grossCapitalGain?: number;
11
11
  netCapitalGain?: number;
12
12
  id?: number;
13
- holding?: Holding;
13
+ holding?: HoldingTrade;
14
14
  file?: File;
15
15
  }
@@ -0,0 +1,8 @@
1
+ import { HoldingTrade } from './holding-trade';
2
+ export declare class HoldingTradeImport {
3
+ originalName?: string;
4
+ id?: number;
5
+ createdAt?: Date;
6
+ updatedAt?: Date;
7
+ holdings?: HoldingTrade[];
8
+ }
@@ -2,7 +2,7 @@ import { User } from '../user/user';
2
2
  import { HoldingType } from './holding-type';
3
3
  import { File } from '../file';
4
4
  import { HoldingSale } from './holding-sale';
5
- export declare class Holding {
5
+ export declare class HoldingTrade {
6
6
  isTaxFree?: boolean;
7
7
  date?: Date;
8
8
  quantity?: number;
@@ -1,4 +1,4 @@
1
- export * from './holding';
1
+ export * from './holding-trade';
2
2
  export * from './holding-type';
3
3
  export * from './holding-sale';
4
4
  export * from './holding-type-exchange';
@@ -1,5 +1,6 @@
1
1
  import { AbstractControl, AbstractControlOptions, AsyncValidatorFn, FormGroup, ValidatorFn } from '@angular/forms';
2
2
  import { EventEmitter, Type } from '@angular/core';
3
+ import { Observable } from 'rxjs';
3
4
  /**
4
5
  * Default Controls Interface with loose typing
5
6
  */
@@ -70,4 +71,5 @@ export declare abstract class AbstractForm<Model, Controls extends ControlsInter
70
71
  onlySelf?: boolean;
71
72
  emitEvent?: boolean;
72
73
  }, controls?: AbstractControl[]): void;
74
+ controlsChanges(controlNames: string[]): Observable<any>;
73
75
  }
@@ -9,21 +9,21 @@ export declare class HoldingReinvestForm extends AbstractForm<HoldingReinvest> i
9
9
  constructor(reinvest: HoldingReinvest);
10
10
  listenEvents(): void;
11
11
  private get transactionForm();
12
- private get holdingForm();
12
+ private get tradeForm();
13
13
  /**
14
14
  * calculated automatically as cashVariance=transactionAmount-frankedAmount-unfrankedAmount
15
15
  */
16
16
  private listenAmountChanges;
17
17
  /**
18
- * Set transaction amount based on holding quantity and price
18
+ * Set transaction amount based on trade quantity and price
19
19
  */
20
- private listenHoldingChanges;
20
+ private listenTradeChanges;
21
21
  /**
22
- * Set holding date the same as transaction date
22
+ * Set trade date the same as transaction date
23
23
  */
24
24
  private listenDateChanges;
25
25
  /**
26
- * @TODO Alex (TT-2847): attach file to both (transaction and holding) when files system refactored
26
+ * @TODO Alex (TT-2847): attach file to both (transaction and trade) when files system refactored
27
27
  */
28
28
  submit(): HoldingReinvest;
29
29
  }
@@ -1,10 +1,10 @@
1
1
  import { IEventListener } from '../../interfaces';
2
- import { Holding, HoldingSale, HoldingType } from '../../models';
2
+ import { HoldingSale, HoldingTrade, HoldingType } from '../../models';
3
3
  import { AbstractForm } from '../abstract.form';
4
4
  export declare class HoldingSaleForm extends AbstractForm<HoldingSale> implements IEventListener {
5
5
  private holding;
6
6
  private isResident;
7
- constructor(sale: HoldingSale, holding: Holding, type: HoldingType, isResident: boolean);
7
+ constructor(sale: HoldingSale, holding: HoldingTrade, type: HoldingType, isResident: boolean);
8
8
  listenEvents(): void;
9
9
  submit(): HoldingSale;
10
10
  private updateGainFields;
@@ -0,0 +1,9 @@
1
+ import { HoldingTrade } from '../../../models';
2
+ import { AbstractForm } from '../../abstract.form';
3
+ import { HoldingTradeCollection } from '../../../collections';
4
+ import { HoldingTypeCategoryEnum } from '../../../db/Enums';
5
+ export declare class HoldingTradeFilterForm extends AbstractForm<HoldingTrade> {
6
+ categories: HoldingTypeCategoryEnum[];
7
+ constructor();
8
+ filter(trades: HoldingTradeCollection): HoldingTradeCollection;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { HoldingTrade } from '../../../models';
2
+ import { AbstractForm } from '../../abstract.form';
3
+ import { IEventListener } from '../../../interfaces';
4
+ export declare class HoldingTradeForm extends AbstractForm<HoldingTrade> implements IEventListener {
5
+ purchaseValue: number;
6
+ constructor(holdingTrade: HoldingTrade);
7
+ listenEvents(): void;
8
+ submit(data?: object, includeDisabledFields?: boolean): HoldingTrade;
9
+ }
@@ -0,0 +1,2 @@
1
+ export * from './holding-trade.form';
2
+ export * from './holding-trade-filter.form';
@@ -0,0 +1,8 @@
1
+ import { AbstractForm } from '../abstract.form';
2
+ import { IEventListener } from '../../interfaces';
3
+ import { HoldingTradeImport } from '../../models';
4
+ export declare class HoldingTradeImportForm extends AbstractForm<HoldingTradeImport> implements IEventListener {
5
+ constructor();
6
+ listenEvents(): void;
7
+ submit(): HoldingTradeImport;
8
+ }
@@ -1,5 +1,5 @@
1
+ export * from './holding-trade';
1
2
  export * from './holding-sale.form';
2
3
  export * from './holding-type.form';
3
- export * from './holding.form';
4
4
  export * from './holding-reinvest.form';
5
- export * from './holding-import.form';
5
+ export * from './holding-trade-import.form';
@@ -1,5 +1,5 @@
1
1
  import { Transaction } from '../transaction';
2
- import { Holding } from './holding';
2
+ import { HoldingTrade } from './holding-trade';
3
3
  import { AbstractModel } from '../../db/Models';
4
4
  import { HoldingType } from './holding-type';
5
5
  /**
@@ -8,6 +8,6 @@ import { HoldingType } from './holding-type';
8
8
  */
9
9
  export declare class HoldingReinvest extends AbstractModel {
10
10
  transaction: Transaction;
11
- holding: Holding;
11
+ trade: HoldingTrade;
12
12
  holdingType: HoldingType;
13
13
  }
@@ -1,23 +1,35 @@
1
- import { Holding } from './holding';
1
+ import { HoldingTrade } from './holding-trade';
2
2
  import { AppFile } from '../file';
3
3
  import { AssetSale } from '../asset-sale';
4
+ /**
5
+ * @TODO vik rename to HoldingTradeParcel when backend ready
6
+ */
4
7
  export declare class HoldingSale extends AssetSale {
5
8
  quantity: number;
6
9
  price: number;
7
10
  fee: number;
8
11
  total: number;
9
- holding?: Holding;
12
+ /**
13
+ * @TODO vik 4521 remove
14
+ */
15
+ holding?: HoldingTrade;
10
16
  file: AppFile;
11
17
  /**
12
18
  * netCapitalGain is different from grossCapitalGain only when 1 year rule applied
13
19
  */
14
20
  isOneYearExemptionApplicable(): boolean;
15
21
  get concession(): string;
16
- getCostBase(holding: Holding): number;
22
+ getCostBase(holding: HoldingTrade): number;
17
23
  /**
18
24
  * Purchase price of sold items
19
25
  */
20
- getPurchasePrice(holding: Holding): number;
26
+ getPurchasePrice(holding: HoldingTrade): number;
27
+ /**
28
+ * total price of sale
29
+ */
21
30
  get netCost(): number;
31
+ /**
32
+ * total price of sale without fee
33
+ */
22
34
  get cost(): number;
23
35
  }
@@ -0,0 +1,8 @@
1
+ import { HoldingTrade, ObservableModel } from '../../db/Models';
2
+ export declare class HoldingTradeImport extends ObservableModel {
3
+ static className: string;
4
+ originalName: string;
5
+ createdAt: Date;
6
+ updatedAt: Date;
7
+ holdings?: HoldingTrade[];
8
+ }
@@ -0,0 +1,41 @@
1
+ import { User } from '../user';
2
+ import { HoldingType } from './holding-type';
3
+ import { AppFile } from '../file';
4
+ import { AbstractModel } from '../../db/Models';
5
+ import { HoldingTradeTypeEnum, HoldingTypeCategoryEnum } from '../../db/Enums';
6
+ export declare class HoldingTrade extends AbstractModel {
7
+ isTaxFree: boolean;
8
+ quantity: number;
9
+ ownershipPercent?: number;
10
+ price: number;
11
+ fee: number;
12
+ type: HoldingTradeTypeEnum;
13
+ date: Date;
14
+ user: User;
15
+ /**
16
+ * @TODO vik 4521 rename to holding
17
+ */
18
+ holdingType: HoldingType;
19
+ file: AppFile;
20
+ /**
21
+ * @TODO Artem/Alex looks bad, come up with a better solution
22
+ * get current category, in holding we are interested in 3 main categories: stock/crypto/other
23
+ */
24
+ category: HoldingTypeCategoryEnum;
25
+ isPurchase(): boolean;
26
+ get typeLabel(): string;
27
+ /**
28
+ * Get total purchasing price
29
+ */
30
+ get total(): number;
31
+ /**
32
+ * @TODO vik remove
33
+ */
34
+ get marketValue(): number;
35
+ /**
36
+ * Get percent difference between current and buy price
37
+ * @TODO vik/alex no need to pass holdingType, should come from backend
38
+ */
39
+ get growthCoefficient(): number;
40
+ heldMoreYear(): boolean;
41
+ }
@@ -1,5 +1,8 @@
1
1
  import { AbstractModel } from '../../db/Models';
2
2
  import { HoldingType } from './holding-type';
3
+ /**
4
+ * @TODO rename 4521 to HoldingExchange when backend ready
5
+ */
3
6
  export declare class HoldingTypeExchange extends AbstractModel {
4
7
  code?: string;
5
8
  name?: string;
@@ -3,6 +3,9 @@ import { User } from '../user';
3
3
  import { AbstractModel } from '../../db/Models';
4
4
  import { HoldingTypeExchange } from './holding-type-exchange';
5
5
  import { AppFile } from '../file';
6
+ /**
7
+ * @TODO vik 4521 rename to Holding when backend ready
8
+ */
6
9
  export declare class HoldingType extends AbstractModel {
7
10
  category?: HoldingTypeCategoryEnum;
8
11
  name?: string;
@@ -1,40 +1,24 @@
1
- import { User } from '../user';
2
- import { HoldingType } from './holding-type';
3
- import { AppFile } from '../file';
4
- import { HoldingSale } from './holding-sale';
5
- import { Collection } from '../../collections';
6
1
  import { AbstractModel } from '../../db/Models';
7
- import { HoldingTypeCategoryEnum } from '../../db/Enums';
2
+ import { HoldingTradeCollection } from '../../collections';
3
+ import { HoldingType } from './holding-type';
8
4
  export declare class Holding extends AbstractModel {
9
- isTaxFree: boolean;
10
- quantity: number;
11
- currentQuantity: number;
12
- ownershipPercent?: number;
13
- price: number;
14
- fee: number;
15
- date: Date;
16
- user: User;
5
+ private trades;
17
6
  type: HoldingType;
18
- file: AppFile;
19
- sales: Collection<HoldingSale>;
20
- /**
21
- * @TODO Artem/Alex looks bad, come up with a better solution
22
- * get current category, in holding we are interested in 3 main categories: stock/crypto/other
23
- */
24
- category: HoldingTypeCategoryEnum;
25
- /**
26
- * Get total purchasing price
27
- */
28
- get purchaseValue(): number;
29
- /**
30
- * Get current market price
31
- */
32
- get marketValue(): number;
7
+ quantity: number;
8
+ avgPrice: number;
9
+ purchaseValue: number;
10
+ marketValue: number;
11
+ pnl: number;
12
+ constructor(trades: HoldingTradeCollection, type: HoldingType);
13
+ getQuantity(): number;
14
+ getPurchaseValue(): number;
15
+ getMarketValue(): number;
16
+ getAvgPrice(): number;
33
17
  /**
34
- * Get percent difference between current and buy price
35
- * @TODO vik/alex no need to pass holdingType, should come from backend
18
+ * profit and loss
36
19
  */
37
- get growthCoefficient(): number;
38
- heldMoreYear(): boolean;
39
- isSold(): boolean;
20
+ getPnl(): number;
21
+ getSharedMarketValue(): number;
22
+ getGrowthCoefficient(): number;
23
+ getUnrealisedProfit(): number;
40
24
  }
@@ -1,6 +1,7 @@
1
- export * from './holding';
1
+ export * from './holding-trade';
2
2
  export * from './holding-type';
3
3
  export * from './holding-sale';
4
4
  export * from './holding-type-exchange';
5
5
  export * from './holding-reinvest';
6
- export * from './holding-import';
6
+ export * from './holding-trade-import';
7
+ export * from './holding';
@@ -1,4 +1,4 @@
1
- import { BankAccountService, ClientInviteService, ClientMovementService, EmployeeInviteService, EmployeeService, FirmService, HoldingService, IncomeSourceService, PropertyService, SoleBusinessService, TransactionAllocationService, TransactionService, UserService, VehicleClaimService } from '../http';
1
+ import { BankAccountService, ClientInviteService, ClientMovementService, EmployeeInviteService, EmployeeService, FirmService, HoldingTradeService, IncomeSourceService, PropertyService, SoleBusinessService, TransactionAllocationService, TransactionService, UserService, VehicleClaimService } from '../http';
2
2
  import { User } from '../../models';
3
3
  import { AccountSetupItemCollection } from '../../collections';
4
4
  import { Observable } from 'rxjs';
@@ -27,7 +27,7 @@ export declare class AccountSetupService {
27
27
  private firmService;
28
28
  items: AccountSetupItemCollection;
29
29
  user: User;
30
- constructor(setupItemService: SetupItemService, propertyService: PropertyService, incomeSourceService: IncomeSourceService, bankAccountsService: BankAccountService, transactionAllocationService: TransactionAllocationService, vehicleClaimService: VehicleClaimService, transactionService: TransactionService, soleBusinessService: SoleBusinessService, holdingService: HoldingService, userService: UserService, clientMovementService: ClientMovementService, clientInviteService: ClientInviteService, employeeService: EmployeeService, employeeInviteService: EmployeeInviteService, firmService: FirmService);
30
+ constructor(setupItemService: SetupItemService, propertyService: PropertyService, incomeSourceService: IncomeSourceService, bankAccountsService: BankAccountService, transactionAllocationService: TransactionAllocationService, vehicleClaimService: VehicleClaimService, transactionService: TransactionService, soleBusinessService: SoleBusinessService, holdingService: HoldingTradeService, userService: UserService, clientMovementService: ClientMovementService, clientInviteService: ClientInviteService, employeeService: EmployeeService, employeeInviteService: EmployeeInviteService, firmService: FirmService);
31
31
  /**
32
32
  * Get list of account setup items for current user/firm
33
33
  */
@@ -1,4 +1,4 @@
1
- export declare enum HoldingImportMessagesEnum {
1
+ export declare enum HoldingTradeImportMessagesEnum {
2
2
  CREATED = "Import created successfully",
3
3
  UPDATED = "Import updated successfully",
4
4
  CONFIRM_DELETE = "Are you sure you want to delete this import?",
@@ -0,0 +1,17 @@
1
+ import { RestMethod, RestService } from '../../rest';
2
+ import { Collection } from '../../../../collections';
3
+ import { UserRolesEnum } from 'taxtank-core/common';
4
+ import { HoldingTradeImport as HoldingTradeImportBase } from '../../../../db/Models/holding/holding-trade-import';
5
+ import { HoldingTradeImport } from '../../../../models';
6
+ import { Observable } from 'rxjs';
7
+ import * as i0 from "@angular/core";
8
+ export declare class HoldingTradeImportService extends RestService<HoldingTradeImportBase, HoldingTradeImport, Collection<HoldingTradeImport>> {
9
+ modelClass: typeof HoldingTradeImport;
10
+ collectionClass: typeof Collection<HoldingTradeImport>;
11
+ endpointUri: string;
12
+ disabledMethods: RestMethod[];
13
+ roles: UserRolesEnum[];
14
+ import(file: File, exchangeId: number, isTaxFree: boolean): Observable<HoldingTradeImport>;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<HoldingTradeImportService, never>;
16
+ static ɵprov: i0.ɵɵInjectableDeclaration<HoldingTradeImportService>;
17
+ }
@@ -1,4 +1,4 @@
1
- export declare enum HoldingMessagesEnum {
1
+ export declare enum HoldingTradeMessagesEnum {
2
2
  CREATED = "Holding created successfully",
3
3
  UPDATED = "Holding updated successfully",
4
4
  CONFIRM_DELETE = "Are you sure you want to delete this holding?",
@@ -0,0 +1,20 @@
1
+ import { HoldingTrade as HoldingBase } from '../../../db/Models';
2
+ import { HoldingTrade } from '../../../models';
3
+ import { RestMethod, RestService } from '../rest';
4
+ import { HoldingTradeCollection } from '../../../collections';
5
+ import { IEventListener } from '../../../interfaces';
6
+ import { UserRolesEnum } from 'taxtank-core/common';
7
+ import * as i0 from "@angular/core";
8
+ export declare class HoldingTradeService extends RestService<HoldingBase, HoldingTrade, HoldingTradeCollection> implements IEventListener {
9
+ protected environment: any;
10
+ modelClass: typeof HoldingTrade;
11
+ collectionClass: typeof HoldingTradeCollection;
12
+ endpointUri: string;
13
+ disabledMethods: RestMethod[];
14
+ roles: UserRolesEnum[];
15
+ constructor(environment: any);
16
+ listenEvents(): void;
17
+ private listenNotifications;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<HoldingTradeService, never>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<HoldingTradeService>;
20
+ }
@@ -1,9 +1,8 @@
1
- export * from './holding.service';
1
+ export * from './holding-trade.service';
2
2
  export * from './holding-type.service';
3
3
  export * from './holding-sale.service';
4
- export * from './holding-import/holding-import.service';
5
- export * from './holding-import/holding-import-messages.enum';
4
+ export * from './holding-trade-import/holding-trade-import.service';
5
+ export * from './holding-trade-import/holding-trade-import-messages.enum';
6
6
  export * from '../../json/holding/holding-type-exchange.service';
7
- export * from './holding-messages.enum';
8
- export * from './holding-sale-messages.enum';
7
+ export * from './holding-trade-messages.enum';
9
8
  export * from './holding-type-messages.enum';
@@ -1,3 +0,0 @@
1
- export class HoldingImport {
2
- }
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaG9sZGluZy1pbXBvcnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dC1jb3JlL3NyYy9saWIvZGIvTW9kZWxzL2hvbGRpbmcvaG9sZGluZy1pbXBvcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsTUFBTSxPQUFPLGFBQWE7Q0FNekIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBIb2xkaW5nIH0gZnJvbSAnLi9ob2xkaW5nJztcblxuZXhwb3J0IGNsYXNzIEhvbGRpbmdJbXBvcnQge1xuICBvcmlnaW5hbE5hbWU/OiBzdHJpbmc7XG4gIGlkPzogbnVtYmVyO1xuICBjcmVhdGVkQXQ/OiBEYXRlO1xuICB1cGRhdGVkQXQ/OiBEYXRlO1xuICBob2xkaW5ncz86IEhvbGRpbmdbXTtcbn1cbiJdfQ==
@@ -1,3 +0,0 @@
1
- export class Holding {
2
- }
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaG9sZGluZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3R0LWNvcmUvc3JjL2xpYi9kYi9Nb2RlbHMvaG9sZGluZy9ob2xkaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUtBLE1BQU0sT0FBTyxPQUFPO0NBWW5CIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtVc2VyfSBmcm9tICcuLi91c2VyL3VzZXInO1xuaW1wb3J0IHtIb2xkaW5nVHlwZX0gZnJvbSAnLi9ob2xkaW5nLXR5cGUnO1xuaW1wb3J0IHtGaWxlfSBmcm9tICcuLi9maWxlJztcbmltcG9ydCB7SG9sZGluZ1NhbGV9IGZyb20gJy4vaG9sZGluZy1zYWxlJztcblxuZXhwb3J0IGNsYXNzIEhvbGRpbmcge1xuICBpc1RheEZyZWU/OiBib29sZWFuO1xuICBkYXRlPzogRGF0ZTtcbiAgcXVhbnRpdHk/OiBudW1iZXI7XG4gIHByaWNlPzogbnVtYmVyO1xuICBmZWU/OiBudW1iZXI7XG4gIG93bmVyc2hpcFBlcmNlbnQ/OiBudW1iZXI7XG4gIGlkPzogbnVtYmVyO1xuICB1c2VyPzogVXNlcjtcbiAgdHlwZT86IEhvbGRpbmdUeXBlO1xuICBmaWxlPzogRmlsZTtcbiAgc2FsZXM/OiBIb2xkaW5nU2FsZVtdO1xufVxuIl19
@@ -1,25 +0,0 @@
1
- import { UntypedFormControl, Validators } from '@angular/forms';
2
- import { AbstractForm } from '../abstract.form';
3
- import { HoldingTypeCategoryEnum } from '../../db/Enums';
4
- import { HoldingTypeExchangeListEnum } from '../../db/Enums';
5
- export class HoldingImportForm extends AbstractForm {
6
- constructor() {
7
- super({
8
- category: new UntypedFormControl(HoldingTypeCategoryEnum.STOCK, Validators.required),
9
- exchangeId: new UntypedFormControl(HoldingTypeExchangeListEnum.AU, Validators.required),
10
- isTaxFree: new UntypedFormControl(false, Validators.required),
11
- file: new UntypedFormControl(null, Validators.required)
12
- });
13
- this.listenEvents();
14
- }
15
- listenEvents() {
16
- this.get('category').valueChanges.subscribe((category) => {
17
- this.get('exchangeId').setValue(category === HoldingTypeCategoryEnum.CRYPTO ? HoldingTypeExchangeListEnum.CC : HoldingTypeExchangeListEnum.AU);
18
- });
19
- }
20
- submit() {
21
- // @TODO TypeError: Failed to construct 'File': 2 arguments required, but only 0 present.
22
- return super.submit({ file: null });
23
- }
24
- }
25
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaG9sZGluZy1pbXBvcnQuZm9ybS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL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taXQoeyBmaWxlOiBudWxsIH0pO1xuICB9XG59XG4iXX0=
@@ -1,28 +0,0 @@
1
- import { UntypedFormControl, Validators } from '@angular/forms';
2
- import { AbstractForm } from '../abstract.form';
3
- import { greaterThanValidator } from '../../validators';
4
- export class HoldingForm extends AbstractForm {
5
- constructor(holding) {
6
- super({
7
- category: new UntypedFormControl(holding.category),
8
- isTaxFree: new UntypedFormControl(holding.isTaxFree, Validators.required),
9
- quantity: new UntypedFormControl(holding.quantity, [Validators.required, greaterThanValidator(0)]),
10
- price: new UntypedFormControl(holding.price, [Validators.required, Validators.min(0)]),
11
- fee: new UntypedFormControl(holding.fee, [Validators.required, Validators.min(0)]),
12
- date: new UntypedFormControl(holding.date, Validators.required),
13
- type: new UntypedFormControl(holding.type, Validators.required),
14
- ownershipPercent: new UntypedFormControl(holding.ownershipPercent || 100, Validators.required),
15
- file: new UntypedFormControl(holding.file)
16
- }, holding);
17
- this.listenEvents();
18
- }
19
- listenEvents() {
20
- this.get('category').valueChanges.subscribe((category) => {
21
- this.get('type').setValue(null);
22
- });
23
- }
24
- submit(data = {}, includeDisabledFields = false) {
25
- return super.submit(data, includeDisabledFields);
26
- }
27
- }
28
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaG9sZGluZy5mb3JtLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdHQtY29yZS9zcmMvbGliL2Zvcm1zL2hvbGRpbmcvaG9sZGluZy5mb3JtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxVQUFVLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUVoRSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFHaEQsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sa0J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