1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use crate::dto::building_response::BuildingResponse;
use crate::dto::floor_response::FloorResponse;


#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct BuildingWithFloorsResponse {
    pub building: BuildingResponse,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub floors: Option<Vec<FloorResponse>>,
}

// impl CategoryWithFieldsResponse {
//     pub fn from_category(c: Category, fs: Vec<Field>) -> CategoryWithFieldsResponse {
//         CategoryWithFieldsResponse {
//             id: Option::from(c.uuid),
//             ver: c.ver,
//             name: c.name,
//             parent_id: c.parent_id,
//             organization: c.organization,
//             fields: Option::from(FieldResponse::from_field_list(fs)),
//         }
//     }
// }