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
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:
parent
4f2feeb1cc
commit
288ad0b3a5
@ -323,6 +323,7 @@ fn spool_folder_loop(
|
|||||||
label: spool_dir.display().to_string(),
|
label: spool_dir.display().to_string(),
|
||||||
bytes: 0,
|
bytes: 0,
|
||||||
barcodes: vec![],
|
barcodes: vec![],
|
||||||
|
pallet_print: None,
|
||||||
captured_at: chrono::Utc::now().to_rfc3339(),
|
captured_at: chrono::Utc::now().to_rfc3339(),
|
||||||
forwarded: false,
|
forwarded: false,
|
||||||
error: Some(format!("spool read failed: {error}")),
|
error: Some(format!("spool read failed: {error}")),
|
||||||
|
|||||||
@ -74,11 +74,14 @@ pub fn parse_pallet_snapshot(raw_text: &str, pallet_id: &str) -> PalletSnapshot
|
|||||||
}
|
}
|
||||||
|
|
||||||
if snapshot.variety.is_none() {
|
if snapshot.variety.is_none() {
|
||||||
snapshot.variety = capture(
|
if let Ok(regex) = Regex::new(r"(?i)^\s*Avocados?\s*-\s*([A-Z][A-Z -]{1,20})\s*$") {
|
||||||
&flat,
|
snapshot.variety = raw_text.lines().find_map(|line| {
|
||||||
r"(?i)\bAvocados?\s*-\s*([A-Z][A-Z -]{1,20}?)(?=\s+(?:ORIGIN|Pallet|Grower|Pick|Pack|Time|Total)\b|$)",
|
regex
|
||||||
1,
|
.captures(line)
|
||||||
);
|
.and_then(|captures| captures.get(1))
|
||||||
|
.and_then(|value| clean(value.as_str()))
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Ok(regex) = Regex::new(
|
if let Ok(regex) = Regex::new(
|
||||||
|
|||||||
@ -199,7 +199,7 @@ impl SharedState {
|
|||||||
id: uuid::Uuid::new_v4().to_string(),
|
id: uuid::Uuid::new_v4().to_string(),
|
||||||
raw_value,
|
raw_value,
|
||||||
format,
|
format,
|
||||||
duplicate: !matches!(comparison.status, PalletPrintStatus::NewPallet),
|
duplicate: comparison.status != PalletPrintStatus::NewPallet,
|
||||||
captured_at: chrono::Utc::now().to_rfc3339(),
|
captured_at: chrono::Utc::now().to_rfc3339(),
|
||||||
source: "print".into(),
|
source: "print".into(),
|
||||||
source_metadata: json!({
|
source_metadata: json!({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user