rule page in the validation client

This commit is contained in:
Priec
2026-05-10 09:23:33 +02:00
parent 17a13569d8
commit def75c00b4
9 changed files with 130 additions and 43 deletions

View File

@@ -68,6 +68,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
".komp_ac.table_validation.ValidationRuleDefinition",
"#[derive(serde::Serialize, serde::Deserialize)]",
)
.type_attribute(
".komp_ac.table_validation.ValidationSetRuleItem",
"#[derive(serde::Serialize, serde::Deserialize)]",
)
.type_attribute(
".komp_ac.table_validation.ValidationSetRuleItem.Source",
"#[derive(serde::Serialize, serde::Deserialize)]",
)
.type_attribute(
".komp_ac.table_validation.ValidationSetDefinition",
"#[derive(serde::Serialize, serde::Deserialize)]",

View File

@@ -219,6 +219,7 @@ message ReplaceTableValidationResponse {
}
message ValidationRuleDefinition {
optional int64 id = 4;
string name = 1;
optional string description = 2;
@@ -226,12 +227,28 @@ message ValidationRuleDefinition {
FieldValidation validation = 3;
}
message ValidationSetRuleItem {
int32 position = 1;
optional string name = 2;
optional string description = 3;
oneof source {
string global_rule_name = 10;
FieldValidation inline_validation = 11;
int64 global_rule_id = 12;
}
}
message ValidationSetDefinition {
reserved 3;
string name = 1;
optional string description = 2;
repeated string ruleNames = 3;
// Server-resolved snapshot of all rules in ruleNames order.
// Ordered set items.
repeated ValidationSetRuleItem ruleItems = 5;
// Server-resolved snapshot of all set items in order.
FieldValidation resolvedValidation = 4;
}

Binary file not shown.

View File

@@ -209,6 +209,8 @@ pub struct ReplaceTableValidationResponse {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidationRuleDefinition {
#[prost(int64, optional, tag = "4")]
pub id: ::core::option::Option<i64>,
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
@@ -219,14 +221,40 @@ pub struct ValidationRuleDefinition {
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidationSetRuleItem {
#[prost(int32, tag = "1")]
pub position: i32,
#[prost(string, optional, tag = "2")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(oneof = "validation_set_rule_item::Source", tags = "10, 11, 12")]
pub source: ::core::option::Option<validation_set_rule_item::Source>,
}
/// Nested message and enum types in `ValidationSetRuleItem`.
pub mod validation_set_rule_item {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Source {
#[prost(string, tag = "10")]
GlobalRuleName(::prost::alloc::string::String),
#[prost(message, tag = "11")]
InlineValidation(super::FieldValidation),
#[prost(int64, tag = "12")]
GlobalRuleId(i64),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ValidationSetDefinition {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "3")]
pub rule_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Server-resolved snapshot of all rules in ruleNames order.
/// Ordered set items.
#[prost(message, repeated, tag = "5")]
pub rule_items: ::prost::alloc::vec::Vec<ValidationSetRuleItem>,
/// Server-resolved snapshot of all set items in order.
#[prost(message, optional, tag = "4")]
pub resolved_validation: ::core::option::Option<FieldValidation>,
}