Skip to content

Commit

Permalink
chore: add deleted flag to common enum (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulkr authored Nov 13, 2024
1 parent 7774d58 commit 9284bba
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions integrationos-api/src/logic/common_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions integrationos-api/src/logic/schema_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
Expand Down
4 changes: 4 additions & 0 deletions integrationos-domain/src/domain/schema/common_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ pub struct CommonEnum {
pub id: Id,
pub name: String,
pub options: Vec<String>,
#[serde(flatten, default)]
pub record_metadata: RecordMetadata,
}

fn replace_reserved_keyword(name: &str, lang: Lang) -> String {
Expand Down Expand Up @@ -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,
})
Expand All @@ -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,
})
Expand Down
2 changes: 1 addition & 1 deletion integrationos-domain/src/domain/shared/record_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9284bba

Please sign in to comment.