Skip to content

Commit 6eb05e5

Browse files
committed
Fix handling of interest (new event type)
1 parent 2bf197c commit 6eb05e5

3 files changed

Lines changed: 128 additions & 1 deletion

File tree

pytr/event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ def from_dict(cls, event_dict: Dict[Any, Any]):
402402
gesamt_dict = item
403403
elif ititle == "Gebühr" and not fees_dict:
404404
fees_dict = item
405-
elif ititle == "Steuer" and not taxes_dict:
405+
elif ititle in ["Steuer", "Steuern"] and not taxes_dict:
406406
taxes_dict = item
407407
elif ititle in ["Vermögenswert", "Wertpapier", "Asset"] and not wertpapier_dict:
408408
wertpapier_dict = item

tests/events/zinsen2.json

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
{
2+
"id": "019fbb5c-1c9a-7ce5-86d0-ab2193a92104",
3+
"timestamp": "2026-08-01T03:26:43.866+0000",
4+
"title": "Zinsen",
5+
"icon": "logos/timeline_interest_new/v2",
6+
"avatar": {
7+
"asset": "logos/timeline_interest_new/v2",
8+
"badge": null
9+
},
10+
"badge": null,
11+
"subtitle": null,
12+
"amount": {
13+
"currency": "EUR",
14+
"value": 6.41,
15+
"fractionDigits": 2
16+
},
17+
"subAmount": null,
18+
"status": "EXECUTED",
19+
"action": {
20+
"type": "timelineDetail",
21+
"payload": "019fbb5c-1c9a-7ce5-86d0-ab2193a92104"
22+
},
23+
"cashAccountNumber": "123456789",
24+
"hidden": false,
25+
"deleted": false,
26+
"eventType": "INTEREST_PAYOUT",
27+
"source": "timelineTransaction",
28+
"details": {
29+
"id": "019fbb5c-1c9a-7ce5-86d0-ab2193a92104",
30+
"sections": [
31+
{
32+
"title": "Du hast 6,41 € erhalten",
33+
"data": {
34+
"icon": {
35+
"asset": "logos/timeline_interest_new/v2",
36+
"badge": null
37+
},
38+
"subtitleText": "1 Aug. · 07:12",
39+
"status": "executed"
40+
},
41+
"type": "header"
42+
},
43+
{
44+
"title": "Übersicht",
45+
"data": [
46+
{
47+
"title": "Zinsen",
48+
"detail": {
49+
"text": "Ausgeführt",
50+
"functionalStyle": "EXECUTED",
51+
"type": "status"
52+
},
53+
"style": "plain"
54+
},
55+
{
56+
"title": "Angesammelt",
57+
"detail": {
58+
"text": "8,86 €",
59+
"displayValue": {
60+
"text": "8,86 €",
61+
"textDataSensitivity": "PUBLIC"
62+
},
63+
"type": "text"
64+
},
65+
"style": "plain"
66+
},
67+
{
68+
"title": "Steuern",
69+
"detail": {
70+
"text": "2,45 €",
71+
"displayValue": {
72+
"text": "2,45 €",
73+
"textDataSensitivity": "PUBLIC"
74+
},
75+
"type": "text"
76+
},
77+
"style": "plain"
78+
},
79+
{
80+
"title": "Gesamt",
81+
"detail": {
82+
"text": "6,41 €",
83+
"displayValue": {
84+
"text": "6,41 €",
85+
"textDataSensitivity": "PUBLIC"
86+
},
87+
"type": "text"
88+
},
89+
"style": "plain"
90+
}
91+
],
92+
"type": "table"
93+
},
94+
{
95+
"title": "Dokumente",
96+
"data": [
97+
{
98+
"title": "Bescheinigung",
99+
"action": {
100+
"payload": "",
101+
"type": "authenticatedBrowserModal"
102+
},
103+
"id": "019fbb5c-1c9a-7ce5-86d0-ab2193a92104",
104+
"postboxType": ""
105+
}
106+
],
107+
"type": "documents"
108+
}
109+
]
110+
}
111+
}

tests/test_events.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2169,6 +2169,22 @@
21692169
}
21702170
],
21712171
},
2172+
{
2173+
"filename": "zinsen2.json",
2174+
"event_type": PPEventType.INTEREST,
2175+
"title": "Zinsen",
2176+
"value": 6.41,
2177+
"taxes": 2.45,
2178+
"transactions": [
2179+
{
2180+
"Datum": "2026-08-01T03:26:43",
2181+
"Typ": "Zinsen",
2182+
"Wert": 6.41,
2183+
"Notiz": "Zinsen",
2184+
"Steuern": 2.45,
2185+
}
2186+
],
2187+
},
21722188
{
21732189
"filename": "zusammenschluss.json",
21742190
"event_type": PPEventType.SWAP,

0 commit comments

Comments
 (0)