Added contactPayload

This commit is contained in:
Franklin 2023-04-14 16:53:29 -04:00
parent 66ce2a6678
commit 9ca2b8ab85
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,18 @@
use serde::{Serialize, Deserialize};
use crate::domain::contact::Contact;
#[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct ContactPayload {
pub first_name: String,
pub last_name: String,
pub credential: String,
pub message: String,
}
impl From<ContactPayload> for Contact {
fn from(value: ContactPayload) -> Self {
Self::new(value.first_name, value.last_name, value.credential, value.message)
}
}

View File

@ -2,3 +2,4 @@ pub mod agent;
pub mod location;
pub mod project;
pub mod unit;
pub mod contact;