validation2 I dont know if its correct???

This commit is contained in:
Priec
2025-10-26 16:44:15 +01:00
parent 11185282c4
commit 8ec1fa1761
5 changed files with 45 additions and 13 deletions

View File

@@ -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) => {