inventorylib/dto/
building_with_floors_response.rs

1use common::entity::DtoResp;
2use serde::{Deserialize, Serialize};
3
4use crate::dto::building_response::BuildingResponse;
5use crate::dto::floor_response::FloorResponse;
6
7
8#[derive(Serialize, Deserialize, Debug, Clone)]
9#[serde(rename_all = "camelCase")]
10pub struct BuildingWithFloorsResponse {
11    pub building: BuildingResponse,
12    #[serde(skip_serializing_if = "Option::is_none")]
13    pub floors: Option<Vec<FloorResponse>>,
14}
15
16impl DtoResp for BuildingWithFloorsResponse {}
17
18// impl CategoryWithFieldsResponse {
19//     pub fn from_category(c: Category, fs: Vec<Field>) -> CategoryWithFieldsResponse {
20//         CategoryWithFieldsResponse {
21//             id: Option::from(c.uuid),
22//             ver: c.ver,
23//             name: c.name,
24//             parent_id: c.parent_id,
25//             organization: c.organization,
26//             fields: Option::from(FieldResponse::from_field_list(fs)),
27//         }
28//     }
29// }