Skip to content

Commit

Permalink
Handle "journal entry" account activities better
Browse files Browse the repository at this point in the history
Apparently "journal entry" type account activities represent random
credit or debit operations that are not user initiated deposits or
similar.
With this change we add the necessary logic to the
format_activity_type() to treat these entries correctly instead of
panicking.
  • Loading branch information
d-e-s-o committed Jan 17, 2024
1 parent 3da82d8 commit c7c89e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Unreleased
----------
- Added support for "journal entry" type account activities
- Bumped `apca` dependency to `0.28.0`


Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ fn format_activity_type(side: account_activities::ActivityType) -> &'static str
account_activities::ActivityType::Interest => "interest",
account_activities::ActivityType::InterestAdjustedNraWithheld
| account_activities::ActivityType::InterestAdjustedTefraWithheld => "interested adjusted",
account_activities::ActivityType::JournalEntry
| account_activities::ActivityType::JournalEntryCash
| account_activities::ActivityType::JournalEntryStock => unimplemented!(),
account_activities::ActivityType::JournalEntry => "credit/debit",
account_activities::ActivityType::JournalEntryCash => "cash credit/debit",
account_activities::ActivityType::JournalEntryStock => "stock credit/debit",
account_activities::ActivityType::Acquisition => "acquisition",
account_activities::ActivityType::NameChange => "name change",
account_activities::ActivityType::OptionAssignment => "option assigned",
Expand Down

0 comments on commit c7c89e0

Please sign in to comment.