diff --git a/integrationos-api/src/logic/common_enum.rs b/integrationos-api/src/logic/common_enum.rs index 9b4c2696..ea7f6e78 100644 --- a/integrationos-api/src/logic/common_enum.rs +++ b/integrationos-api/src/logic/common_enum.rs @@ -45,6 +45,7 @@ impl RequestExt for CreateRequest { id: self.id.unwrap_or_else(|| Id::now(IdPrefix::CommonEnum)), name: self.name.clone(), options: self.options.clone(), + record_metadata: Default::default(), }; Some(record) } diff --git a/integrationos-api/src/logic/schema_generator.rs b/integrationos-api/src/logic/schema_generator.rs index 339564ae..258fd02c 100644 --- a/integrationos-api/src/logic/schema_generator.rs +++ b/integrationos-api/src/logic/schema_generator.rs @@ -130,6 +130,7 @@ async fn generate_all_types( id: Id::now(IdPrefix::CommonEnum), name: e.name.pascal_case(), options: options.unwrap_or_default(), + record_metadata: Default::default(), }), _ => None, }), diff --git a/integrationos-domain/src/domain/schema/common_model.rs b/integrationos-domain/src/domain/schema/common_model.rs index 6325e0bb..66665971 100644 --- a/integrationos-domain/src/domain/schema/common_model.rs +++ b/integrationos-domain/src/domain/schema/common_model.rs @@ -173,6 +173,8 @@ pub struct CommonEnum { pub id: Id, pub name: String, pub options: Vec, + #[serde(flatten, default)] + pub record_metadata: RecordMetadata, } fn replace_reserved_keyword(name: &str, lang: Lang) -> String { @@ -1413,6 +1415,7 @@ impl CommonModel { id: Id::now(IdPrefix::CommonEnum), name: e.name.pascal_case(), options: options.unwrap_or_default(), + record_metadata: Default::default(), }), _ => None, }) @@ -1438,6 +1441,7 @@ impl CommonModel { id: Id::now(IdPrefix::CommonEnum), name: e.name.pascal_case(), options: options.unwrap_or_default(), + record_metadata: Default::default(), }), _ => None, }) diff --git a/integrationos-domain/src/domain/shared/record_metadata.rs b/integrationos-domain/src/domain/shared/record_metadata.rs index 9069e8f7..c1932ca0 100644 --- a/integrationos-domain/src/domain/shared/record_metadata.rs +++ b/integrationos-domain/src/domain/shared/record_metadata.rs @@ -3,7 +3,7 @@ use semver::Version; use serde::{Deserialize, Serialize}; use std::collections::BTreeMap; -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Hash)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd)] #[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[serde(rename_all = "camelCase", default)] pub struct RecordMetadata {