Skip to content

feat: Add MediaChannel support to products and properties #1032

Description

@bokelley

Summary

Add channels field to Product and supported_channels to Property, using the AdCP v3 MediaChannel enum. This enables channel-based filtering in get_products and list_authorized_properties.

AdCP version: v3.0.0-beta.3 (adcp library 3.3.0)

AdCP v3 Channel Fields

On Product

class Product(AdCPBaseModel):
    channels: list[MediaChannel] | None  # e.g., ["display", "olv", "ctv"]

On Property

class Property(AdCPBaseModel):
    supported_channels: list[MediaChannel] | None  # e.g., ["display", "olv"]

MediaChannel Enum (19 values)

class MediaChannel(Enum):
    display = 'display'
    olv = 'olv'              # Online video
    social = 'social'
    search = 'search'
    ctv = 'ctv'              # Connected TV
    linear_tv = 'linear_tv'
    radio = 'radio'
    streaming_audio = 'streaming_audio'
    podcast = 'podcast'
    dooh = 'dooh'            # Digital out-of-home
    ooh = 'ooh'              # Out-of-home
    print = 'print'
    cinema = 'cinema'
    email = 'email'
    gaming = 'gaming'
    retail_media = 'retail_media'
    influencer = 'influencer'
    affiliate = 'affiliate'
    product_placement = 'product_placement'

Current State

Products and properties don't expose channel information. The Product schema in src/core/schemas.py extends the library's Product but doesn't include channels. The Property model in the database doesn't track supported channels.

Implementation Plan

1. Database: Add channels to Product and Property models

Products already have a config structure; add channels as a JSON array. Properties need a supported_channels column.

2. Schema: Ensure library fields pass through

Since we extend the library Product/Property, the channels/supported_channels fields should already be on the base class. Verify they serialize correctly and aren't being excluded.

3. Admin UI: Channel configuration

Products need a way to configure which channels they support. Add multi-select in product configuration.

4. GAM adapter: Derive channels from line item type

  • STANDARD/BULK → display
  • VIDEO → olv
  • SPONSORSHIP → display (typically)

Map GAM creative types to channels where possible.

5. Filtering

get_products could accept a channel filter in the brief or as an explicit parameter to return only products matching requested channels.

Files to Modify

File Change
src/core/schemas.py Ensure channels fields pass through
src/core/database/models.py Add channels storage
src/core/tools/products.py Expose channels in response
src/core/tools/properties.py Expose supported_channels
src/adapters/gam/adapter.py Derive channels from GAM config
src/adapters/mock/adapter.py Support channels
Admin UI templates Channel configuration for products
tests/unit/test_products.py Channel filtering tests

Testing

Test cases:

  • Product with channels returns them in get_products response
  • Property with supported_channels returns them in list_authorized_properties
  • GAM adapter correctly maps line item types to channels
  • Products without channels configured return None (not empty list)
  • Channel values match MediaChannel enum

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    Ready for Dev

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions