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"
|
repository = "https://github.com/franklinblanco/user-dtos.git"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
use serde::{Serialize, Deserialize};
|
use serde::{Serialize, Deserialize};
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub enum CredentialType {
|
pub enum CredentialType {
|
||||||
PhoneNumber,
|
PhoneNumber,
|
||||||
Email
|
Email
|
||||||
|
|
|
@ -2,7 +2,7 @@ use serde::{Serialize, Deserialize};
|
||||||
|
|
||||||
use crate::domain::user::credential_type::CredentialType;
|
use crate::domain::user::credential_type::CredentialType;
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct UserForCreationDto{
|
pub struct UserForCreationDto{
|
||||||
#[serde(default = "get_default_app")]
|
#[serde(default = "get_default_app")]
|
||||||
pub app: String,
|
pub app: String,
|
||||||
|
@ -12,8 +12,8 @@ pub struct UserForCreationDto{
|
||||||
pub password: String,
|
pub password: String,
|
||||||
pub name: String
|
pub name: String
|
||||||
}
|
}
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct UserForLoginDto{
|
pub struct UserForLoginDto {
|
||||||
#[serde(default = "get_default_app")]
|
#[serde(default = "get_default_app")]
|
||||||
pub app: String,
|
pub app: String,
|
||||||
pub credential: String,
|
pub credential: String,
|
||||||
|
@ -21,7 +21,7 @@ pub struct UserForLoginDto{
|
||||||
pub credential_type: CredentialType,
|
pub credential_type: CredentialType,
|
||||||
pub password: String
|
pub password: String
|
||||||
}
|
}
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
pub struct UserForAuthenticationDto{
|
pub struct UserForAuthenticationDto{
|
||||||
#[serde(default = "get_default_app")]
|
#[serde(default = "get_default_app")]
|
||||||
pub app: String,
|
pub app: String,
|
||||||
|
|
Loading…
Reference in New Issue