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

from __future__ import annotations

from typing import Annotated, Literal

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

from . import catchment
from . import ext as ext_1


class Address(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    city: Annotated[str | None, Field(description='City name.')] = None
    country: Annotated[
        str | None, Field(description='ISO 3166-1 alpha-2 country code.', pattern='^[A-Z]{2}$')
    ] = None
    postal_code: Annotated[str | None, Field(description='Postal or ZIP code.')] = None
    region: Annotated[
        str | None,
        Field(
            description="State, province, or region. ISO 3166-2 subdivision code preferred (e.g., 'NL-NH', 'US-CA')."
        ),
    ] = None
    street: Annotated[str | None, Field(description="Street address (e.g., '123 Main St').")] = None


class Location(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    lat: Annotated[
        float, Field(description='Latitude in decimal degrees (WGS 84).', ge=-90.0, le=90.0)
    ]
    lng: Annotated[
        float, Field(description='Longitude in decimal degrees (WGS 84).', ge=-180.0, le=180.0)
    ]


class StoreItem(AdCPBaseModel):
    model_config = ConfigDict(
        extra='allow',
    )
    address: Annotated[
        Address | None, Field(description='Structured address for display and geocoding fallback.')
    ] = None
    catchments: Annotated[
        list[catchment.Catchment] | None,
        Field(
            description='Catchment areas for this store. Each defines a reachable area using travel time (isochrone), simple radius, or pre-computed GeoJSON. Multiple catchments allow different modes — e.g., 15-minute drive AND 10-minute walk.',
            min_length=1,
        ),
    ] = None
    ext: ext_1.ExtensionObject | None = None
    hours: Annotated[
        dict[
            Literal['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'],
            str,
        ]
        | None,
        Field(
            description='Operating hours. Keys are ISO day names (monday–sunday), values are time ranges.'
        ),
    ] = None
    location: Annotated[Location, Field(description='Geographic coordinates of the store.')]
    name: Annotated[
        str,
        Field(
            description="Human-readable store name (e.g., 'Amsterdam Flagship', 'Brooklyn Heights')."
        ),
    ]
    phone: Annotated[
        str | None, Field(description="Store phone number in E.164 format (e.g., '+31201234567').")
    ] = None
    store_id: Annotated[
        str,
        Field(
            description='Unique identifier for this store. Used to reference specific stores in targeting, inventory feeds, and creative templates.'
        ),
    ]
    tags: Annotated[
        list[str] | None,
        Field(
            description="Tags for filtering stores in targeting and creative selection (e.g., 'flagship', 'pickup', 'pharmacy').",
            min_length=1,
        ),
    ] = None
    url: Annotated[
        AnyUrl | None,
        Field(description='Store-specific page URL (e.g., store locator detail page).'),
    ] = None
