Refactor supplier analysis and product handling
- Updated `SupplierAnalysisResult` to include a `product` field and modified related tests. - Refactored `addRowsSheet` to accommodate changes in the product structure. - Enhanced UPC file analysis to utilize a new `toSupplierInputRecord` function for cleaner record creation. - Introduced new types for supplier input records and product observations. - Updated frontend components to handle new product details and analysis history. - Improved database writing functions to streamline run completion and error handling. - Added new API endpoints for product details and adjusted routing in the frontend.
This commit is contained in:
@@ -20,6 +20,15 @@ test("parseCatalogUpcLookupResponse marks no match", () => {
|
||||
expect(detail.asin).toBeNull();
|
||||
});
|
||||
|
||||
test("parseCatalogUpcLookupResponse ignores invalid ASIN identifiers", () => {
|
||||
const detail = parseCatalogUpcLookupResponse("012345678901", {
|
||||
items: [{ asin: "012345678901" }],
|
||||
});
|
||||
|
||||
expect(detail.status).toBe("not_found");
|
||||
expect(detail.asin).toBeNull();
|
||||
});
|
||||
|
||||
test("parseCatalogUpcLookupResponse marks multiple ASINs", () => {
|
||||
const detail = parseCatalogUpcLookupResponse("012345678901", {
|
||||
payload: {
|
||||
|
||||
Reference in New Issue
Block a user