import { ModelsWarehouseBoxRates } from '../types/tariffs.types'; import { ModelsAcceptanceCoefficient } from '../types/orders-fbw.types'; /** * Input parameters for tariff comparison */ export interface CompareTariffsInput { /** Warehouse name to search for (supports partial matching) */ warehouseName: string; /** Date for the comparison (ISO format: YYYY-MM-DD) */ date: string; } /** * Tariff data from a single source */ export interface TariffData { /** Base delivery cost per liter */ deliveryBase: number; /** Delivery coefficient (percentage) */ deliveryCoef: number; /** Base storage cost per liter per day */ storageBase: number; /** Storage coefficient (percentage) */ storageCoef: number; /** Whether the warehouse was found in this API */ found: boolean; } /** * Percentage differences between inventory and supply tariffs */ export interface TariffDifference { /** Percentage difference in delivery base cost: (supply - inventory) / inventory * 100 */ deliveryBasePercent: number; /** Percentage difference in storage base cost: (supply - inventory) / inventory * 100 */ storageBasePercent: number; } /** * Recommendation based on tariff comparison */ export type TariffRecommendation = 'SUPPLY_CHEAPER' | 'INVENTORY_CHEAPER' | 'EQUAL'; /** * Complete tariff comparison result */ export interface TariffComparison { /** Warehouse name used for comparison */ warehouseName: string; /** Date used for comparison */ date: string; /** Tariff data from inventory storage API (tariffs/box) */ inventory: TariffData; /** Tariff data from supply API (acceptance/coefficients) */ supply: TariffData; /** Percentage differences between the two sources */ difference: TariffDifference; /** Recommendation based on which source has lower overall costs */ recommendation: TariffRecommendation; } /** * Compare tariffs between inventory storage (tariffs/box) and supply (acceptance/coefficients) APIs * * This utility fetches and compares tariff data from two different Wildberries APIs: * - tariffs/box (common-api): Inventory storage tariffs * - acceptance/coefficients (supplies-api): Supply acceptance tariffs * * The comparison helps sellers decide which fulfillment option is more cost-effective. * * @param input - Comparison parameters (warehouseName, date) * @param getBoxTariffs - Function to fetch box tariffs from API * @param getAcceptanceCoefficients - Function to fetch acceptance coefficients from API * @returns Comprehensive tariff comparison result * @throws Error if warehouse not found in both APIs * * @example * ```typescript * const result = await compareTariffs( * { warehouseName: 'Коледино', date: '2025-01-25' }, * () => sdk.tariffs.getBoxTariffs(), * () => sdk.ordersFBW.getAcceptanceCoefficients() * ); * * if (result.recommendation === 'SUPPLY_CHEAPER') { * console.log('Supply is more cost-effective'); * } * ``` */ export declare function compareTariffs(input: CompareTariffsInput, getBoxTariffs: () => Promise, getAcceptanceCoefficients: () => Promise): Promise; //# sourceMappingURL=compareTariffs.d.ts.map