-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
457: Add support for viainvest r=ChrisRBe a=AlexanderLill This adds support for parsing viainvest account statements. Withdrawals are currently not supported, only deposits and interest payments. Currently I can't get the tests to run on my environment. `@ChrisRBe` is there a commandline command to run all tests? Edit: I just saw that also there are formatting issues, is there a command to run this locally or a nice way to show how the formatting should look like? :) Co-authored-by: Alexander Lill <[email protected]>
- Loading branch information
Showing
8 changed files
with
146 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
type_regex: !!map | ||
deposit: "(Amount of funds deposited)" | ||
withdraw: "" | ||
interest: "(Amount of interest payment received)" | ||
ignorable_entry: "(Amount invested in loan)|(Amount of principal repayment received)" | ||
|
||
csv_fieldnames: | ||
booking_date: 'Value date' | ||
booking_date_format: '%m/%d/%Y' | ||
booking_details: 'Loan ID' | ||
booking_id: 'Loan ID' | ||
booking_type: 'Transaction type' | ||
booking_value: 'Credit (€)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Unit test for the p2p statement class | ||
Copyright 2021-12-12 AlexanderLill | ||
""" | ||
import unittest | ||
|
||
from Statement import Statement | ||
|
||
|
||
class TestStatement(unittest.TestCase): | ||
"""Test case implementation for Statement""" | ||
|
||
def test_value_parsing(self): | ||
"""test parsing of amount value""" | ||
|
||
test_data = [ | ||
("1.2", 1.2), | ||
("1,1", 1.1), | ||
("1.000,30", 1000.3), | ||
("1,000.30", 1000.3), | ||
("1000.30", 1000.3), | ||
] | ||
|
||
for item in test_data: | ||
test_input = item[0] | ||
expected_output = item[1] | ||
self.assertEqual(expected_output, Statement._parse_value(test_input)) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Transaction date;Value date;Transaction type;Country;Loan ID;Loan Type;Credit (€);Debit (€) | ||
12/13/2020;12/13/2020;Amount of funds deposited;;;;1.000,00; | ||
12/13/2020;12/13/2020;Amount invested in loan;PL;05-3248349;Short-term loan;;10,00 | ||
12/14/2020;12/14/2020;Amount of principal repayment received;LV;04-1246342;Credit line;0,24; | ||
12/14/2020;12/14/2020;Amount of interest payment received;LV;04-1246342;Credit line;0,10; | ||
12/14/2020;12/14/2020;Amount of principal repayment received;PL;05-3233341;Short-term loan;10,00; | ||
12/14/2020;12/14/2020;Amount of interest payment received;PL;05-3233341;Short-term loan;0,09; |