from datetime import datetime
from typing import Optional
from pydantic import BaseModel, Field

class CookiePolicySettings(BaseModel):
    analytics_enabled: bool = Field(default=True, description='If false, analytics cookies/scripts should not be used at all.')
    marketing_enabled: bool = Field(default=True, description='If false, marketing cookies/scripts should not be used at all.')
    preferences_enabled: bool = Field(default=True, description='If false, preference cookies should not be used at all.')

class CookiePolicySettingsResponse(BaseModel):
    status: str = Field(default='success')
    data: CookiePolicySettings
    updated_at: Optional[datetime] = None
    updated_by: Optional[str] = None

class CookieIntegrationSettings(BaseModel):
    ga_measurement_id: Optional[str] = Field(default=None, description='Google Analytics 4 measurement ID (e.g. G-XXXXXXX).')
    fb_pixel_id: Optional[str] = Field(default=None, description='Meta (Facebook) Pixel ID.')

class CookieIntegrationSettingsResponse(BaseModel):
    status: str = Field(default='success')
    data: CookieIntegrationSettings
    updated_at: Optional[datetime] = None
    updated_by: Optional[str] = None

class PublicPrivacyConfig(BaseModel):
    policy: CookiePolicySettings
    integrations: CookieIntegrationSettings

class PublicPrivacyConfigResponse(BaseModel):
    status: str = Field(default='success')
    data: PublicPrivacyConfig