aboutsummaryrefslogtreecommitdiff
path: root/src/app/store
diff options
context:
space:
mode:
authorKevin Hoerr <kjhoerr@submelon.dev>2026-04-21 14:15:31 -0400
committerKevin Hoerr <kjhoerr@submelon.dev>2026-04-21 14:15:31 -0400
commit1bde32bfbd798dbeb7acff0ad1f139515f17271e (patch)
tree305b4b9caafdfb51c70b3e8ee2e4ed60fc84b6f2 /src/app/store
parentdc277f7c68883208a645e36160b16309e6aa1196 (diff)
downloadequity-tracker-1bde32bfbd798dbeb7acff0ad1f139515f17271e.tar.gz
equity-tracker-1bde32bfbd798dbeb7acff0ad1f139515f17271e.tar.bz2
equity-tracker-1bde32bfbd798dbeb7acff0ad1f139515f17271e.zip
records.rs: Add display tests for enums, and field comments
Diffstat (limited to 'src/app/store')
-rw-r--r--src/app/store/records.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/app/store/records.rs b/src/app/store/records.rs
index 3357a02..e7f30d2 100644
--- a/src/app/store/records.rs
+++ b/src/app/store/records.rs
@@ -10,10 +10,15 @@ type DateTime = chrono::DateTime<chrono::Utc>;
/// Represents an account that holds equity. An account may hold equity with
/// multiple equity symbols.
pub struct FiduciaryAccount {
+ /// The internal ID of the fiduciary account
pub fiduciary_account_id: u8,
+ /// The account number as defined by the fiduciary holder
pub fiduciary_account_number: usize,
+ /// Representative name of the fiduciary account
pub fiduciary_account_name: String,
+ /// A description of the fiduciary account
pub fiduciary_account_description: String,
+ /// Estimated created date and time of the fiduciary account (does not need to be historically accurate, can be seeded from initial transaction recorded; is used relationally)
pub fiduciary_account_created_timestamp: DateTime,
}
@@ -39,10 +44,15 @@ impl std::fmt::Display for EquityType {
/// Represents a symbol used to ascribe speculative value
pub struct EquitySymbol {
+ /// The internal ID of the equity symbol
pub equity_symbol_id: usize,
+ /// The name of the equity symbol
pub equity_symbol_name: String,
+ /// The basic type of the symbol, for broader categorization
pub equity_symbol_type: EquityType,
+ /// The owning/managing company of the equity symbol
pub equity_symbol_managing_company: String,
+ /// Estimated created date and time of the equity symbol (does not need to be historically accurate, can be seeded from initial transaction recorded; is used relationally)
pub equity_symbol_created_timestamp: DateTime,
}
@@ -123,6 +133,19 @@ mod tests {
}
#[test]
+ fn equity_type_display() {
+ assert_eq!(EquityType::STOCK.to_string(), "STOCK");
+ assert_eq!(EquityType::ETF.to_string(), "ETF");
+ assert_eq!(EquityType::CRYPTO.to_string(), "CRYPTO");
+ }
+
+ #[test]
+ fn event_type_display() {
+ assert_eq!(ChangeEventType::BUY.to_string(), "BUY");
+ assert_eq!(ChangeEventType::SELL.to_string(), "SELL");
+ }
+
+ #[test]
fn event_type_score_buy() {
let event_type = ChangeEventType::BUY;