monochromium 0.3.0

A fast, local-first CLI note-taking app for developers
use chrono::NaiveDateTime;
use clap::ValueEnum;
use std::fmt;

#[derive(ValueEnum, Clone, Debug)]
pub enum NoteTypes {
    Idea,
    CheckIn,
    Todo,
    Other,
}

impl NoteTypes {
    pub const fn as_str(&self) -> &'static str {
        match self {
            Self::Idea => "idea",
            Self::CheckIn => "check in",
            Self::Todo => "todo",
            Self::Other => "other",
        }
    }
}

impl fmt::Display for NoteTypes {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

#[derive(Debug, PartialEq)]
pub struct Note {
    pub id: u32,
    pub title: String,
    pub _note_type: String,
    pub date: NaiveDateTime,
    pub content: String,
}