-
Notifications
You must be signed in to change notification settings - Fork 0
/
mydataclasses.py
174 lines (154 loc) · 4.36 KB
/
mydataclasses.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
from dataclasses import dataclass
from enum import Enum
from datetime import datetime
from decimal import Decimal
class StockAction(Enum):
TRANSFER = "transfer"
BUY = "buy"
SELL = "sell"
SPLIT = "split"
CANCEL_TRANSFER = "canceled_transfer"
@dataclass
class StockTransaction:
depot: str
transaction_id: str
isin: str
name: str
action: str
execution_date: datetime
valuation_date: datetime
count: Decimal
price: Decimal
curency: str
original: dict
def to_dict(self) -> dict:
return {
"depot": self.depot,
"transaction_id": self.transaction_id,
"isin": self.isin,
"name": self.name,
"action": self.action,
"execution_date": self.execution_date,
"valuation_date": self.valuation_date,
"count": self.count,
"price": self.price,
"curency": self.curency,
"original": self.original
}
class CCAction(Enum):
PAY = "pay"
PAY_INTL = "pay_intl"
BALANCING = "balancing"
DEPOSIT = "deposit"
@dataclass
class CCTransaction:
inputfile: str
index: int
cardnum: str
action: str
description: str
execution_date: datetime
valuation_date: datetime
value: Decimal
curency: str
foreign_value: Decimal
foreign_currency: str
original: dict
def to_dict(self) -> dict:
return {
"inputfile": self.inputfile,
"index": self.index,
"cardnum": self.cardnum,
"action": self.action,
"description": self.description,
"execution_date": self.execution_date,
"valuation_date": self.valuation_date,
"value": self.value,
"curency": self.curency,
"foreign_value": self.foreign_value,
"foreign_currency": self.foreign_currency,
"original": self.original
}
class GiroAction(Enum):
CC_BALANCING = "cc_balancing"
CLOSING = "closing"
DEBIT_CARD_PAY_INTL = "debitcard_intl"
DEBIT_CARD_PAY = "debitcard"
TRANSFER_IN = "transfer_in"
TRANSFER_OUT = "transfer_out"
@dataclass
class GiroTransaction:
inputfile: str
index: int
account: str
action: str
transaction_counterpart: str
transaction_account: str
transaction_bank: str
description: str
execution_date: datetime
valuation_date: datetime
value: Decimal
curency: str
foreign_value: Decimal
foreign_currency: str
original: dict
def to_dict(self) -> dict:
return {
"inputfile": self.inputfile,
"index": self.index,
"account": self.account,
"action": self.action,
"transaction_counterpart": self.transaction_counterpart,
"transaction_account": self.transaction_account,
"transaction_bank": self.transaction_bank,
"description": self.description,
"execution_date": self.execution_date,
"valuation_date": self.valuation_date,
"value": self.value,
"curency": self.curency,
"foreign_value": self.foreign_value,
"foreign_currency": self.foreign_currency,
"original": self.original
}
class WiseAction(Enum):
CONVERSION = "conversion"
TOP_UP = "top_up"
SEND = "send"
@dataclass
class WiseTransaction:
inputfile: str
currency: str
transaction_id: str
action: str
date: datetime
amount: Decimal
description: str
running_balance: Decimal
exfrom: str
exto: str
examount: Decimal
rate: Decimal
payee_name: str
payee_account: str
fees: Decimal
original: dict
def to_dict(self) -> dict:
return {
"inputfile": self.inputfile,
"currency": self.currency,
"transaction_id": self.transaction_id,
"action": self.action,
"date": self.date,
"amount": self.amount,
"description": self.description,
"running_balance": self.running_balance,
"exfrom": self.exfrom,
"exto": self.exto,
"examount": self.examount,
"rate": self.rate,
"payee_name": self.payee_name,
"payee_account": self.payee_account,
"fees": self.fees,
"original": self.original
}