taxtank-core 0.30.43 → 0.30.45

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.
Files changed (172) hide show
  1. package/esm2020/lib/collections/collection.mjs +5 -2
  2. package/esm2020/lib/collections/exportable.collection.mjs +8 -1
  3. package/esm2020/lib/collections/holding/holding-sale.collection.mjs +20 -0
  4. package/esm2020/lib/collections/holding/holding-type.collection.mjs +13 -0
  5. package/esm2020/lib/collections/holding/holding.collection.mjs +69 -0
  6. package/esm2020/lib/collections/holding/index.mjs +4 -0
  7. package/esm2020/lib/collections/index.mjs +2 -3
  8. package/esm2020/lib/collections/property/property-sale/property-sale.collection.mjs +19 -3
  9. package/esm2020/lib/db/Json/property/tax-exemption.json +47 -0
  10. package/esm2020/lib/db/Models/user/user.mjs +1 -1
  11. package/esm2020/lib/forms/holding/holding-sale.form.mjs +9 -10
  12. package/esm2020/lib/forms/holding/holding.form.mjs +11 -1
  13. package/esm2020/lib/interceptors/basiq-client-id.interceptor.mjs +3 -3
  14. package/esm2020/lib/interceptors/basiq-token.interceptor.mjs +3 -3
  15. package/esm2020/lib/interceptors/corelogic-interceptor.mjs +3 -3
  16. package/esm2020/lib/interceptors/financial-year-interceptor.mjs +3 -3
  17. package/esm2020/lib/interceptors/interceptors.module.mjs +4 -4
  18. package/esm2020/lib/interceptors/jwt-interceptor.mjs +3 -3
  19. package/esm2020/lib/interceptors/preloader.interceptor.mjs +3 -3
  20. package/esm2020/lib/interceptors/user-switcher-interceptor.mjs +3 -3
  21. package/esm2020/lib/models/dictionary/dictionary.mjs +4 -1
  22. package/esm2020/lib/models/export/export-cell-type.enum.mjs +2 -1
  23. package/esm2020/lib/models/holding/holding-sale.mjs +7 -1
  24. package/esm2020/lib/models/holding/holding-type-exchange.mjs +1 -1
  25. package/esm2020/lib/models/holding/holding.mjs +13 -1
  26. package/esm2020/lib/models/property/property-sale/property-sale.mjs +1 -1
  27. package/esm2020/lib/services/account-setup/account-setup.service.mjs +3 -3
  28. package/esm2020/lib/services/affiliate/rewardful/rewardful.service.mjs +3 -3
  29. package/esm2020/lib/services/asset/assets.service.mjs +3 -3
  30. package/esm2020/lib/services/auth/auth.service.mjs +3 -3
  31. package/esm2020/lib/services/auth/jwt.service.mjs +3 -3
  32. package/esm2020/lib/services/bank/bank-account-calculation.service.mjs +3 -3
  33. package/esm2020/lib/services/bank/bank-transaction-calculation.service.mjs +3 -3
  34. package/esm2020/lib/services/data.service.mjs +7 -4
  35. package/esm2020/lib/services/event/event-dispatcher.service.mjs +3 -3
  36. package/esm2020/lib/services/event/sse.service.mjs +3 -3
  37. package/esm2020/lib/services/export/export-formatter.service.mjs +9 -6
  38. package/esm2020/lib/services/header-title/header-title.service.mjs +3 -3
  39. package/esm2020/lib/services/http/address/address.service.mjs +3 -3
  40. package/esm2020/lib/services/http/bank/bank-account/bank-account.service.mjs +3 -3
  41. package/esm2020/lib/services/http/bank/bank-connection/bank-connection.service.mjs +3 -3
  42. package/esm2020/lib/services/http/bank/bank-transaction/bank-transaction.service.mjs +3 -3
  43. package/esm2020/lib/services/http/bank/bank.service.mjs +3 -3
  44. package/esm2020/lib/services/http/bank/basiq/basiq-token.service.mjs +3 -3
  45. package/esm2020/lib/services/http/bank/basiq/basiq.service.mjs +3 -3
  46. package/esm2020/lib/services/http/chart-accounts/chart-accounts-depreciations/chart-accounts-depreciations.service.mjs +3 -3
  47. package/esm2020/lib/services/http/chart-accounts/chart-accounts.service.mjs +3 -3
  48. package/esm2020/lib/services/http/chat/chat.service.mjs +3 -3
  49. package/esm2020/lib/services/http/chat/message-document.service.mjs +3 -3
  50. package/esm2020/lib/services/http/chat/message.service.mjs +3 -3
  51. package/esm2020/lib/services/http/client/capital-gain/annual-client-details.service.mjs +3 -3
  52. package/esm2020/lib/services/http/client/occupation/occupation.service.mjs +3 -3
  53. package/esm2020/lib/services/http/depreciation/depreciation-capital-project/depreciation-capital-project.service.mjs +3 -3
  54. package/esm2020/lib/services/http/depreciation/depreciation-receipt/depreciation-receipt.service.mjs +3 -3
  55. package/esm2020/lib/services/http/depreciation/depreciation.service.mjs +3 -3
  56. package/esm2020/lib/services/http/document/document-folder/document-folder.service.mjs +3 -3
  57. package/esm2020/lib/services/http/document/document.service.mjs +3 -3
  58. package/esm2020/lib/services/http/facebook/facebook.service.mjs +3 -3
  59. package/esm2020/lib/services/http/file/file.service.mjs +3 -3
  60. package/esm2020/lib/services/http/firm/client-income/client-income-types.service.mjs +3 -3
  61. package/esm2020/lib/services/http/firm/client-invite/client-invite.service.mjs +3 -3
  62. package/esm2020/lib/services/http/firm/client-movement/client-movement.service.mjs +3 -3
  63. package/esm2020/lib/services/http/firm/employee/employee.service.mjs +3 -3
  64. package/esm2020/lib/services/http/firm/employee-invite/employee-invite.service.mjs +3 -3
  65. package/esm2020/lib/services/http/firm/firm.service.mjs +3 -3
  66. package/esm2020/lib/services/http/firm/portfolio-report/client-portfolio-report.service.mjs +3 -3
  67. package/esm2020/lib/services/http/google/google.service.mjs +3 -3
  68. package/esm2020/lib/services/http/holding/holding-sale.service.mjs +6 -6
  69. package/esm2020/lib/services/http/holding/holding-type.service.mjs +5 -5
  70. package/esm2020/lib/services/http/holding/holding.service.mjs +3 -3
  71. package/esm2020/lib/services/http/income-source/income-source-forecast/income-source-forecast.service.mjs +3 -3
  72. package/esm2020/lib/services/http/income-source/income-source.service.mjs +3 -3
  73. package/esm2020/lib/services/http/income-source/salary-forecast/salary-forecast.service.mjs +3 -3
  74. package/esm2020/lib/services/http/income-source/sole-forecast/sole-forecast.service.mjs +3 -3
  75. package/esm2020/lib/services/http/loan/borrowing-expense/borrowing-expense.service.mjs +3 -3
  76. package/esm2020/lib/services/http/loan/loan.service.mjs +3 -3
  77. package/esm2020/lib/services/http/property/property-category/property-category.service.mjs +3 -3
  78. package/esm2020/lib/services/http/property/property-category-movement/property-category-movement.service.mjs +3 -3
  79. package/esm2020/lib/services/http/property/property-document/property-document.service.mjs +3 -3
  80. package/esm2020/lib/services/http/property/property-sale/index.mjs +2 -2
  81. package/esm2020/lib/services/http/property/property-sale/property-sale.service.mjs +3 -3
  82. package/esm2020/lib/services/http/property/property-share/property-share.service.mjs +3 -3
  83. package/esm2020/lib/services/http/property/property.service.mjs +3 -3
  84. package/esm2020/lib/services/http/receipt/receipt.service.mjs +3 -3
  85. package/esm2020/lib/services/http/rest/rest-old.service.mjs +3 -3
  86. package/esm2020/lib/services/http/rest/rest.service.mjs +3 -3
  87. package/esm2020/lib/services/http/service-notification/service-notification.service.mjs +3 -3
  88. package/esm2020/lib/services/http/sole/bas-report/bas-report.service.mjs +3 -3
  89. package/esm2020/lib/services/http/sole/sole-business/sole-business.service.mjs +3 -3
  90. package/esm2020/lib/services/http/sole/sole-business-activity/sole-business-activity.service.mjs +3 -3
  91. package/esm2020/lib/services/http/sole/sole-business-loss/sole-business-loss-rules/sole-business-loss-offset-rule.service.mjs +3 -3
  92. package/esm2020/lib/services/http/sole/sole-business-loss/sole-business-loss.service.mjs +3 -3
  93. package/esm2020/lib/services/http/sole/sole-contact/sole-contact.service.mjs +3 -3
  94. package/esm2020/lib/services/http/sole/sole-depreciation-method/sole-depreciation-method.service.mjs +3 -3
  95. package/esm2020/lib/services/http/sole/sole-details/sole-details.service.mjs +3 -3
  96. package/esm2020/lib/services/http/sole/sole-invoice/sole-invoice.service.mjs +3 -3
  97. package/esm2020/lib/services/http/sole/sole-invoice-template/sole-invoice-template.service.mjs +3 -3
  98. package/esm2020/lib/services/http/subscription/service-payment/service-payment.service.mjs +3 -3
  99. package/esm2020/lib/services/http/subscription/service-payment-method/service-payment-method.service.mjs +3 -3
  100. package/esm2020/lib/services/http/subscription/service-price/service-price.service.mjs +3 -3
  101. package/esm2020/lib/services/http/subscription/service-product/service-product.service.mjs +3 -3
  102. package/esm2020/lib/services/http/subscription/service-subscription/subscription.service.mjs +3 -3
  103. package/esm2020/lib/services/http/tax-review/tax-review-history/tax-review-history.service.mjs +3 -3
  104. package/esm2020/lib/services/http/tax-review/tax-review.service.mjs +3 -3
  105. package/esm2020/lib/services/http/tax-summary/tax-summary.service.mjs +3 -3
  106. package/esm2020/lib/services/http/transaction/transaction-allocation/allocation-rule/allocation-rule.service.mjs +3 -3
  107. package/esm2020/lib/services/http/transaction/transaction-allocation/transaction-allocation.service.mjs +3 -3
  108. package/esm2020/lib/services/http/transaction/transaction-receipt/transaction-receipt.service.mjs +3 -3
  109. package/esm2020/lib/services/http/transaction/transaction.service.mjs +3 -3
  110. package/esm2020/lib/services/http/tutorial-video/tutorial-video.service.mjs +3 -3
  111. package/esm2020/lib/services/http/user/user-event-setting/user-event-setting.service.mjs +3 -3
  112. package/esm2020/lib/services/http/user/user-event-type/user-event-type.service.mjs +3 -3
  113. package/esm2020/lib/services/http/user/user.service.mjs +3 -3
  114. package/esm2020/lib/services/http/user/users-invite/users-invite.service.mjs +3 -3
  115. package/esm2020/lib/services/http/vehicle/vehicle-claim-details.service.mjs +3 -3
  116. package/esm2020/lib/services/http/vehicle/vehicle-claim.service.mjs +3 -3
  117. package/esm2020/lib/services/http/vehicle/vehicle-logbook.service.mjs +3 -3
  118. package/esm2020/lib/services/http/vehicle/vehicle.service.mjs +3 -3
  119. package/esm2020/lib/services/index.mjs +2 -1
  120. package/esm2020/lib/services/intercom/intercom.service.mjs +3 -3
  121. package/esm2020/lib/services/json/holding/holding-type-exchange.service.mjs +3 -3
  122. package/esm2020/lib/services/json/index.mjs +3 -0
  123. package/esm2020/lib/services/json/tax-exemption/tax-exemption.service.mjs +23 -0
  124. package/esm2020/lib/services/pdf/pdf-from-dom-element/pdf-from-dom-element.service.mjs +3 -3
  125. package/esm2020/lib/services/pdf/pdf-from-table/pdf-from-data-table/pdf-from-data-table.service.mjs +3 -3
  126. package/esm2020/lib/services/pdf/pdf-from-table/pdf-from-html-table/pdf-from-html-table.service.mjs +3 -3
  127. package/esm2020/lib/services/pdf/pdf-from-table/pdf-from-table.service.mjs +3 -3
  128. package/esm2020/lib/services/preloader/preloader.service.mjs +3 -3
  129. package/esm2020/lib/services/property/corelogic/corelogic.service.mjs +3 -3
  130. package/esm2020/lib/services/property/equity-position-chart/equity-position-chart.service.mjs +3 -3
  131. package/esm2020/lib/services/property/property-calculation/property-calculation.service.mjs +3 -3
  132. package/esm2020/lib/services/report/property/property-transaction-report.service.mjs +3 -3
  133. package/esm2020/lib/services/toast/toast.service.mjs +3 -3
  134. package/esm2020/lib/services/transaction/transaction-calculation.service.mjs +3 -3
  135. package/esm2020/lib/services/user/user-switcher.service.mjs +3 -3
  136. package/esm2020/lib/services/vehicle/logbook-best-period.service.mjs +3 -3
  137. package/esm2020/lib/services/xlsx/xlsx.service.mjs +38 -5
  138. package/esm2020/lib/tt-core.module.mjs +4 -4
  139. package/fesm2015/taxtank-core.mjs +582 -376
  140. package/fesm2015/taxtank-core.mjs.map +1 -1
  141. package/fesm2020/taxtank-core.mjs +587 -376
  142. package/fesm2020/taxtank-core.mjs.map +1 -1
  143. package/lib/collections/collection.d.ts +2 -1
  144. package/lib/collections/exportable.collection.d.ts +1 -0
  145. package/lib/collections/holding/holding-sale.collection.d.ts +11 -0
  146. package/lib/collections/{holding-type.collection.d.ts → holding/holding-type.collection.d.ts} +2 -2
  147. package/lib/collections/holding/holding.collection.d.ts +16 -0
  148. package/lib/collections/holding/index.d.ts +3 -0
  149. package/lib/collections/index.d.ts +1 -2
  150. package/lib/collections/property/property-sale/property-sale.collection.d.ts +8 -1
  151. package/lib/db/Models/user/user.d.ts +1 -1
  152. package/lib/forms/holding/holding-sale.form.d.ts +1 -1
  153. package/lib/forms/holding/holding.form.d.ts +4 -1
  154. package/lib/models/dictionary/dictionary.d.ts +1 -0
  155. package/lib/models/export/export-cell-type.enum.d.ts +2 -1
  156. package/lib/models/holding/holding-sale.d.ts +4 -0
  157. package/lib/models/holding/holding.d.ts +5 -0
  158. package/lib/services/data.service.d.ts +4 -1
  159. package/lib/services/export/export-formatter.service.d.ts +3 -2
  160. package/lib/services/http/holding/holding-sale.service.d.ts +2 -1
  161. package/lib/services/http/holding/holding-type.service.d.ts +1 -1
  162. package/lib/services/http/property/property-sale/index.d.ts +1 -1
  163. package/lib/services/index.d.ts +1 -0
  164. package/lib/services/json/index.d.ts +2 -0
  165. package/lib/services/json/tax-exemption/tax-exemption.service.d.ts +12 -0
  166. package/lib/services/xlsx/xlsx.service.d.ts +6 -0
  167. package/package.json +1 -1
  168. package/esm2020/lib/collections/holding-type.collection.mjs +0 -13
  169. package/esm2020/lib/collections/holding.collection.mjs +0 -31
  170. package/esm2020/lib/services/http/property/property-sale/tax-exemption/tax-exemption.service.mjs +0 -24
  171. package/lib/collections/holding.collection.d.ts +0 -11
  172. package/lib/services/http/property/property-sale/tax-exemption/tax-exemption.service.d.ts +0 -14
