From 9f6d480aeed79e2c4f87978580975c7a6b6e717c Mon Sep 17 00:00:00 2001 From: Priec Date: Fri, 21 Nov 2025 23:17:16 +0100 Subject: [PATCH] added validation2, NEXT DO GRPCURL TESTING OF THE VALIDATIONS --- common/proto/table_validation.proto | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/common/proto/table_validation.proto b/common/proto/table_validation.proto index f7ef833..417f9db 100644 --- a/common/proto/table_validation.proto +++ b/common/proto/table_validation.proto @@ -22,7 +22,7 @@ message FieldValidation { // Current: only CharacterLimits. More rules can be added later. CharacterLimits limits = 10; // Future expansion: - // PatternRules pattern = 11; + PatternRules pattern = 11; // Validation 2 DisplayMask mask = 3; // ExternalValidation external = 13; // CustomFormatter formatter = 14; @@ -57,6 +57,31 @@ message DisplayMask { optional string template_char = 3; // e.g., "_" } +// One position‑based validation rule, similar to CharacterFilter + PositionRange +message 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 + string range = 1; + + // Character filter type, case‑insensitive keywords: + // "ALPHABETIC", "NUMERIC", "ALPHANUMERIC", + // "ONEOF()", "EXACT(:)", "CUSTOM()" + string filter = 2; +} + +// Collection of pattern rules for one field +message PatternRules { + // All rules that make up the validation logic + repeated PatternRule rules = 1; + + // Optional human‑readable description for UI/debug purposes + optional string description = 2; +} + // Service to fetch validations for a table service TableValidationService { rpc GetTableValidation(GetTableValidationRequest)