fix: complete pallet reprint tracking build
Some checks failed
Desktop Release / Bootstrap updater signing key (push) Has been cancelled
Desktop Release / Windows x64 NSIS (push) Has been cancelled
Desktop Release / Linux x64 DEB + AppImage (push) Has been cancelled
Desktop Release / Publish public desktop release (push) Has been cancelled

This commit is contained in:
Admin 2026-09-25 21:02:25 +00:00
parent 4f2feeb1cc
commit 288ad0b3a5
3 changed files with 10 additions and 6 deletions

View File

@ -323,6 +323,7 @@ fn spool_folder_loop(
label: spool_dir.display().to_string(),
bytes: 0,
barcodes: vec![],
pallet_print: None,
captured_at: chrono::Utc::now().to_rfc3339(),
forwarded: false,
error: Some(format!("spool read failed: {error}")),

View File

@ -74,11 +74,14 @@ pub fn parse_pallet_snapshot(raw_text: &str, pallet_id: &str) -> PalletSnapshot
}
if snapshot.variety.is_none() {
snapshot.variety = capture(
&flat,
r"(?i)\bAvocados?\s*-\s*([A-Z][A-Z -]{1,20}?)(?=\s+(?:ORIGIN|Pallet|Grower|Pick|Pack|Time|Total)\b|$)",
1,
);
if let Ok(regex) = Regex::new(r"(?i)^\s*Avocados?\s*-\s*([A-Z][A-Z -]{1,20})\s*$") {
snapshot.variety = raw_text.lines().find_map(|line| {
regex
.captures(line)
.and_then(|captures| captures.get(1))
.and_then(|value| clean(value.as_str()))
});
}
}
if let Ok(regex) = Regex::new(

View File

@ -199,7 +199,7 @@ impl SharedState {
id: uuid::Uuid::new_v4().to_string(),
raw_value,
format,
duplicate: !matches!(comparison.status, PalletPrintStatus::NewPallet),
duplicate: comparison.status != PalletPrintStatus::NewPallet,
captured_at: chrono::Utc::now().to_rfc3339(),
source: "print".into(),
source_metadata: json!({