aboutsummaryrefslogtreecommitdiff
path: root/apps/cassiopeia/src/data.rs
diff options
context:
space:
mode:
Diffstat (limited to 'apps/cassiopeia/src/data.rs')
-rw-r--r--apps/cassiopeia/src/data.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/apps/cassiopeia/src/data.rs b/apps/cassiopeia/src/data.rs
new file mode 100644
index 000000000000..8ebc67f016c5
--- /dev/null
+++ b/apps/cassiopeia/src/data.rs
@@ -0,0 +1,29 @@
+//! Typed time file for cassiopeia
+//!
+//! This data gets generated by the `format` module, and can later be
+//! used to generate new files, and perform various lookups and
+//! analysis tasks.
+
+use crate::format::LineCfg;
+use chrono::{Date, DateTime, FixedOffset as Offset};
+use std::collections::BTreeMap;
+
+#[derive(Default)]
+pub struct TimeFile {
+ header: BTreeMap<String, String>,
+ sessions: Vec<Session>,
+ invoices: Vec<Date<Offset>>,
+}
+
+impl TimeFile {
+ pub(crate) fn append(self, line: LineCfg) -> Self {
+ println!("{:?}", line);
+
+ self
+ }
+}
+
+pub struct Session {
+ start: DateTime<Offset>,
+ stop: DateTime<Offset>,
+}