Files
product_inventory/src/interfaces/IShop.ts
Ben Miller 7cb469ccf9 feat: enforce SKU validity, use SKU as handle
This commit enforces proper SKU validation, uses the SKU as the Shopify handle, and implements ID-based product updates to allow renaming. It also extracts the IShop interface for TDD.
2025-12-25 04:54:55 -07:00

14 lines
810 B
TypeScript

import * as shopify from "shopify-admin-api-typings";
import { Config } from "../config";
export interface IShop {
GetProductBySku(sku: string): any; // Return type is inferred as product node
GetProductById(id: string): any; // New method
GetInventoryItemBySku(sku: string): shopify.InventoryItem;
UpdateInventoryItemQuantity(item: shopify.InventoryItem, delta: number, config: Config): shopify.InventoryItem;
SetInventoryItemQuantity(item: shopify.InventoryItem, quantity: number, config: Config): any;
SetInventoryItemDefaults(item: shopify.InventoryItem, config: Config): shopify.InventoryItem;
SetInventoryItemWeight(item: shopify.InventoryItem, config: Config, weight: number, weight_unit: shopify.WeightUnit): shopify.InventoryItem;
shopifyGraphQLAPI(payload: any): any;
}