Files
PowderCoatingLogix/src/PowderCoating.Application/Interfaces/IInventoryAiLookupService.cs
T
spouliot 90a06c6acd 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>
2026-04-29 18:15:55 -04:00

44 lines
1.7 KiB
C#

namespace PowderCoating.Application.Interfaces;
public class InventoryAiLookupResult
{
public bool Success { get; set; }
public string? ErrorMessage { get; set; }
// Identity
public string? Manufacturer { get; set; }
public string? ManufacturerPartNumber { get; set; }
public string? ColorName { get; set; }
public string? ColorCode { get; set; }
public string? Description { get; set; }
// Coating specs
public string? Finish { get; set; }
public decimal? CureTemperatureF { get; set; }
public int? CureTimeMinutes { get; set; }
public string? ColorFamilies { get; set; } // comma-separated e.g. "Green,Blue"
public bool? RequiresClearCoat { get; set; }
// Application properties
public decimal? CoverageSqFtPerLb { get; set; } // typical ~80-120 sq ft/lb
public decimal? TransferEfficiency { get; set; } // typical 50-75%
public decimal? UnitCostPerLb { get; set; } // price per lb/unit if found in search results
public string? VendorName { get; set; } // manufacturer/vendor name for dropdown matching
public string? SpecPageUrl { get; set; } // URL of the product page that was fetched
public string? ImageUrl { get; set; } // og:image or first product image found on the page
public string? Reasoning { get; set; } // brief explanation of what was found
}
public interface IInventoryAiLookupService
{
/// <summary>
/// Search the web for powder coating product info and use AI to extract structured data.
/// </summary>
Task<InventoryAiLookupResult> LookupAsync(
string? manufacturer,
string? colorName,
string? colorCode,
string? partNumber);
}