Added count to domian

This commit is contained in:
Franklin 2023-04-14 16:39:12 -04:00
parent d080ece9c1
commit 66ce2a6678
3 changed files with 10 additions and 2 deletions

View File

@ -2,7 +2,6 @@ use chrono::{DateTime, Utc};
use serde::{Serialize, Deserialize};
/// A unit of measurement to define a page load
#[derive(Serialize, Deserialize, Default, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct Contact {
pub id: i32,

8
src/domain/count.rs Normal file
View File

@ -0,0 +1,8 @@
use serde::{Serialize, Deserialize};
/// Used to retrieve count(*) from the database. The reason there's a need for this is sqlx::query_as macro requires a struct, not a primitive.
#[derive(Serialize, Deserialize, Default, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct Count {
pub count: Option<i64>
}

View File

@ -11,4 +11,5 @@ pub mod project_type;
pub mod unit;
pub mod unit_type;
pub mod visit;
pub mod contact;
pub mod contact;
pub mod count;