accounting/src/lib.rs

121 lines
2.1 KiB
Rust

// pub struct Asset {
// name: String,
// smallest_fraction: Option<f32>,
// asset_type: AssetType,
// // namespace?
// }
// pub enum AssetType {
// Currency(Currency),
// Security(Security),
// Commodity(Commodity),
// }
// pub struct Currency {
// // TODO
// code: String,
// symbol: Option<String>,
// smallest_fraction: Option<f32>,
// }
// pub struct Commodity {
// symbol: String,
// }
// pub struct Security {
// symbol: String,
// code: Option<String>
// }
// struct Asset {
// name: Option<String>,
// symbol: String,
// short_symbol: Option<String>,
// smallest_fraction: Option<f32>,
// // namespace?
// }
// struct Quantity {}
pub mod core;
pub mod queries;
// pub mod parser;
// pub mod create_ledger;
pub mod document;
pub mod output;
mod parser;
// pub struct Account {
// // TODO
// // type?
// }
// pub fn add(left: usize, right: usize) -> usize {
// left + right
// }
// pub type Metadata = HashMap<String, String>; // TODO
// pub struct CommoditySymbol {
// symbol: String,
// is_prefix: bool,
// }
// pub struct Commodity {
// symbols: Vec<CommoditySymbol>,
// smallest_fraction: Option<f32>,
// // date?
// meta: Metadata,
// }
// pub struct Amount {
// // TODO
// }
// pub struct Cost {
// number: f32,
// currency: String,
// date: u32, // TODO
// label: Option<String>,
// }
// pub struct Flag {
// // TODO
// }
// pub struct Posting {
// account: String, // code?
// value: Amount,
// cost: Cost,
// is_cost_total: bool,
// price: Amount,
// flag: Option<Flag>,
// meta: Metadata,
// }
// pub struct Transaction {
// date: u32, // TODO
// flag: Flag,
// payee: Option<String>,
// narration: Option<String>,
// // tags/links?
// postings: Vec<Posting>,
// meta: Metadata,
// }
// #[cfg(test)]
// mod tests {
// use super::*;
// #[test]
// fn it_works() {
// let result = add(2, 2);
// assert_eq!(result, 4);
// }
// }
// fn test() {
// // let a = parse_directives("abc");
// }