diff --git a/src/domain/contact.rs b/src/domain/contact.rs new file mode 100644 index 0000000..27fb1d4 --- /dev/null +++ b/src/domain/contact.rs @@ -0,0 +1,19 @@ +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, + pub first_name: String, + pub last_name: String, + pub credential: String, + pub message: String, + pub time_created: DateTime, +} +impl Contact { + pub fn new(first_name: String, last_name: String, credential: String, message: String,) -> Self { + Self { id: -1, first_name, last_name, credential, message, time_created: Utc::now() } + } +} \ No newline at end of file diff --git a/src/domain/mod.rs b/src/domain/mod.rs index 0f09b53..25db7dd 100644 --- a/src/domain/mod.rs +++ b/src/domain/mod.rs @@ -10,4 +10,5 @@ pub mod project_state; pub mod project_type; pub mod unit; pub mod unit_type; -pub mod visit; \ No newline at end of file +pub mod visit; +pub mod contact; \ No newline at end of file