Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented date range for getting account transactions #61

Merged

Conversation

modersohn
Copy link
Collaborator

@modersohn modersohn commented Mar 5, 2022

  • workaround getting first/last block id in the timespan
  • then using Transaction_filter block_gte/lte
  • extended GetBlock
    • optional params for sorting instead of hardcoded
    • optional timestamp gte/lte
    • kept changes even though not used because GetBlockDate is
      more effective getting both block IDs in one go
    • also demonstrated building a json request and adding optional
      parameters to it, by using JObject and then
      request.AddStringBody
    • added tests
  • new GetBlockDateRange
    • returns both block IDs as a tuple
    • combined query using alias
    • added test with some hard-coded dates/IDs from the past
  • extended GetAccountTransactions
    • finished part where date range is given
    • calls GetBlockDateRange and then uses block_gte/lte
  • renamed/extended TimestampConverter
    • ToUTC for string and DateTime
    • ToTimeStamp for the otherway around
    • added minimal test-case with a roundtrip
  • CSV export
    • disabled CSV type as only one type supported right now
    • added work-in-progress warning
    • re-enabled date edits
    • TransactionExportService now raises exception if no transactions
      where found (exceptions are already handled by ExportDialog)
    • improved export of Transfer, comparing from/to with accountId of export
    • added Deposit, Withdrawal and TransferNFT

* workaround getting first/last block id in the timespan
* then using Transaction_filter block_gte/lte
* extended GetBlock
** optional params for sorting instead of hardcoded
** optional timestamp gte/lte
** kept changes even though not used because GetBlockDate is
   more effective getting both block IDs in one go
** also demonstrated building a json request and adding optional
   parameters to it, by using JObject and then
   request.AddStringBody
** added tests
* new GetBlockDateRange
** returns both block IDs as a tuple
** combined query using alias
** added test with some hard-coded dates/IDs from the past
* extended GetAccountTransactions
** finished part where date range is given
** calls GetBlockDateRange and then uses block_gte/lte
* renamed/extended TimestampConverter
** ToUTC for string and DateTime
** ToTimeStamp for the otherway around
** added minimal test-case with a roundtrip
* CSV export
** disabled CSV type as only one type supported right now
** added work-in-progress warning
** re-enabled date edits
** TransactionExportService now raises exception if no transactions
   where found (exceptions are already handled by ExportDialog)
* block ID range is now determined only once, not with every
  reqest to get more transactions
* refactored GetAccountTransactions, adapted tests
@modersohn modersohn requested a review from fudgebucket27 March 5, 2022 13:27
* added Deposit, Withdrawal and TransferNFT
* improved Transfer: checking from/toAccount for
  accountIdPerspective to determine if we received or removed
* accountIdPerspective must be compared to account.id not address
* since only date is entered, it should be fully inclusive
* fixed typo in DefaultCSVFormat class and file
* added registration mechanism
** no auto-registration built-in, so manually register in Program.cs
** dynamic format selection in ExportDialog
* refactored various CSV export aspects so new Cointracking can just
  descend from Default format
* added mechanism to modify download filename, so Cointracking can
  use .csv extension etc.
* Cointracking format has quick and dirty quotedString method, which
  should later be refactored into something generally usable
* for exporting use ToDecimal
** then convert to string without a format
** that always gives the best precision and no thousand
   delimiters
** consequently use GetExportAmount in one central place
* for display use ToString
** but generate format on the fly
** which has thousand separators and *optional* decimal places
** that is only possible via the #,##0.#### format
** so generate it with "token.decimals"
** but reduce for larger amounts, i.e. Log10 to retrieve exponent
* adjust tests - no longer enforcing unnecessary decimal places
* fix model: up until now double fields are never optional,
  so they shouldn't be here too
* I have not encountered a transaction where fillBA/B does not equal
  fillSB/A so I presume this is not necessary
* also rather risk it to be wrong than raise an exception, so we can
  eventually get better user feedback
@fudgebucket27
Copy link
Owner

fudgebucket27 commented Mar 13, 2022

hey mate finally had a chance to sit down and review. everything looks great and it passes the tests so i am happy with that too. i will merge this!

@fudgebucket27 fudgebucket27 merged commit 9362b46 into fudgebucket27:master Mar 13, 2022
@modersohn modersohn deleted the feature/TransactionCSVExport branch March 19, 2022 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants