# generated by datamodel-codegen:
#   filename:  core/product_allocation.json
#   timestamp: 2026-02-23T01:56:40+00:00

from __future__ import annotations

from typing import Annotated

from adcp.types.base import AdCPBaseModel
from pydantic import ConfigDict, Field

from . import daypart_target, delivery_forecast
from . import ext as ext_1


class ProductAllocation(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    allocation_percentage: Annotated[
        float,
        Field(
            description='Percentage of total budget allocated to this product (0-100)',
            ge=0.0,
            le=100.0,
        ),
    ]
    daypart_targets: Annotated[
        list[daypart_target.DaypartTarget] | None,
        Field(
            description='Recommended time windows for this allocation in spot-plan proposals.',
            min_length=1,
        ),
    ] = None
    ext: ext_1.ExtensionObject | None = None
    forecast: Annotated[
        delivery_forecast.DeliveryForecast | None,
        Field(description='Forecasted delivery metrics for this allocation'),
    ] = None
    pricing_option_id: Annotated[
        str | None,
        Field(description="Recommended pricing option ID from the product's pricing_options array"),
    ] = None
    product_id: Annotated[
        str, Field(description='ID of the product (must reference a product in the products array)')
    ]
    rationale: Annotated[
        str | None,
        Field(description='Explanation of why this product and allocation are recommended'),
    ] = None
    sequence: Annotated[
        int | None,
        Field(description='Optional ordering hint for multi-line-item plans (1-based)', ge=1),
    ] = None
    tags: Annotated[
        list[str] | None,
        Field(
            description="Categorical tags for this allocation (e.g., 'desktop', 'german', 'mobile') - useful for grouping/filtering allocations by dimension"
        ),
    ] = None
