import type { LocationStock, ProductStock } from "../types"; /** * Stock totals aggregated across all locations */ export interface StockTotals { totalStock: number; totalAllocated: number; totalAvailable: number; } /** * Stock threshold configuration for indicators */ export interface StockThresholds { low: number; medium: number; } /** * Maps raw stock response from EP API to LocationStock array * @param stockResponse Raw response from getStock API call * @param productId Product ID for the stock data * @returns Array of LocationStock objects */ export declare function mapStockResponseToLocationStock(stockResponse: any, productId: string): LocationStock[]; /** * Calculates total stock across all locations * @param locationStocks Array of LocationStock objects * @returns Aggregated stock totals */ export declare function calculateTotalStock(locationStocks: LocationStock[]): StockTotals; /** * Filters stock data by specific location IDs/slugs * @param stock ProductStock object containing all locations * @param locationIds Array of location IDs or slugs to filter by * @returns Filtered ProductStock object */ export declare function filterStockByLocation(stock: ProductStock, locationIds: string[]): ProductStock; /** * Finds available stock for a specific location * @param stock ProductStock object * @param locationSlug Location slug to find stock for * @returns Available stock amount, or total available if location not specified */ export declare function getAvailableStockForLocation(stock: ProductStock, locationSlug?: string): number; /** * Creates a ProductStock object from API response * @param productId Product ID * @param stockResponse Raw API response * @param locationIds Optional array of location IDs to filter by * @returns Complete ProductStock object */ export declare function createProductStock(productId: string, stockResponse: any, locationIds?: string[]): ProductStock; /** * Determines if stock is considered low based on threshold * @param stock Stock amount to check * @param threshold Low stock threshold * @returns True if stock is at or below threshold */ export declare function isLowStock(stock: number, threshold: number): boolean; /** * Determines if stock is out of stock * @param stock Stock amount to check * @returns True if stock is zero or negative */ export declare function isOutOfStock(stock: number): boolean; /** * Gets stock status based on thresholds * @param stock Stock amount * @param thresholds Stock threshold configuration * @returns Stock status indicator */ export declare function getStockStatus(stock: number, thresholds: StockThresholds): 'out-of-stock' | 'low' | 'medium' | 'high';