Add product image to powder inventory via AI lookup
When AI Lookup fetches a manufacturer product page, it now extracts the og:image (Open Graph) meta tag before stripping HTML tags. The image URL is returned in InventoryAiLookupResult.ImageUrl and automatically shown as a preview on the Create/Edit form alongside the other filled fields. The preview includes a Remove button to clear the image, and the Wrong Match? button clears it along with the other AI-filled fields. On the inventory Details page a product image card is rendered above the Stock & Pricing card whenever ImageUrl is set. The field is nullable so existing records and powders without an image are unaffected. New field: InventoryItem.ImageUrl (nvarchar, nullable). Migration: AddInventoryItemImageUrl. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,7 @@ public class InventoryItemDto
|
||||
public string? ColorFamilies { get; set; }
|
||||
public bool RequiresClearCoat { get; set; }
|
||||
public string? SpecPageUrl { get; set; }
|
||||
public string? ImageUrl { get; set; }
|
||||
public decimal QuantityOnHand { get; set; }
|
||||
public string UnitOfMeasure { get; set; } = "lbs";
|
||||
public decimal ReorderPoint { get; set; }
|
||||
@@ -144,6 +145,10 @@ public class CreateInventoryItemDto
|
||||
[Display(Name = "Product URL")]
|
||||
public string? SpecPageUrl { get; set; }
|
||||
|
||||
[StringLength(1000, ErrorMessage = "Image URL cannot exceed 1000 characters")]
|
||||
[Display(Name = "Product Image URL")]
|
||||
public string? ImageUrl { get; set; }
|
||||
|
||||
[Range(0, 999999999, ErrorMessage = "Quantity on hand must be 0 or greater")]
|
||||
[Display(Name = "Quantity on Hand")]
|
||||
public decimal QuantityOnHand { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user