use crate::entities::common::Metadata;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Serialize, Deserialize)]
pub struct TemplateEntity {
pub api_version: Option<String>,
pub metadata: Metadata,
pub spec: TemplateSpec,
pub relations: Option<Vec<crate::entities::common::Relation>>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct TemplateSpec {
pub owner: String,
pub r#type: String,
pub parameters: Vec<Parameter>,
pub steps: Vec<Step>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Parameter {
pub title: String,
pub required: Vec<String>,
pub properties: HashMap<String, Property>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Property {
pub title: String,
pub r#type: String,
pub description: Option<String>,
pub ui_autofocus: Option<bool>,
pub ui_options: Option<HashMap<String, serde_json::Value>>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Step {
pub id: String,
pub name: String,
pub action: String,
pub input: HashMap<String, serde_json::Value>,
}