Archive
This commit is contained in:
1 parent
206997510c
commit
251bd3e65f
14 files changed
+836
No files matched your search
@@ -0,0 +1,50 @@
|
||||
classDiagram
|
||||
class TodoItem {
|
||||
-int id
|
||||
-str title
|
||||
-str description
|
||||
-str due_date
|
||||
-bool completed
|
||||
-str created_at
|
||||
+__init__(id: int, title: str, description: str = "", due_date: str = "", completed: bool = False, created_at: str = "")
|
||||
+to_dict() dict
|
||||
+from_dict(data: dict) TodoItem
|
||||
}
|
||||
class Storage {
|
||||
-str file_path
|
||||
+__init__(file_path: str)
|
||||
+load() list[dict]
|
||||
+save(data: list[dict]) None
|
||||
}
|
||||
class TodoManager {
|
||||
-list[TodoItem] items
|
||||
-Storage storage
|
||||
-int next_id
|
||||
+__init__(storage: Storage)
|
||||
+add(title: str, description: str = "", due_date: str = "") TodoItem
|
||||
+list_all() list[TodoItem]
|
||||
+list_by_status(completed: bool) list[TodoItem]
|
||||
+mark_done(item_id: int) bool
|
||||
+mark_undone(item_id: int) bool
|
||||
+delete(item_id: int) bool
|
||||
+edit(item_id: int, title: str = None, description: str = None, due_date: str = None, completed: bool = None) bool
|
||||
+_load() None
|
||||
+_save() None
|
||||
+_find_by_id(item_id: int) TodoItem | None
|
||||
}
|
||||
class TodoCLI {
|
||||
-TodoManager manager
|
||||
-argparse.ArgumentParser parser
|
||||
+__init__(manager: TodoManager)
|
||||
+run(args: list[str] = None) None
|
||||
+_setup_parser() None
|
||||
+_handle_add(args) None
|
||||
+_handle_list(args) None
|
||||
+_handle_done(args) None
|
||||
+_handle_delete(args) None
|
||||
+_handle_edit(args) None
|
||||
}
|
||||
TodoCLI --> TodoManager
|
||||
TodoManager --> Storage
|
||||
TodoManager --> TodoItem
|
||||
Storage ..> TodoItem : uses to_dict/from_dict
|
||||
Reference in new issue
Block a user