@@ -1,6 +1,6 @@
1
1
  import { CollectionDictionary } from './collection-dictionary';
2
2
  import { AbstractModel } from '../db/Models';
3
- import { Dictionary } from '../models';
3
+ import { Dictionary, FinancialYear } from '../models';
4
4
  /**
5
5
  * Base collection class. Contains common properties and methods for all collections
6
6
  */
@@ -36,6 +36,7 @@ export declare class Collection<Model extends AbstractModel> implements Iterable
36
36
  filter(callback: (item: Model) => boolean): this;
37
37
  filterBy(path: string, values: any): this;
38
38
  filterByRange(path: string, from: any, to: any): this;
39
+ filterByFinancialYear(path: string, financialYear?: FinancialYear): this;
39
40
  find(callback: (item: Model) => boolean): Model | null;
40
41
  findBy(path: string, value: any): Model | null;
41
42
  findIndexBy(path: string, value: any): number;
@@ -6,5 +6,6 @@ export declare abstract class ExportableCollection<Model extends AbstractModel>
6
6
  abstract getExportHeader(type?: string): string[];
7
7
  abstract getExportBody(type?: string): ExportCell[][];
8
8
  getExportFooter(type?: string): ExportCell[];
9
+ getBodyAoa(exportData: any): any;
9
10
  export(type?: string): ExportDataTable;
