Added derive impls to most objs
This commit is contained in:
parent
3b3ffde695
commit
6d2814e8ee
@ -9,7 +9,6 @@ readme = "README.md"
|
||||
repository = "https://github.com/franklinblanco/user-dtos.git"
|
||||
|
||||
[lib]
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::fmt::Display;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub enum CredentialType {
|
||||
PhoneNumber,
|
||||
Email
|
||||
|
@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize};
|
||||
|
||||
use crate::domain::user::credential_type::CredentialType;
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct UserForCreationDto{
|
||||
#[serde(default = "get_default_app")]
|
||||
pub app: String,
|
||||
@ -12,8 +12,8 @@ pub struct UserForCreationDto{
|
||||
pub password: String,
|
||||
pub name: String
|
||||
}
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct UserForLoginDto{
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct UserForLoginDto {
|
||||
#[serde(default = "get_default_app")]
|
||||
pub app: String,
|
||||
pub credential: String,
|
||||
@ -21,7 +21,7 @@ pub struct UserForLoginDto{
|
||||
pub credential_type: CredentialType,
|
||||
pub password: String
|
||||
}
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct UserForAuthenticationDto{
|
||||
#[serde(default = "get_default_app")]
|
||||
pub app: String,
|
||||
|
Loading…
Reference in New Issue
Block a user