Skip to content

Commit

Permalink
- Added UT for revolut robo advisor (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
jczaja authored Sep 1, 2024
1 parent 5919fb2 commit a140659
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 54 deletions.
9 changes: 9 additions & 0 deletions revolut_data/trading-pnl-statement_2024-01-robo.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Income from Sells
Date acquired,Date sold,Symbol,Security name,ISIN,Country,Quantity,Cost basis,Gross proceeds,Gross PnL,Currency

Other income & fees
Date,Symbol,Security name,ISIN,Country,Gross amount,Withholding tax,Net Amount,Currency
2024-06-04,QDVY,iShares Floating Rate Bond ETF (Dist),IE00BZ048462,IE,2.80,0.68 PLN,2.12 PLN,PLN
2024-06-20,EXI2,iShares Dow Jones Global Titans 50 ETF (Dist),DE0006289382,DE,0.34,0.08 PLN,0.26 PLN,PLN
2024-06-28,IS3K,iShares Short Duration High Yield Corporate Bond ETF (Dist),IE00BCRY6003,IE,3.79,0.94 PLN,2.85 PLN,PLN
2024-07-01,IBCD,iShares Corporate Bond ETF (Dist),IE0032895942,IE,01.07,0.25 PLN,0.82 PLN,PLN
66 changes: 12 additions & 54 deletions src/csvparser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1517,74 +1517,32 @@ mod tests {
fn test_parse_revolut_investment_gain_and_losses_dividends() -> Result<(), String> {
let expected_result = Ok((
vec![
(
"03/04/24".to_owned(),
crate::Currency::PLN(617.00),
crate::Currency::PLN(92.57),
),
(
"03/21/24".to_owned(),
crate::Currency::PLN(259.17),
crate::Currency::PLN(0.0),
),
(
"03/25/24".to_owned(),
crate::Currency::PLN(212.39),
crate::Currency::PLN(31.87),
),
(
"05/16/24".to_owned(),
crate::Currency::PLN(700.17),
crate::Currency::PLN(105.04),
),
(
"05/31/24".to_owned(),
crate::Currency::PLN(875.82),
crate::Currency::PLN(131.38),
),
(
"06/03/24".to_owned(),
crate::Currency::PLN(488.26),
crate::Currency::PLN(73.25),
),
(
"06/04/24".to_owned(),
crate::Currency::PLN(613.2),
crate::Currency::PLN(92.00),
),
(
"06/11/24".to_owned(),
crate::Currency::PLN(186.16),
crate::Currency::PLN(27.92),
),
(
"06/13/24".to_owned(),
crate::Currency::PLN(264.74),
crate::Currency::PLN(0.00),
crate::Currency::PLN(2.80),
crate::Currency::PLN(0.68),
),
(
"06/18/24".to_owned(),
crate::Currency::PLN(858.33),
crate::Currency::PLN(128.74),
"06/20/24".to_owned(),
crate::Currency::PLN(0.34),
crate::Currency::PLN(0.08),
),
(
"07/12/24".to_owned(),
crate::Currency::PLN(421.5),
crate::Currency::PLN(63.23),
"06/28/24".to_owned(),
crate::Currency::PLN(3.79),
crate::Currency::PLN(0.94),
),
(
"07/16/24".to_owned(),
crate::Currency::PLN(834.55),
crate::Currency::PLN(125.18),
"07/01/24".to_owned(),
crate::Currency::PLN(1.07),
crate::Currency::PLN(0.25),
),
],
vec![],
));

assert_eq!(
parse_revolut_transactions(
"revolut_data/trading-pnl-statement_2024-01-01_2024-08-04_pl-pl_8e8783.csv"
),
parse_revolut_transactions("revolut_data/trading-pnl-statement_2024-01-robo.csv"),
expected_result
);

Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ mod gui;
use etradeTaxReturnHelper::run_taxation;
use logging::ResultExt;

// TODO: Add revolut sold transactions settlement date when it is available in CSV documents
// TODO: Revolut sold tranasactions in EUR currency
// TODO: Add fees to revolut sold transactions when CSV contains such a data
// TODO: remove support for account statement of investment account of revolut
Expand Down

0 comments on commit a140659

Please sign in to comment.