adds data model
This commit is contained in:
parent
e862b43281
commit
79c739ad77
@ -1,28 +1,48 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
pub enum Status {
|
||||
// TODO: add fields (make sure the fields are public)
|
||||
Open,
|
||||
InProgress,
|
||||
Resolved,
|
||||
Closed,
|
||||
}
|
||||
|
||||
pub struct Epic {
|
||||
// TODO: add fields (make sure the fields are public)
|
||||
pub name: String,
|
||||
pub description: String,
|
||||
pub status: Status,
|
||||
pub stories: Vec<u32>,
|
||||
}
|
||||
|
||||
impl Epic {
|
||||
pub fn new(name: String, description: String) -> Self {
|
||||
todo!() // by default the status should be set to open and the stories should be an empty vector
|
||||
Self {
|
||||
name,
|
||||
description,
|
||||
status: Status::Open,
|
||||
stories: vec![]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Story {
|
||||
// TODO: add fields (make sure the fields are public)
|
||||
pub name: String,
|
||||
pub description: String,
|
||||
pub status: Status,
|
||||
}
|
||||
|
||||
impl Story {
|
||||
pub fn new(name: String, description: String) -> Self {
|
||||
todo!() // by default the status should be set to open
|
||||
Self {
|
||||
name,
|
||||
description,
|
||||
status: Status::Open,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct DBState {
|
||||
// This struct represents the entire db state which includes the last_item_id, epics, and stories
|
||||
// TODO: add fields (make sure the fields are public)
|
||||
}
|
||||
pub last_item_id: u32,
|
||||
pub epics: HashMap<u32, Epic>,
|
||||
pub stories: HashMap<u32, Story>,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user