summaryrefslogtreecommitdiffstats
path: root/src/journal.rs
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2020-02-05 05:25:43 +0100
committerNao Pross <naopross@thearcway.org>2020-02-05 05:25:43 +0100
commit5ecfc36226e9d823ef4de16aca120964141be4b3 (patch)
tree2d43234e8697149eb796da84440cfae261dd4270 /src/journal.rs
downloadrlg-5ecfc36226e9d823ef4de16aca120964141be4b3.tar.gz
rlg-5ecfc36226e9d823ef4de16aca120964141be4b3.zip
Initial commit
Diffstat (limited to 'src/journal.rs')
-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()
+ }
+ }
+}