aboutsummaryrefslogtreecommitdiff
path: root/src/model/payment.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/payment.rs')
-rw-r--r--src/model/payment.rs53
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,
+}