import datetime as dt

from interloper.schema import AssetSchema
from pydantic import Field


class Campaigns(AssetSchema):
    """
    The Campaigns report provides insights into the performance and financial outcomes of advertising campaigns.
    It includes key metrics such as click rates, conversion rates, revenue from various client activities such as
    clicks, impressions, leads, and sales, as well as campaign and media information.
    """

    agent_id: int = Field(description="The unique identifier for the agent")
    camp_id: int = Field(description="The unique identifier for the campaign")
    camp_title: str = Field(description="The title of the campaign")
    campaign_manager: str = Field(description="The name of the campaign manager")
    campaign_manager_id: int = Field(description="The unique identifier for the campaign manager")
    click_nun: int = Field(description="The number of clicks from unique visitors")
    click_un: int = Field(description="The number of clicks from unique sources")
    client_click_rev: float = Field(description="Revenue generated from client clicks")
    client_impr_rev: float = Field(description="Revenue generated from client impressions")
    client_lead_price: float = Field(description="Price of leads for the client")
    client_lead_rev: float = Field(description="Revenue generated from client leads")
    client_sale_rev: float = Field(description="Revenue generated from client sales")
    client_subtotal: float = Field(description="Total revenue generated from client activities")
    company_name: str = Field(description="The name of the company")
    cpc: float = Field(description="Cost per click")
    cr: float = Field(description="Conversion rate")
    currency: str = Field(description="The currency used for transactions")
    currency_code: str = Field(description="The currency code used")
    currency_id: int = Field(description="The unique identifier for the currency")
    currency_rate: float = Field(description="The exchange rate of the currency")
    date: dt.date = Field(description="The date of the record")
    date_from: dt.date = Field(description="The starting date for a time period")
    date_max: dt.date = Field(description="The maximum date in a time period")
    date_min: dt.date = Field(description="The minimum date in a time period")
    date_to: dt.date = Field(description="The ending date for a time period")
    default_banner: str = Field(description="The default banner for the campaign")
    from_date: dt.date = Field(description="The starting date of an event or activity")
    leads: int = Field(description="The number of leads generated")
    media_id: int = Field(description="The unique identifier for the media")
    medianame: str = Field(description="The name of the media")
    mediatype: str = Field(description="The type of media")
    monthyear: str = Field(description="The combination of month and year")
    pcr: float = Field(description="Partial conversion rate")
    pending_rev: float = Field(description="Revenue that is pending or not yet realized")
    primary_category: int = Field(description="The primary category identifier")
    primary_category_name: str = Field(description="The name of the primary category")
    publisher_manager: str = Field(description="The name of the publisher manager")
    publisher_manager_id: int = Field(description="The unique identifier for the publisher manager")
    sales: float = Field(description="The number of sales")
    sales_amount: float = Field(description="The total amount of sales")
    stamp: dt.date = Field(description="The timestamp of the record")
    to_date: dt.date = Field(description="The ending date of an event or activity")
    week_to: dt.date = Field(description="The ending week of a time period")
    weekyear: str = Field(description="The combination of week and year")
    year: dt.date = Field(description="The year of the record")
    year_from: dt.date = Field(description="The starting year of a time period")
    year_to: dt.date = Field(description="The ending year of a time period")
