Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve degiro v3 parsing #148

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions samples/degiro-export.csv
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,43 @@ Datum,Tijd,Valutadatum,Product,ISIN,Omschrijving,FX,Mutatie,,Saldo,,Order Id
09-06-2020,12:05,08-06-2020,EUR CASH FUND FUNDSHARE,NL0010661914,"Conversion Fonds Monétaires finalisée: Vente 1 046,3825 @ 0,9854 EUR",,EUR,-4.81,EUR,84.89,
01-01-2025,06:46,31-12-2024,,,FX Credit,,EUR,12.28,EUR,217.01,
01-01-2025,06:46,31-12-2024,,,FX Debit,1.0379,USD,-12.75,USD,0.00,
13-09-2021,08:26,10-09-2021,MOODY'S CORP.,US6153691059,Dividend,,USD,0.62,USD,0.53,
13-09-2021,08:26,10-09-2021,MOODY'S CORP.,US6153691059,Dividendbelasting,,USD,-0.09,USD,-0.09,
10-09-2021,20:22,10-09-2021,MOODY'S CORP.,US6153691059,Valuta Debitering,1.1824,USD,-384.50,USD,0.00,80ff8574-14dd-46e1-bdf7-f11b8bbfa5c7
10-09-2021,20:22,10-09-2021,MOODY'S CORP.,US6153691059,Valuta Creditering,,EUR,325.19,EUR,,80ff8574-14dd-46e1-bdf7-f11b8bbfa5c7
10-09-2021,20:22,10-09-2021,MOODY'S CORP.,US6153691059,DEGIRO Transactiekosten en/of kosten van derden,,EUR,-0.50,EUR,,80ff8574-14dd-46e1-bdf7-f11b8bbfa5c7
10-09-2021,20:22,10-09-2021,MOODY'S CORP.,US6153691059,"Verkoop 1 @ 384,5 USD",,USD,384.50,USD,,80ff8574-14dd-46e1-bdf7-f11b8bbfa5c7
16-12-2021,18:02,22-10-2021,MOODY'S CORP.,US6153691059,Dividendbelasting,,USD,-0.01,USD,0.00,
16-12-2021,18:02,22-10-2021,MORGAN STANLEY,US6174464486,Dividendbelasting,,USD,0.01,USD,0.01,
16-12-2021,18:02,22-10-2021,MOODY'S CORP.,US6153691059,Dividendbelasting,,USD,-0.01,USD,0.00,
16-12-2021,18:02,22-10-2021,MORGAN STANLEY,US6174464486,Dividendbelasting,,USD,0.01,USD,0.01,
23-12-2020,10:03,23-12-2020,ISHARES GLOBAL CLEAN ENERGY UCITS ETF,IE00B1XNHC34,DEGIRO Transactiekosten en/of kosten van derden,,EUR,-0.79,EUR,,1d2e7a85-cf67-4325-82c7-d5994a0afb98
23-12-2020,10:03,23-12-2020,ISHARES GLOBAL CLEAN ENERGY UCITS ETF,IE00B1XNHC34,DEGIRO Transactiekosten en/of kosten van derden,,EUR,-4.00,EUR,,1d2e7a85-cf67-4325-82c7-d5994a0afb98
23-12-2020,10:03,23-12-2020,ISHARES GLOBAL CLEAN ENERGY UCITS ETF,IE00B1XNHC34,Verkoop 120 @ 1.202 GBX,,GBP,1442.40,GBP,,1d2e7a85-cf67-4325-82c7-d5994a0afb98
25-08-2022,10:21,25-08-2022,TESLA,US88160R1014,"STOCK SPLIT: Koop 3 @ 297,0967 USD",,USD,-891.29,USD,-0.01,
25-08-2022,10:21,25-08-2022,TESLA,US88160R1014,"STOCK SPLIT: Verkoop 1 @ 891,29 USD",,USD,891.29,USD,1.29,
11-07-2024,16:46,11-07-2024,VANGUARD FTSE ALL-WORLD UCITS ETF,IE00B3RBWM25,"Verkoop 16 @ 124,28 EUR",,EUR,1988.48,EUR,,56e1f16b-4142-4373-851d-45d0505fe12c
11-07-2024,16:43,11-07-2024,VANGUARD FTSE ALL-WORLD UCITS ETF,IE00B3RBWM25,DEGIRO Transactiekosten en/of kosten van derden,,EUR,-1.00,EUR,,56e1f16b-4142-4373-851d-45d0505fe12c
11-07-2024,16:43,11-07-2024,VANGUARD FTSE ALL-WORLD UCITS ETF,IE00B3RBWM25,"Verkoop 8 @ 124,28 EUR",,EUR,994.24,EUR,,56e1f16b-4142-4373-851d-45d0505fe12c
13-04-2016,09:00,13-04-2016,ABN AMRO BANK NV,NL0011540547,DEGIRO Transactiekosten en/of kosten van derden,,EUR,-2.00,EUR,,df134e52-2753-4694-947b-418f08d4a352
13-04-2016,09:00,13-04-2016,ABN AMRO BANK NV,NL0011540547,DEGIRO Transactiekosten en/of kosten van derden,,EUR,-0.04,EUR,,df134e52-2753-4694-947b-418f08d4a352
13-04-2016,09:00,13-04-2016,ABN AMRO BANK NV,NL0011540547,"Koop 10 @ 18,3 EUR",,EUR,-183.00,EUR,,df134e52-2753-4694-
,,,,,,,,,,,947b-418f08d4a352
28-11-2023,15:30,28-11-2023,TESLA,US88160R1014,Valuta Debitering,1.1005,USD,-710.37,USD,0.00,81ac086b-8fab-4465-
,,,,,,,,,,,a458-118e34009c9e
28-11-2023,15:30,28-11-2023,TESLA,US88160R1014,Valuta Creditering,,EUR,645.47,EUR,672.29,81ac086b-8fab-4465-a458-118e34009c9e
28-11-2023,15:30,28-11-2023,TESLA,US88160R1014,DEGIRO Transactiekosten en/of kosten van derden,,EUR,-2.00,EUR,26.82,81ac086b-8fab-4465-a458-118e34009c9e
28-11-2023,15:30,28-11-2023,TESLA,US88160R1014,"Verkoop 3 @ 236,79 USD",,USD,710.37,USD,710.37,81ac086b-8fab-4465-a458-118e34009c9e
24-03-2020,13:10,24-03-2020,VANGUARD FTSE ALL-WORLD UCITS ETF,IE00B3RBWM25,DEGIRO Transactiekosten en/of kosten van derden,,EUR,-0.26,EUR,,810d6e1d-af8e-43a4-830e-0b85bf90c818
24-03-2020,13:10,24-03-2020,VANGUARD FTSE ALL-WORLD UCITS ETF,IE00B3RBWM25,DEGIRO Transactiekosten en/of kosten van derden,,EUR,-2.00,EUR,,810d6e1d-af8e-43a4-830e-0b85bf90c818
24-03-2020,13:10,24-03-2020,VANGUARD FTSE ALL-WORLD UCITS ETF,IE00B3RBWM25,DEGIRO Transactiekosten en/of kosten van derden,,EUR,-0.02,EUR,,810d6e1d-af8e-43a4-830e-0b85bf90c818
24-03-2020,13:10,24-03-2020,VANGUARD FTSE ALL-WORLD UCITS ETF,IE00B3RBWM25,"Verkoop 14 @ 61,7 EUR",,EUR,863.80,EUR,,810d6e1d-af8e-43a4-830e-0b85bf90c818
24-03-2020,13:10,24-03-2020,VANGUARD FTSE ALL-WORLD UCITS ETF,IE00B3RBWM25,"Verkoop 1 @ 61,7 EUR",,EUR,61.70,EUR,,810d6e1d-af8e-43a4-830e-0b85bf90c818
30-12-2024,07:44,27-12-2024,ISHARES CHINA LARGE CAP UCITS ETF USD,IE00B02KXK85,Dividend,,USD,1.10,USD,15.30,
01-02-2022,09:56,01-02-2022,ISHARES CHINA LARGE CAP UCITS ETF USD,IE00B02KXK85,"Koop 2 @ 96,22 EUR",,EUR,-192.44,EUR,,b2a1b368-491d-4fad-81ba-460c7f6839cf
03-01-2022,08:21,31-12-2021,ISHARES CHINA LARGE CAP UCITS ETF USD,IE00B02KXK85,Dividend,,USD,1.22,USD,1.22,
01-06-2021,11:03,01-06-2021,ISHARES CHINA LARGE CAP UCITS ETF USD,IE00B02KXK85,"Koop 1 @ 111,11 EUR",,EUR,-111.11,EUR,,1ee86f48-4a0a-4fd2-9d32-98aee813217f
06-10-2022,10:13,06-10-2022,ETC ISSUANCE GMBH,DE000A3G01J0,WIJZIGING ISIN: Koop 12 @ 0 EUR,,EUR,0.00,EUR,
06-10-2022,08:16,14-09-2022,ETC ISSUANCE ETHETC - PHYSICAL,DE000A3G01J0,SPIN-OFF: Koop 12 @ 0 EUR,,EUR,0.00,EUR,
05-10-2022,15:43,14-09-2022,ETC ISSUANCE ETHETC - PHYSICAL,DE000A3G01J0,CLAIMEMISSIE: Verkoop 12 @ 0 EUR,,EUR,0.00,EUR,
05-10-2022,11:09,14-09-2022,ETC ISSUANCE ETHETC - PHYSICAL,DE000A3G01J0,CLAIMEMISSIE: Koop 12 @ 0 EUR,,EUR,0.00,EUR
2 changes: 1 addition & 1 deletion src/converters/degiroConverterV3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe("degiroConverterV3", () => {
// Assert
expect(actualExport).toBeTruthy();
expect(actualExport.activities.length).toBeGreaterThan(0);
expect(actualExport.activities.length).toBe(26);
expect(actualExport.activities.length).toBe(43);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the tests are currently failing. V2 converter is missing 1 (as V2 and V3 tests are sharing the same input file for testing), and V3 only got 31 instead of expecting the 43 you put in the test. Can you take a look at this and make changes?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dickwolff I need help with tests:

  1. to update Yahoo Finance information. I think the instructions from the wiki are not complete. I got a missing import of a Mock object, which I didn't figure out how to import. Note that I'm a first-time user of Typescript
  2. How do I print debug statements (to stdout/stderr) in tests? I'm getting unexpected behavior, which I need to debug.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! Hope this helps:

  1. If you use an IDE like VSCode, you can to CTRL + . (dot) and then import all usings.
  2. In the tests, console statements are supressed. You can comment the whole beforeEach(() => { function, then you'll get the console log statements in your console. For debugging purposes I usually add console.log(...) statements on places that could help me debug.


done();
}, () => { done.fail("Should not have an error!"); });
Expand Down
Loading