feat: pass extracted image and image_processing metadata to item creation

- Updated confirmSingleItem() to include extractedImageBlob and imageProcessing
- Updated confirmAllItems() to pass image data for bulk item creation
- Each extracted item now carries its own image_processing metadata
- All items in bulk creation share the same extracted image blob
- Added 12 comprehensive tests verifying data is passed correctly
- All 465 frontend tests passing, zero regressions
This commit is contained in:
2026-04-21 19:27:17 +03:00
parent fab1e81cf6
commit 08fc785583
4 changed files with 297 additions and 57 deletions

View File

@@ -148,7 +148,10 @@ export function useAIExtraction(inventory: Item[], onComplete: (itemData: any) =
quantity: parseFloat(String(data.quantity || 1)),
min_quantity: 1.0,
box_label: data.box_label ? String(data.box_label) : null,
labels_data: JSON.stringify(data)
labels_data: JSON.stringify(data),
// Pass extracted image blob and image_processing metadata for auto-photo-save
extractedImageBlob,
imageProcessing: data.image_processing
};
onComplete(newItem);
@@ -186,7 +189,10 @@ export function useAIExtraction(inventory: Item[], onComplete: (itemData: any) =
quantity: parseFloat(String(data.quantity || 1)),
min_quantity: 1.0,
box_label: data.box_label ? String(data.box_label) : null,
labels_data: JSON.stringify(data)
labels_data: JSON.stringify(data),
// Pass extracted image blob and image_processing metadata for auto-photo-save
extractedImageBlob,
imageProcessing: data.image_processing
};
await onComplete(newItem);
}