version: 2

models:
  - name: fct_daily_events
    description: "Daily aggregated event metrics for analytics dashboard"
    columns:
      - name: event_date_raw
        description: "Date in YYYYMMDD format"
        tests:
          - unique
          - not_null
      - name: event_count
        description: "Total events on this date"
        tests:
          - not_null

  - name: dim_actors
    description: "Actor dimension with aggregated statistics"
    columns:
      - name: actor_name
        description: "Name of the actor"
        tests:
          - unique
          - not_null
      - name: total_events
        description: "Total events involving this actor"
        tests:
          - not_null

  - name: dim_countries
    description: "Country dimension with aggregated event statistics"
    columns:
      - name: country_code
        description: "3-letter ISO country code"
        tests:
          - unique
          - not_null
      - name: total_events
        description: "Total events from this country"
        tests:
          - not_null

  - name: fct_trending_themes
    description: "Top trending themes aggregated from GKG data with mention counts and activity span"
    columns:
      - name: theme
        description: "GDELT theme identifier extracted from article themes"
        tests:
          - not_null
      - name: mention_count
        description: "Total number of theme mentions across all articles"
        tests:
          - not_null
      - name: days_active
        description: "Number of distinct days this theme was mentioned"
      - name: avg_daily_mentions
        description: "Average mentions per active day (mention_count / days_active)"

  - name: fct_daily_emotions
    description: "Daily averaged emotion scores from GKG articles"
    columns:
      - name: date_key
        description: "Date in YYYYMMDD format"
        tests:
          - unique
          - not_null
      - name: event_date
        description: "Parsed calendar date"
        tests:
          - not_null
      - name: article_count
        description: "Number of articles aggregated into this day"
        tests:
          - not_null
