# Business-facing semantic model. Maps natural language concepts to physical tables/columns.
# Adapters (BigQuery, Redshift, Snowflake) resolve identifiers per dialect.

version: 1
defaults:
  time_column: order_date
  grain: day

entities:
  orders:
    physical_table: orders
    description: Customer orders and revenue
    time_column: order_date
    dimensions:
      region:
        column: region
        type: string
        description: Sales region
      product_category:
        column: product_category
        type: string
      channel:
        column: channel
        type: string
    metrics:
      revenue:
        expr: "SUM(amount)"
        description: Total order revenue
      orders:
        expr: "COUNT(*)"
        description: Number of orders
      aov:
        expr: "AVG(amount)"
        description: Average order value
