Added contact struct

This commit is contained in:
Franklin 2023-04-14 16:36:40 -04:00
parent 6489265fe8
commit d080ece9c1
2 changed files with 21 additions and 1 deletions

19
src/domain/contact.rs Normal file
View File

@ -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<Utc>,
}
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() }
}
}

View File

@ -10,4 +10,5 @@ pub mod project_state;
pub mod project_type;
pub mod unit;
pub mod unit_type;
pub mod visit;
pub mod visit;
pub mod contact;