dhojayev / traderepublic-portfolio-downloader

App that downloads transactions and PDF documents from Trade Republic depot
GNU General Public License v3.0
14 stars 0 forks source link

Implement writing TR card transactions into CSV file #36

Open dhojayev opened 3 months ago

dhojayev commented 3 months ago

After a discussion with @martinAtGitHub we agreed that we will add writing card transactions into CSV file. Whether it is a separate of the same CSV file is to be decided. Conversation is attached below for reference:

          > If that helps I can implement including those transactions optionally. But there are a few questions that would be good to clarify from the very beginning:
* Shall we include those transactions in the same csv file?
* If yes - shall we simply write them under the "credit" and "debit" columns?

I would take the option that causes the least effort for you.

Originally posted by @martinAtGitHub in https://github.com/dhojayev/traderepublic-portfolio-downloader/issues/27#issuecomment-2171112621

martinAtGitHub commented 1 month ago

is it possible, implementation has started but current state causes an exception? I'm using go 1.22.3 on linux. No output is created. Trace is

Jul 28 20:01:31.014 [PANI] could not fetch transactions: could not unmarshal timelineTransactions response: json: cannot unmarshal object into Go struct field TransactionResponse.items.subAmount of type string panic: (*logrus.Entry) 0xc0001a2310

goroutine 1 [running]: github.com/sirupsen/logrus.(Entry).log(0xc0001a2000, 0x0, {0xc00049e180, 0xb6}) /home/ms/go/pkg/mod/github.com/sirupsen/logrus@v1.9.3/entry.go:260 +0x491 github.com/sirupsen/logrus.(Entry).Log(0xc0001a2000, 0x0, {0xc00003de60?, 0xc0001ff200?, 0xc0002de2d0?}) /home/ms/go/pkg/mod/github.com/sirupsen/logrus@v1.9.3/entry.go:304 +0x48 github.com/sirupsen/logrus.(Logger).Log(0xc0001ff200, 0x0, {0xc00003de60, 0x1, 0x1}) /home/ms/go/pkg/mod/github.com/sirupsen/logrus@v1.9.3/logger.go:204 +0x58 github.com/sirupsen/logrus.(Logger).Panic(...) /home/ms/go/pkg/mod/github.com/sirupsen/logrus@v1.9.3/logger.go:253 main.main() /home/ms/traderepublic-portfolio-downloader/cmd/portfoliodownloader/public/main.go:44 +0x43b

dhojayev commented 1 month ago

Hi @martinAtGitHub! Is it possible that you are using outdated revision? This error was present a month or two ago, but was fixed already. If you are using the current revision of the main branch: please share the response written into the files to help me to debug.

martinAtGitHub commented 1 month ago

my intention is to run with the latest revision, what I did git pull make build-linux-amd64 ./bin/portfoliodownloader-linux-amd64

martinAtGitHub commented 1 month ago

I tried again, git pull said "Bereits aktuell." and I got the same error

Jul 30 15:17:44.734 [PANI] could not fetch transactions: could not unmarshal timelineTransactions response: json: cannot unmarshal object into Go struct field TransactionResponse.items.subAmount of type string panic: (*logrus.Entry) 0xc0001d80e0

goroutine 1 [running]: github.com/sirupsen/logrus.(Entry).log(0xc0001cc9a0, 0x0, {0xc00027e540, 0xb6}) /home/ms/go/pkg/mod/github.com/sirupsen/logrus@v1.9.3/entry.go:260 +0x491 github.com/sirupsen/logrus.(Entry).Log(0xc0001cc9a0, 0x0, {0xc00003de60?, 0xc00022f200?, 0xc0003620c0?}) /home/ms/go/pkg/mod/github.com/sirupsen/logrus@v1.9.3/entry.go:304 +0x48 github.com/sirupsen/logrus.(Logger).Log(0xc00022f200, 0x0, {0xc00003de60, 0x1, 0x1}) /home/ms/go/pkg/mod/github.com/sirupsen/logrus@v1.9.3/logger.go:204 +0x58 github.com/sirupsen/logrus.(Logger).Panic(...) /home/ms/go/pkg/mod/github.com/sirupsen/logrus@v1.9.3/logger.go:253 main.main() /home/ms/traderepublic-portfolio-downloader/cmd/portfoliodownloader/public/main.go:44 +0x43b

martinAtGitHub commented 1 month ago

I'm not an git expert. But "git pull origin main" tells "Bereits aktuell.", too. So I expect I'm using the latest revision. When executing no "transactions" file is created.

martinAtGitHub commented 1 month ago

On 13th July I successfully run the program (with the latest revision on that day).