Added contact struct
This commit is contained in:
parent
6489265fe8
commit
d080ece9c1
19
src/domain/contact.rs
Normal file
19
src/domain/contact.rs
Normal 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() }
|
||||
}
|
||||
}
|
@ -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;
|
Loading…
Reference in New Issue
Block a user