summaryrefslogtreecommitdiff
path: root/src/model/task.rs
blob: e90dd8e5ccc603a24800e5ec39f8e4cf2e004624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use sqlx::FromRow;

#[derive(Debug, FromRow)]
pub struct Task {
    pub id: i64,
    pub group_id: i64,
    pub name: String,
    pub description: String,
}

impl Task {
    pub fn new(id: i64, group_id: i64, name: &str, description: &str) -> Task {
        Task {
            id, group_id,
            name: String::from(name),
            description: String::from(description),
        }
    }
}