10
11
  }
@@ -0,0 +1,11 @@
1
+ import { Collection } from '../collection';
2
+ import { HoldingSale } from '../../models';
3
+ export declare class HoldingSaleCollection extends Collection<HoldingSale> {
4
+ /**
5
+ * @TODO vik remove?
6
+ */
7
+ get grossCapitalGain(): number;
8
+ get currentYearCapitalLoss(): number;
9
+ get halfExemptionGrossCapitalGain(): number;
10
+ get noExemptionGrossCapitalGain(): number;
11
+ }
@@ -1,5 +1,5 @@
1
- import { HoldingType } from '../models';
2
- import { Collection } from './collection';
1
+ import { HoldingType } from '../../models';
2
+ import { Collection } from '../collection';
3
3
  export declare class HoldingTypeCollection extends Collection<HoldingType> {
4
4
  getOthers(): this;
5
5
  }
@@ -0,0 +1,16 @@
1
+ import { ExportableCollection } from "../exportable.collection";
2
+ import { Dictionary, Holding, HoldingType } from "../../models";
3
+ import { ExportCell } from "../../models/export/export-cell";
4
+ export declare class HoldingCollection extends ExportableCollection<Holding> {
5
+ holdingTypesById: Dictionary<HoldingType>;
6
+ getExportHeader(): string[];
7
+ getExportFooter(): ExportCell[];
8
+ getExportBody(): ExportCell[][];
9
+ getShares(): this;
10
+ getCryptos(): this;
11
+ getOthers(): this;
12
+ getPurchaseValue(): number;
13
+ getMarketValue(holdingTypesById: Dictionary<HoldingType>): number;
14
+ getGrowthCoefficient(holdingTypesById: Dictionary<HoldingType>): number;
15
+ getUnsold(): this;
16
+ }
@@ -0,0 +1,3 @@
1
+ export * from './holding.collection';
2
+ export * from './holding-sale.collection';
3
+ export * from './holding-type.collection';
@@ -27,5 +27,4 @@ export * from './income-source.collection';
27
27
  export * from './tax-review.collection';
