summaryrefslogtreecommitdiffstats
path: root/src/journal.rs
blob: d608bd0ebfbcea2874c321bfc324c8a96201a1ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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()
        }
    }
}