UNPKG

autotrader-connect-api

Version:

Production-ready TypeScript wrapper for Auto Trader UK Connect APIs

178 lines 5.96 kB
/** * Stock management module for AutoTrader API * Handles stock-related endpoints and operations */ import { StockSearchParams, StockResponse, StockListResponse, CreateStockRequest, UpdateStockRequest, StockStatistics, BulkStockOperation, BulkOperationResponse } from '../types/stock'; /** * Search stock with various filters * @param params Search parameters and filters * @returns Promise resolving to paginated stock results */ export declare function searchStock(params?: StockSearchParams): Promise<StockListResponse>; /** * Get stock item by ID * @param stockId Stock item identifier * @returns Promise resolving to stock item data */ export declare function getStockById(stockId: string): Promise<StockResponse>; /** * Create new stock item * @param stockData Stock item data * @returns Promise resolving to created stock item */ export declare function createStock(stockData: CreateStockRequest): Promise<StockResponse>; /** * Update existing stock item * @param stockId Stock item identifier * @param updateData Updated stock data * @returns Promise resolving to updated stock item */ export declare function updateStock(stockId: string, updateData: UpdateStockRequest): Promise<StockResponse>; /** * Delete stock item * @param stockId Stock item identifier * @returns Promise resolving to deletion confirmation */ export declare function deleteStock(stockId: string): Promise<{ success: boolean; message: string; }>; /** * Get stock statistics and analytics * @param filters Optional filters to apply to statistics * @returns Promise resolving to stock statistics */ export declare function getStockStatistics(filters?: { siteId?: string; dateFrom?: string; dateTo?: string; make?: string; model?: string; }): Promise<StockStatistics>; /** * Bulk update stock items * @param operation Bulk operation details * @returns Promise resolving to operation results */ export declare function bulkUpdateStock(operation: BulkStockOperation): Promise<BulkOperationResponse>; /** * Publish stock items to AutoTrader * @param stockIds Array of stock IDs to publish * @returns Promise resolving to publish results */ export declare function publishStock(stockIds: string[]): Promise<BulkOperationResponse>; /** * Hide stock items from AutoTrader * @param stockIds Array of stock IDs to hide * @returns Promise resolving to hide results */ export declare function hideStock(stockIds: string[]): Promise<BulkOperationResponse>; /** * Mark stock items as sold * @param stockIds Array of stock IDs to mark as sold * @param soldDate Optional sold date (defaults to current date) * @returns Promise resolving to update results */ export declare function markStockAsSold(stockIds: string[], soldDate?: string): Promise<BulkOperationResponse>; /** * Reserve stock items * @param stockIds Array of stock IDs to reserve * @param reservedBy Who reserved the items * @param reservedUntil Reservation expiry date * @returns Promise resolving to reservation results */ export declare function reserveStock(stockIds: string[], reservedBy: string, reservedUntil: string): Promise<BulkOperationResponse>; /** * Release stock reservations * @param stockIds Array of stock IDs to release * @returns Promise resolving to release results */ export declare function releaseStockReservation(stockIds: string[]): Promise<BulkOperationResponse>; /** * Get stock performance metrics * @param stockId Stock item identifier * @returns Promise resolving to performance data */ export declare function getStockPerformance(stockId: string): Promise<{ metrics: { viewCount: number; enquiryCount: number; testDriveCount: number; daysInStock: number; averageViewsPerDay: number; enquiryConversionRate: number; }; ranking: { viewRank: number; enquiryRank: number; performanceScore: number; percentile: number; }; trends: { dailyViews: Array<{ date: string; views: number; }>; weeklyEnquiries: Array<{ week: string; enquiries: number; }>; }; recommendations: string[]; }>; /** * Get stock valuation * @param stockId Stock item identifier * @returns Promise resolving to valuation data */ export declare function getStockValuation(stockId: string): Promise<{ currentValuation: { tradeValue: number; retailValue: number; auctionValue: number; confidence: 'High' | 'Medium' | 'Low'; }; marketComparison: { averageMarketPrice: number; competitivePosition: number; priceRecommendation: { optimal: number; minimum: number; maximum: number; }; }; depreciationForecast: Array<{ months: number; estimatedValue: number; depreciation: number; depreciationRate: number; }>; }>; /** * Update stock pricing * @param stockId Stock item identifier * @param pricing New pricing information * @returns Promise resolving to updated stock item */ export declare function updateStockPricing(stockId: string, pricing: { retailPrice: number; tradePrice?: number; negotiable?: boolean; priceReduced?: boolean; previousPrice?: number; }): Promise<StockResponse>; /** * Add images to stock item * @param stockId Stock item identifier * @param imageUrls Array of image URLs to add * @returns Promise resolving to updated stock item */ export declare function addStockImages(stockId: string, imageUrls: string[]): Promise<StockResponse>; /** * Remove images from stock item * @param stockId Stock item identifier * @param imageIds Array of image IDs to remove * @returns Promise resolving to updated stock item */ export declare function removeStockImages(stockId: string, imageIds: string[]): Promise<StockResponse>; //# sourceMappingURL=stock.d.ts.map