1use serde::Deserialize;
2use uuid::Uuid;
3
4use super::enums::{FormulaOutputType, Multiplicity};
5
6#[derive(Debug, Clone, Deserialize)]
8#[serde(rename_all = "camelCase")]
9pub struct Field {
10 pub id: i32,
11 pub app_id: i32,
12 pub name: Option<String>,
13 #[serde(rename = "type")]
14 pub field_type: Option<String>,
15 pub status: Option<String>,
16 pub is_required: bool,
17 pub is_unique: bool,
18 pub multiplicity: Option<Multiplicity>,
19 pub list_id: Option<i32>,
20 pub values: Option<Vec<ListFieldValue>>,
21 #[serde(rename = "outputType")]
22 pub output_type: Option<FormulaOutputType>,
23 pub referenced_app_id: Option<i32>,
24}
25
26#[derive(Debug, Clone, Deserialize)]
28#[serde(rename_all = "camelCase")]
29pub struct ListFieldValue {
30 pub id: Uuid,
31 pub name: String,
32 pub sort_order: i32,
33 pub numeric_value: Option<f64>,
34 pub color: Option<String>,
35}