mask optionally part of the data
This commit is contained in:
@@ -13,7 +13,7 @@ package komp_ac.table_validation;
|
||||
//
|
||||
// Important split:
|
||||
// - limits / pattern / allowed_values / required are validation rules.
|
||||
// - mask is presentation and input-shaping metadata for clients.
|
||||
// - mask is presentation/input-shaping metadata plus an optional storage policy.
|
||||
|
||||
// Request validation rules for a table
|
||||
message GetTableValidationRequest {
|
||||
@@ -44,7 +44,7 @@ message FieldValidation {
|
||||
// Client-side hint that this field participates in external/asynchronous validation UI.
|
||||
bool external_validation_enabled = 13;
|
||||
|
||||
// Client-side display mask metadata. The server stores raw data without mask literals.
|
||||
// Client-side display mask metadata and persisted representation policy.
|
||||
DisplayMask mask = 3;
|
||||
|
||||
// Field must be provided / treated as required by clients and server enforcement layers.
|
||||
@@ -76,14 +76,18 @@ message CharacterLimits {
|
||||
CountMode countMode = 4; // defaults to CHARS if unspecified
|
||||
}
|
||||
|
||||
// Mask for pretty display only.
|
||||
//
|
||||
// This is not a validation rule by itself. It exists so clients can render and
|
||||
// navigate masked input while still storing raw values server-side.
|
||||
enum MaskStorageMode {
|
||||
MASK_STORAGE_MODE_RAW = 0;
|
||||
MASK_STORAGE_MODE_FORMATTED = 1;
|
||||
}
|
||||
|
||||
// Mask metadata used for rendering, input navigation, and optional persistence
|
||||
// of reached mask literals. Template placeholders are never persisted.
|
||||
message DisplayMask {
|
||||
string pattern = 1; // e.g., "(###) ###-####" or "####-##-##"
|
||||
string input_char = 2; // e.g., "#"
|
||||
optional string template_char = 3; // e.g., "_"
|
||||
optional MaskStorageMode storage_mode = 4; // absent/default means raw
|
||||
}
|
||||
|
||||
// Which positions a pattern rule applies to.
|
||||
|
||||
Reference in New Issue
Block a user