-- Add missing fields to provider_services for tour functionality
ALTER TABLE provider_services
ADD COLUMN IF NOT EXISTS description TEXT,
ADD COLUMN IF NOT EXISTS duration TEXT,
ADD COLUMN IF NOT EXISTS price_per_person INTEGER,
ADD COLUMN IF NOT EXISTS currency TEXT DEFAULT 'TRY',
ADD COLUMN IF NOT EXISTS max_group_size INTEGER DEFAULT 15,
ADD COLUMN IF NOT EXISTS includes TEXT[] DEFAULT '{}',
ADD COLUMN IF NOT EXISTS excludes TEXT[] DEFAULT '{}',
ADD COLUMN IF NOT EXISTS is_active BOOLEAN DEFAULT true;

-- Create index for active services
CREATE INDEX IF NOT EXISTS idx_provider_services_is_active ON provider_services(is_active);
CREATE INDEX IF NOT EXISTS idx_provider_services_daily_tour_services ON provider_services USING GIN(daily_tour_services);

COMMENT ON COLUMN provider_services.daily_tour_services IS 'Array of daily_tour slugs this provider offers (e.g., ["red_tour", "green_tour", "private_guide"])';