Added contactPayload
This commit is contained in:
parent
66ce2a6678
commit
9ca2b8ab85
18
src/dto/payloads/contact.rs
Normal file
18
src/dto/payloads/contact.rs
Normal 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)
|
||||
}
|
||||
}
|
@ -2,3 +2,4 @@ pub mod agent;
|
||||
pub mod location;
|
||||
pub mod project;
|
||||
pub mod unit;
|
||||
pub mod contact;
|
Loading…
Reference in New Issue
Block a user