validation2 I dont know if its correct???
This commit is contained in:
@@ -40,12 +40,16 @@ impl TableValidationService for TableValidationSvc {
|
||||
// Set the data_key from the database row
|
||||
fv.data_key = r.data_key;
|
||||
|
||||
// Skip if limits are all zero
|
||||
if let Some(lims) = &fv.limits {
|
||||
if lims.min == 0 && lims.max == 0 && lims.warn_at.is_none() {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// Keep entries that have either meaningful limits or a mask
|
||||
let has_meaningful_limits = fv
|
||||
.limits
|
||||
.as_ref()
|
||||
.map_or(false, |l| l.min > 0 || l.max > 0 || l.warn_at.is_some());
|
||||
let has_mask = fv.mask.is_some();
|
||||
if !has_meaningful_limits && !has_mask {
|
||||
continue;
|
||||
}
|
||||
|
||||
fields_out.push(fv);
|
||||
}
|
||||
Err(e) => {
|
||||
|
||||
Reference in New Issue
Block a user