28
28
  export * from './user-event-setting.collection';
29
29
  export * from './user-event-type-collection';
30
- export * from './holding.collection';
31
- export * from './holding-type.collection';
30
+ export * from './holding';
@@ -1,10 +1,17 @@
1
1
  import { Collection } from '../../collection';
2
- import { PropertySale } from '../../../models/property/property-sale/property-sale';
2
+ import { PropertySale } from '../../../models';
3
3
  export declare class PropertySaleCollection extends Collection<PropertySale> {
4
+ /**
5
+ * @TODO vik remove?
6
+ */
4
7
  get grossCapitalGain(): number;
5
8
  /**
6
9
  * Property sales are CGT applicable unless it has "Principle place of residence" exemption type
7
10
  */
8
11
  getCGTApplicable(): this;
9
12
  getByPropertyShareIds(ids: number[]): this;
13
+ get currentYearCapitalLoss(): number;
14
+ get fullExemptionGrossCapitalGain(): number;
15
+ get halfExemptionGrossCapitalGain(): number;
16
+ get noExemptionGrossCapitalGain(): number;
10
17
  }
@@ -35,7 +35,7 @@ export declare class User extends AbstractModel {
35
35
  rewardfulReferralKey?: string;
36
36
  stripeId?: string;
37
37
  basiqId?: string;
38
- roles?: UserRolesEnum;
38
+ roles?: UserRolesEnum[];
39
39
  financialYear?: number;
40
40
  dateOfBirth?: Date;
41
41
  lastSeen?: Date;
@@ -7,7 +7,7 @@ export declare class HoldingSaleForm extends AbstractForm<HoldingSale> implement
7
7
  listenEvents(): void;
8
8
  submit(): HoldingSale;
9
9
  private updateGainFields;
10
- private calculateGrossCapitalGain;
10
+ private calculateTotalCapitalGain;
11
11
  private calculateNetCapitalGain;
12
12
  private isOneYearExemptionApplicable;
13
13
  }
