summaryrefslogtreecommitdiffstats
path: root/src/journal.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/journal.rs41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/journal.rs b/src/journal.rs
new file mode 100644
index 0000000..d608bd0
--- /dev/null
+++ b/src/journal.rs
@@ -0,0 +1,41 @@
+#[allow(dead_code)]
+pub struct Commodity {
+ name: String,
+}
+
+#[allow(dead_code)]
+pub struct Account {
+ name: String,
+ commodity: Commodity,
+}
+
+#[allow(dead_code)]
+pub struct Posting {
+ account: Account,
+ amount: i64,
+ commodity: Commodity,
+}
+
+#[allow(dead_code)]
+pub struct Transaction {
+ text: String,
+ payee: String,
+ postings: Vec<Posting>,
+}
+
+#[allow(dead_code)]
+pub struct Journal {
+ pub commodities: Vec<Commodity>,
+ pub accounts: Vec<Account>,
+ pub transactions: Vec<Transaction>,
+}
+
+
+
+impl Commodity {
+ fn new(name: &str) -> Commodity {
+ Commodity {
+ name: name.to_string()
+ }
+ }
+}