koprogo_api/application/dto/
owner_dto.rs1use serde::{Deserialize, Serialize};
2use validator::Validate;
3
4#[derive(Debug, Deserialize, Validate, Clone)]
5pub struct CreateOwnerDto {
6 #[serde(default)]
7 pub organization_id: String,
8
9 #[validate(length(min = 1))]
10 pub first_name: String,
11
12 #[validate(length(min = 1))]
13 pub last_name: String,
14
15 #[validate(email)]
16 pub email: String,
17
18 pub phone: Option<String>,
19
20 #[validate(length(min = 1))]
21 pub address: String,
22
23 #[validate(length(min = 1))]
24 pub city: String,
25
26 #[validate(length(min = 1))]
27 pub postal_code: String,
28
29 #[validate(length(min = 1))]
30 pub country: String,
31}
32
33#[derive(Debug, Serialize)]
34pub struct OwnerResponseDto {
35 pub id: String,
36 pub organization_id: String,
37 pub user_id: Option<String>, pub first_name: String,
39 pub last_name: String,
40 pub email: String,
41 pub phone: Option<String>,
42 pub address: String,
43 pub city: String,
44 pub postal_code: String,
45 pub country: String,
46}