@@ -1,5 +1,8 @@
1
1
  import { Holding } from '../../models';
2
2
  import { AbstractForm } from '../abstract.form';
3
- export declare class HoldingForm extends AbstractForm<Holding> {
3
+ import { IEventListener } from '../../interfaces';
4
+ export declare class HoldingForm extends AbstractForm<Holding> implements IEventListener {
4
5
  constructor(holding: Holding);
6
+ listenEvents(): void;
7
+ submit(data?: object, includeDisabledFields?: boolean): Holding;
5
8
  }
@@ -9,4 +9,5 @@ export declare class Dictionary<Model> {
9
9
  add(key: string | number, value: Model): void;
10
10
  get(key: string | number): Model;
11
11
  private groupItems;
12
+ get keys(): string[];
12
13
  }
@@ -4,5 +4,6 @@
4
4
  export declare enum ExportCellTypeEnum {
5
5
  STRING = 0,
6
6
  CURRENCY = 1,
7
- DATE = 2
7
+ DATE = 2,
8
+ PERCENT = 3
8
9
  }
@@ -12,4 +12,8 @@ export declare class HoldingSale extends ObservableModel {
12
12
  holding?: Holding;
13
13
  date: Date;
14
14
  file: AppFile;
15
+ /**
16
+ * netCapitalGain is different from grossCapitalGain only when 1 year rule applied
17
+ */
18
+ isOneYearExemptionApplicable(): boolean;
15
19
  }
@@ -4,6 +4,7 @@ import { AppFile } from '../file';
4
4
  import { HoldingSale } from './holding-sale';
5
5
  import { Collection } from '../../collections';
6
6
  import { AbstractModel } from '../../db/Models';
7
+ import { HoldingTypeCategoryEnum } from '../../db/Enums';
7
8
  export declare class Holding extends AbstractModel {
8
9
  isTaxFree: boolean;
9
10
  quantity: number;
@@ -29,5 +30,9 @@ export declare class Holding extends AbstractModel {
29
30
  */
30
31
  getGrowthCoefficient(holdingType: HoldingType): number;
31
32
  heldMoreYear(): boolean;
33
+ /**
34
+ * in holding we are interested in 3 main categories: stock/crypto/other
35
+ */
36
+ get category(): HoldingTypeCategoryEnum;
32
37
  isSold(): boolean;
33
38
  }
@@ -26,7 +26,10 @@ export declare abstract class DataService<BaseModel, Model extends AbstractModel
26
26
  * never return cache directly to prevent update
27
27
  */
28
28
  getCache(): CollectionModel;
29
- setCache(data: BaseModel[]): void;
29
+ /**
30
+ * @TODO vik any[] because of problems with base models extending abstractModel
31
+ */
32
+ setCache(data: any[]): void;
30
33
  static ɵfac: i0.ɵɵFactoryDeclaration<DataService<any, any, any>, never>;
31
34
  static ɵprov: i0.ɵɵInjectableDeclaration<DataService<any, any, any>>;
32
35
  }
@@ -1,10 +1,11 @@
1
1
  import { ExportCell } from '../../models/export/export-cell';
2
- import { CurrencyPipe, DatePipe } from '@angular/common';
2
+ import { CurrencyPipe, DatePipe, PercentPipe } from '@angular/common';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class ExportFormatterService {
5
5
  private currencyPipe;
6
+ private percentPipe;
6
7
  private datePipe;
7
- constructor(currencyPipe: CurrencyPipe, datePipe: DatePipe);
8
+ constructor(currencyPipe: CurrencyPipe, percentPipe: PercentPipe, datePipe: DatePipe);
8
9
  format(rows: ExportCell[][]): string[][];
9
10
  static ɵfac: i0.ɵɵFactoryDeclaration<ExportFormatterService, never>;
10
11
  static ɵprov: i0.ɵɵInjectableDeclaration<ExportFormatterService>;
@@ -2,10 +2,11 @@ import { HoldingSale as HoldingSaleBase } from '../../../db/Models';
2
2
  import { HoldingSale } from '../../../models';
3
3
  import { RestMethod, RestService } from '../rest';
4
4
  import { Collection } from '../../../collections';
5
+ import { HoldingSaleCollection } from '../../../collections';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class HoldingSaleService extends RestService<HoldingSaleBase, HoldingSale, Collection<HoldingSale>> {
7
8
  modelClass: typeof HoldingSale;
8
- collectionClass: typeof Collection;
9
+ collectionClass: typeof HoldingSaleCollection;
9
10
  endpointUri: string;
10
11
  isApiPlatform: boolean;
11
12
  disabledMethods: RestMethod[];
@@ -1,7 +1,7 @@
1
1
  import { HoldingType as HoldingTypeBase } from '../../../db/Models';
2
2
  import { HoldingType } from '../../../models';
3
3
  import { RestMethod, RestService } from '../rest';
4
- import { HoldingTypeCollection } from '../../../collections/holding-type.collection';
4
+ import { HoldingTypeCollection } from '../../../collections';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class HoldingTypeService extends RestService<HoldingTypeBase, HoldingType, HoldingTypeCollection> {
7
7
  modelClass: typeof HoldingType;
@@ -1,2 +1,2 @@
1
- export * from './tax-exemption/tax-exemption.service';
1
+ export * from '../../../json/tax-exemption/tax-exemption.service';
2
2
  export * from './property-sale.service';
@@ -1,4 +1,5 @@
1
1
  export * from './http';
2
+ export * from './json';
2
3
  export * from './account-setup';
3
4
  export * from './affiliate';
4
5
  export * from './asset';
@@ -0,0 +1,2 @@
1
+ export * from './holding/holding-type-exchange.service';
2
+ export * from './tax-exemption/tax-exemption.service';
@@ -0,0 +1,12 @@
1
+ import { TaxExemption as BaseTaxExemption } from '../../../db/Models';
2
+ import { TaxExemption } from '../../../models';
3
+ import { Collection } from '../../../collections';
4
+ import { DataService } from '../../data.service';
5
+ import * as i0 from "@angular/core";
6
+ export declare class TaxExemptionService extends DataService<BaseTaxExemption, TaxExemption, Collection<TaxExemption>> {
7
+ modelClass: typeof TaxExemption;
8
+ collectionClass: typeof Collection;
9
+ constructor();
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<TaxExemptionService, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<TaxExemptionService>;
12
+ }
@@ -1,3 +1,4 @@
1
+ import { ExportableCollection } from "../../collections";
1
2
  import * as i0 from "@angular/core";
2
3
  export declare class XlsxService {
3
4
  /**
@@ -5,6 +6,11 @@ export declare class XlsxService {
5
6
  */
6
7
  exportTables(tables: NodeListOf<HTMLTableElement>, title: string, fileName: string): void;
7
8
  private generateFromTables;
9
+ getFileName: (name: string) => {
10
+ sheetName: string;
11
+ fileName: string;
12
+ };
13
+ exportArrayToExcel(exportableCollection: ExportableCollection<any>, name?: string): void;
8
14
  static ɵfac: i0.ɵɵFactoryDeclaration<XlsxService, never>;
9
15
  static ɵprov: i0.ɵɵInjectableDeclaration<XlsxService>;
10
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.30.43",
3
+ "version": "0.30.45",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/compiler": "^15.1.5",
@@ -1,13 +0,0 @@
1
- import { HoldingTypeCategoryEnum } from '../db/Enums';
2
- import { Collection } from './collection';
3
- export class HoldingTypeCollection extends Collection {
4
- getOthers() {
5
- return this.filterBy('category', [
6
- HoldingTypeCategoryEnum.COLLECTIBLE,
7
- HoldingTypeCategoryEnum.UNLISTED_STOCK,
8
- HoldingTypeCategoryEnum.UNLISTED_UNIT,
9
- HoldingTypeCategoryEnum.OTHER
10
- ]);
11
- }
12
- }
13
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaG9sZGluZy10eXBlLmNvbGxlY3Rpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dC1jb3JlL3NyYy9saWIvY29sbGVjdGlvbnMvaG9sZGluZy10eXBlLmNvbGxlY3Rpb24udHMiXSwibmFtZXMiOlt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ICB9XG59XG4iXX0=
@@ -1,31 +0,0 @@
1
- import { Collection } from '.';
2
- import { HoldingTypeCategoryEnum } from '../db/Enums';
3
- export class HoldingCollection extends Collection {
4
- getShares() {
5
- return this.filterBy('type.category', HoldingTypeCategoryEnum.STOCK);
6
- }
7
- getCryptos() {
8
- return this.filterBy('type.category', HoldingTypeCategoryEnum.CRYPTO);
9
- }
10
- getOthers() {
11
- return this.filterBy('type.category', [
12
- HoldingTypeCategoryEnum.COLLECTIBLE,
13
- HoldingTypeCategoryEnum.UNLISTED_STOCK,
14
- HoldingTypeCategoryEnum.UNLISTED_UNIT,
15
- HoldingTypeCategoryEnum.OTHER
16
- ]);
17
- }
18
- getPurchaseValue() {
19
- return this.sumBy('purchaseValue');
20
- }
21
- getMarketValue(holdingTypesById) {
22
- return this.items.reduce((sum, holding) => sum + holding.getMarketValue(holdingTypesById.get(holding.type.id)), 0);
23
- }
24
- getGrowthCoefficient(holdingTypesById) {
25
- return this.getMarketValue(holdingTypesById) / this.getPurchaseValue() - 1;
26
- }
27
- getUnsold() {
28
- return this.removeBy('currentQuantity', 0);
29
- }
30
- }
31
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaG9sZGluZy5jb2xsZWN0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdHQtY29yZS9zcmMvbGliL2NvbGxlY3Rpb25zL2hvbGRpbmcuY29sbGVjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sR0FBRyxDQUFDO0FBQy9CLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUd0RCxNQUFNLE9BQU8saUJBQWtCLFNBQVEsVUFBbUI7SUFDeEQsU0FBUztRQUNQLE9BQU8sSUFBSSxDQUFDLFFBQVEsQ0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tcbiAgfVxuXG4gIGdldE1hcmtldFZhbHVlKGhvbGRpbmdUeXBlc0J5SWQ6IERpY3Rpb25hcnk8SG9sZGluZ1R5cGU+KTogbnVtYmVyIHtcbiAgICByZXR1cm4gdGhpcy5pdGVtcy5yZWR1Y2UoKHN1bTogbnVtYmVyLCBob2xkaW5nOiBIb2xkaW5nKSA9PiBzdW0gKyBob2xkaW5nLmdldE1hcmtldFZhbHVlKGhvbGRpbmdUeXBlc0J5SWQuZ2V0KGhvbGRpbmcudHlwZS5pZCkpLCAwKTtcbiAgfVxuXG4gIGdldEdyb3d0aENvZWZmaWNpZW50KGhvbGRpbmdUeXBlc0J5SWQ6IERpY3Rpb25hcnk8SG9sZGluZ1R5cGU+KTogbnVtYmVyIHtcbiAgICByZXR1cm4gdGhpcy5nZXRNYXJrZXRWYWx1ZShob2xkaW5nVHlwZXNCeUlkKSAvIHRoaXMuZ2V0UHVyY2hhc2VWYWx1ZSgpIC0gMTtcbiAgfVxuXG4gIGdldFVuc29sZCgpOiB0aGlzIHtcbiAgICByZXR1cm4gdGhpcy5yZW1vdmVCeSgnY3VycmVudFF1YW50aXR5JywgMCk7XG4gIH1cbn1cbiJdfQ==
@@ -1,24 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { RestService } from '../../../rest';
3
- import { TaxExemption } from '../../../../../models';
4
- import { Collection } from '../../../../../collections';
5
- import * as i0 from "@angular/core";
6
- export class TaxExemptionService extends RestService {
7
- constructor() {
8
- super(...arguments);
9
- this.modelClass = TaxExemption;
10
- this.collectionClass = Collection;
11
- this.endpointUri = 'tax-exemptions';
12
- this.isApiPlatform = true;
13
- this.disabledMethods = ['post', 'postBatch', 'put', 'putBatch', 'delete', 'deleteBatch'];
14
- }
15
- }
16
- TaxExemptionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: TaxExemptionService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
17
- TaxExemptionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: TaxExemptionService, providedIn: 'root' });
18
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.4", ngImport: i0, type: TaxExemptionService, decorators: [{
19
- type: Injectable,
20
- args: [{
21
- providedIn: 'root'
22
- }]
23
- }] });
24
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGF4LWV4ZW1wdGlvbi5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdHQtY29yZS9zcmMvbGliL3NlcnZpY2VzL2h0dHAvcHJvcGVydHkvcHJvcGVydHktc2FsZS90YXgtZXhlbXB0aW9uL3RheC1leGVtcHRpb24uc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNDLE9BQU8sRUFBYyxXQUFXLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFeEQsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ3JELE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQzs7QUFLeEQsTUFBTSxPQUFPLG1CQUFvQixTQUFRLFdBQXFFO0lBSDlHOztRQUlFLGVBQVUsR0FBd0IsWUFBWSxDQUFDO1FBQy9DLG9CQUFlLEdBQXNCLFVBQVUsQ0FBQztRQUNoRCxnQkFBVyxHQUFHLGdCQUFnQixDQUFDO1FBQy9CLGtCQUFhLEdBQUcsSUFBSSxDQUFDO1FBQ3JCLG9CQUFlLEdBQWlCLENBQUMsTUFBTSxFQUFFLFdBQVcsRUFBRSxLQUFLLEVBQUUsVUFBVSxFQUFFLFFBQVEsRUFBRSxhQUFhLENBQUMs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CYXRjaCcsICdwdXQnLCAncHV0QmF0Y2gnLCAnZGVsZXRlJywgJ2RlbGV0ZUJhdGNoJ107XG59XG4iXX0=
@@ -1,11 +0,0 @@
1
- import { Collection } from '.';
2
- import { Dictionary, Holding, HoldingType } from '../models';
3
- export declare class HoldingCollection extends Collection<Holding> {
4
- getShares(): this;
5
- getCryptos(): this;
6
- getOthers(): this;
7
- getPurchaseValue(): number;
8
- getMarketValue(holdingTypesById: Dictionary<HoldingType>): number;
9
- getGrowthCoefficient(holdingTypesById: Dictionary<HoldingType>): number;
10
- getUnsold(): this;
11
- }
@@ -1,14 +0,0 @@
1
- import { RestMethod, RestService } from '../../../rest';
2
- import { TaxExemption as BaseTaxExemption } from '../../../../../db/Models';
3
- import { TaxExemption } from '../../../../../models';
4
- import { Collection } from '../../../../../collections';
5
- import * as i0 from "@angular/core";
6
- export declare class TaxExemptionService extends RestService<BaseTaxExemption, TaxExemption, Collection<TaxExemption>> {
7
- modelClass: typeof TaxExemption;
8
- collectionClass: typeof Collection;
9
- endpointUri: string;
10
- isApiPlatform: boolean;
11
- disabledMethods: RestMethod[];
12
- static ɵfac: i0.ɵɵFactoryDeclaration<TaxExemptionService, never>;
13
- static ɵprov: i0.ɵɵInjectableDeclaration<TaxExemptionService>;
14
- }