Skip to content

Separate crypto, new consolidated test data, tsv file support#161

Merged
jczaja merged 5 commits intomainfrom
sfraczek/separate-crypto
Nov 16, 2025
Merged

Separate crypto, new consolidated test data, tsv file support#161
jczaja merged 5 commits intomainfrom
sfraczek/separate-crypto

Conversation

@sfraczek
Copy link
Copy Markdown
Collaborator

Separating crypto from stock sales and adding example consolidated statement for testing that contains crypto.

@sfraczek sfraczek added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Sep 13, 2025
@sfraczek sfraczek force-pushed the sfraczek/separate-crypto branch from 1c7f18b to eb4bb1e Compare September 13, 2025 09:05
@sfraczek sfraczek requested review from Copilot and jczaja November 4, 2025 21:51
@sfraczek sfraczek marked this pull request as ready for review November 4, 2025 21:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR separates crypto transactions from stock sales in the transaction accumulator and adds a new consolidated test fixture (TSV format) containing crypto transactions. The changes enable proper differentiation between stock and cryptocurrency investment data.

Key Changes:

  • Refactored TransactionAccumulator to separate stock and crypto transactions into distinct InvestmentTransactions structures
  • Updated parse_investment_transaction_dates to accept multiple candidate column names for flexible date parsing
  • Added support for TSV file format alongside CSV

Reviewed Changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/ecb.rs Removed debug println statement
src/csvparser.rs Restructured transaction accumulator to separate stock/crypto, added TSV support, enhanced date column flexibility, and added comprehensive test for consolidated crypto statements

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/csvparser.rs Outdated
@sfraczek sfraczek changed the title Separate crypto, new consolidated test data Separate crypto, new consolidated test data, tsv file support Nov 4, 2025
@sfraczek sfraczek force-pushed the sfraczek/separate-crypto branch from 33c4cd8 to 55e166c Compare November 5, 2025 22:18
@sfraczek sfraczek marked this pull request as draft November 10, 2025 08:32
@sfraczek sfraczek marked this pull request as ready for review November 10, 2025 08:46
@sfraczek sfraczek requested a review from Copilot November 10, 2025 08:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/csvparser.rs Outdated
Comment thread src/csvparser.rs
@sfraczek sfraczek marked this pull request as draft November 10, 2025 15:27
@sfraczek sfraczek force-pushed the sfraczek/separate-crypto branch 2 times, most recently from e87eeee to 468aff4 Compare November 10, 2025 15:55
@sfraczek sfraczek marked this pull request as ready for review November 10, 2025 15:56
@sfraczek sfraczek requested a review from Copilot November 10, 2025 15:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/csvparser.rs
Comment on lines +458 to +462
let original_delimiter: u8 = if csvtoparse.ends_with(".tsv") {
b'\t'
} else {
b','
};
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The delimiter detection based on file extension is fragile. Consider detecting the delimiter by analyzing the file content (e.g., counting occurrences of tabs vs commas in the first few lines) or accepting it as a parameter to make the function more robust.

Copilot uses AI. Check for mistakes.
Comment thread src/csvparser.rs Outdated
fn test_parse_revolut_transactions_consolidated_crypto_tsv() -> Result<(), String> {
// This test verifies that the consolidated TSV with crypto transactions
// is parsed and that crypto cost basis and gross proceeds are counted
// according to the summary present in the file (Wpływy brutto = 7,95$, Podstawa kosztowa = 0$).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use english language for comments

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@sfraczek sfraczek force-pushed the sfraczek/separate-crypto branch from 468aff4 to 27eb115 Compare November 15, 2025 17:07
@sfraczek sfraczek requested a review from jczaja November 15, 2025 17:08
@jczaja jczaja merged commit 5eaf207 into main Nov 16, 2025
7 checks passed
@sfraczek sfraczek deleted the sfraczek/separate-crypto branch December 13, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants