This commit is contained in:
Alex Emmet 2026-04-30 13:49:22 +02:00
commit b6dba5fc88
4 changed files with 15 additions and 12 deletions

View file

@ -1,6 +1,7 @@
use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum ToDoStatus { pub enum ToDoStatus {
Pending, Pending,
InProgress, InProgress,
@ -38,7 +39,7 @@ impl std::str::FromStr for ToDoStatus {
} }
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum TaskStatus { pub enum TaskStatus {
Pending, Pending,
Running, Running,
@ -76,7 +77,7 @@ impl std::str::FromStr for TaskStatus {
} }
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum ModelType { pub enum ModelType {
Llm, Llm,
CodeGen, CodeGen,
@ -114,7 +115,7 @@ impl std::str::FromStr for ModelType {
} }
} }
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum DocType { pub enum DocType {
ApiDoc, ApiDoc,
Readme, Readme,
@ -135,7 +136,7 @@ impl fmt::Display for DocType {
} }
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum PromptType { pub enum PromptType {
Authority, Authority,
Confirm, Confirm,
@ -152,7 +153,7 @@ impl fmt::Display for PromptType {
} }
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum PromptOption { pub enum PromptOption {
Accept, Accept,
Deny, Deny,
@ -181,7 +182,7 @@ impl fmt::Display for PromptOption {
} }
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum TaskResultType { pub enum TaskResultType {
Success, Success,
Error, Error,

View file

@ -4,7 +4,7 @@ use uuid::Uuid;
pub type ProjectId = Uuid; pub type ProjectId = Uuid;
#[derive(Debug, Clone)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Project { pub struct Project {
pub id: ProjectId, pub id: ProjectId,
pub name: String, pub name: String,
@ -72,7 +72,7 @@ impl Project {
} }
} }
#[derive(Debug, Clone)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProjectFile { pub struct ProjectFile {
pub id: Uuid, pub id: Uuid,
pub path: String, pub path: String,

View file

@ -1,10 +1,11 @@
use chrono::{DateTime, Utc}; use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use uuid::Uuid; use uuid::Uuid;
use crate::enums::{TaskResultType, TaskStatus}; use crate::enums::{TaskResultType, TaskStatus};
use crate::todo::ToDo; use crate::todo::ToDo;
#[derive(Debug, Clone)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Task { pub struct Task {
pub id: Uuid, pub id: Uuid,
pub todo_id: Uuid, pub todo_id: Uuid,
@ -115,7 +116,7 @@ impl Task {
} }
} }
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum TaskResult { pub enum TaskResult {
Success(String), Success(String),
Error(String), Error(String),

View file

@ -1,4 +1,5 @@
use chrono::{DateTime, Utc}; use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use uuid::Uuid; use uuid::Uuid;
use crate::enums::ToDoStatus; use crate::enums::ToDoStatus;
@ -11,7 +12,7 @@ const MIN_PRIORITY: u32 = 1;
const MAX_PRIORITY: u32 = 1000; const MAX_PRIORITY: u32 = 1000;
const DEFAULT_PRIORITY: u32 = 100; const DEFAULT_PRIORITY: u32 = 100;
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ToDo { pub struct ToDo {
pub id: Uuid, pub id: Uuid,
pub title: String, pub title: String,