serialization and gitignore in canvas

This commit is contained in:
Priec
2025-12-18 20:04:03 +01:00
parent 7f7ebd3ad6
commit 1cedd58708
4 changed files with 60 additions and 2 deletions

2
canvas

Submodule canvas updated: 29fdc5a6c7...6f1cda36d8

View File

@@ -20,6 +20,18 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
".komp_ac.table_validation.TableValidationResponse",
"#[derive(serde::Serialize, serde::Deserialize)]",
)
.type_attribute(
".komp_ac.table_validation.PatternRule",
"#[derive(serde::Serialize, serde::Deserialize)]",
)
.type_attribute(
".komp_ac.table_validation.PatternRules",
"#[derive(serde::Serialize, serde::Deserialize)]",
)
.type_attribute(
".komp_ac.table_validation.CustomFormatter",
"#[derive(serde::Serialize, serde::Deserialize)]",
)
.type_attribute(
".komp_ac.table_validation.UpdateFieldValidationRequest",
"#[derive(serde::Serialize, serde::Deserialize)]",

Binary file not shown.

View File

@@ -26,7 +26,13 @@ pub struct FieldValidation {
#[prost(message, optional, tag = "10")]
pub limits: ::core::option::Option<CharacterLimits>,
/// Future expansion:
/// PatternRules pattern = 11;
///
/// Validation 2
#[prost(message, optional, tag = "11")]
pub pattern: ::core::option::Option<PatternRules>,
/// Validation 4 custom formatting logic
#[prost(message, optional, tag = "14")]
pub formatter: ::core::option::Option<CustomFormatter>,
#[prost(message, optional, tag = "3")]
pub mask: ::core::option::Option<DisplayMask>,
/// ExternalValidation external = 13;
@@ -65,6 +71,46 @@ pub struct DisplayMask {
#[prost(string, optional, tag = "3")]
pub template_char: ::core::option::Option<::prost::alloc::string::String>,
}
/// One positionbased validation rule, similar to CharacterFilter + PositionRange
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PatternRule {
/// Range descriptor: how far the rule applies
/// Examples:
/// - "0" → Single position 0
/// - "0-3" → Range 0..3 inclusive
/// - "from:5" → From position 5 onward
/// - "0,2,5" → Multiple discrete positions
#[prost(string, tag = "1")]
pub range: ::prost::alloc::string::String,
/// Character filter type, caseinsensitive keywords:
/// "ALPHABETIC", "NUMERIC", "ALPHANUMERIC",
/// "ONEOF(<chars>)", "EXACT(:)", "CUSTOM(<name>)"
#[prost(string, tag = "2")]
pub filter: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CustomFormatter {
/// Formatter type identifier; handled clientside.
/// Examples: "PSCFormatter", "PhoneFormatter", "CreditCardFormatter", "DateFormatter"
#[prost(string, tag = "1")]
pub r#type: ::prost::alloc::string::String,
/// Optional freetext note or parameters (e.g. locale, pattern)
#[prost(string, optional, tag = "2")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
/// Collection of pattern rules for one field
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PatternRules {
/// All rules that make up the validation logic
#[prost(message, repeated, tag = "1")]
pub rules: ::prost::alloc::vec::Vec<PatternRule>,
/// Optional humanreadable description for UI/debug purposes
#[prost(string, optional, tag = "2")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateFieldValidationRequest {