← back to Wine Finder Next
lib/types/wine.ts
65 lines
// Wine Data Types
export interface Wine {
id?: string;
name: string;
vintage?: string;
price: string | number;
rating?: number;
image?: string;
source: string;
url?: string;
badge?: 'new' | 'deal' | 'featured';
availability?: string;
winery?: string;
region?: string;
country?: string;
type?: string;
varietal?: string;
alcohol?: string;
description?: string;
reviews?: number;
priceHistory?: {
previousPrice?: string;
priceChange?: string;
};
affiliateData?: AffiliateData;
}
export interface AffiliateData {
partnerId: string;
partnerName: string;
affiliateUrl: string;
originalUrl: string;
commissionRate?: string;
trackingId?: string;
}
export interface PricePoint {
date: string;
price: number;
source: string;
}
export interface PriceHistory {
success: boolean;
wineName: string;
vintage?: string;
pricePoints: PricePoint[];
stats?: {
currentPrice: number;
avgPrice: number;
minPrice: number;
maxPrice: number;
trend: 'rising' | 'falling' | 'stable';
dealScore: number;
};
error?: string;
}
export interface SearchResult {
wines: Wine[];
total: number;
query: string;
sources: string[];
}