diff options
author | Joris | 2021-01-03 13:40:40 +0100 |
---|---|---|
committer | Joris | 2021-01-03 13:54:20 +0100 |
commit | 11052951b74b9ad4b6a9412ae490086235f9154b (patch) | |
tree | 64526ac926c1bf470ea113f6cac8a33158684e8d /src/model/payment.rs | |
parent | 371449b0e312a03162b78797b83dee9d81706669 (diff) | |
download | budget-11052951b74b9ad4b6a9412ae490086235f9154b.tar.gz budget-11052951b74b9ad4b6a9412ae490086235f9154b.tar.bz2 budget-11052951b74b9ad4b6a9412ae490086235f9154b.zip |
Rewrite in Rust
Diffstat (limited to 'src/model/payment.rs')
-rw-r--r-- | src/model/payment.rs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/model/payment.rs b/src/model/payment.rs new file mode 100644 index 0000000..5ce6bb9 --- /dev/null +++ b/src/model/payment.rs @@ -0,0 +1,53 @@ +use chrono::NaiveDate; +use serde::Serialize; + +use crate::model::frequency::Frequency; + +#[derive(Debug, sqlx::FromRow, Serialize)] +pub struct Table { + pub id: i64, + pub name: String, + pub cost: i64, + pub user: String, + pub category_name: String, + pub category_color: String, + pub date: String, + pub frequency: Frequency, +} + +#[derive(Debug, sqlx::FromRow, Serialize)] +pub struct Form { + pub id: i64, + pub name: String, + pub cost: i64, + pub user_id: i64, + pub category_id: i64, + pub date: String, + pub frequency: Frequency, +} + +#[derive(Debug, sqlx::FromRow, Serialize)] +pub struct Stat { + pub start_date: String, + pub cost: i64, + pub category_id: i64, +} + +#[derive(Debug)] +pub struct Create { + pub name: String, + pub cost: i64, + pub user_id: i64, + pub category_id: i64, + pub date: NaiveDate, + pub frequency: Frequency, +} + +#[derive(Debug)] +pub struct Update { + pub name: String, + pub cost: i64, + pub user_id: i64, + pub category_id: i64, + pub date: NaiveDate, +} |