# PlanitAI KPI Configuration

# Google Sheets Settings
sheet:
  sheet_id: "17AUAHQQB0nZVje9QXtdISEPtMoa8RXKkuCk4R5iHbd4"
  data_range: "予実出力!A1:Z50"

  # Pivot format configuration (for horizontal data layout)
  pivot:
    enabled: true
    period_row: 3        # Row with period labels (0-indexed)
    header_row: 4        # Row with column headers (予算, 実績, etc.)
    data_start_row: 5    # Row where data starts
    item_col: 1          # Column index for item names (B column = 1)
    data_start_col: 4    # Column index where data starts (E column = 4)
    cols_per_period: 4   # 4 columns per period (予算, 実績, 差異, 達成率)
    budget_col_offset: 0 # 予算 is first column in period
    actual_col_offset: 1 # 実績 is second column in period

    # Map sheet item names to KPI IDs
    item_mapping:
      売上高: revenue
      売上原価: cogs
      売上総損益金額: gross_profit
      販売管理費 計: sg_and_a
      営業損益金額: operating_income
      経常損益金額: ordinary_income
      税引前当期純損益金額: pretax_income

# Gemini API Key
gemini_api_key: "AIzaSyCQwIdjwi7uUCMNplFtALQLv66U3FEeOm8"

# Output Settings
output_path: "./output"
language: "ja"

# Credentials file for Google Sheets
credentials_path: "credentials.json"

# KPI Tree Definition (PL-based structure)
tree:
  # KGI (Key Goal Indicator) - Top level
  - id: revenue
    name: 売上高
    type: kgi
    unit: 円
    category: finance

  # Other metrics as reference (INPUT for now)
  - id: cogs
    name: 売上原価
    type: input
    unit: 円
    category: finance

  - id: gross_profit
    name: 売上総損益金額
    type: input
    unit: 円
    category: finance

  - id: sg_and_a
    name: 販売管理費 計
    type: input
    unit: 円
    category: finance

  - id: operating_income
    name: 営業損益金額
    type: input
    unit: 円
    category: finance

  - id: ordinary_income
    name: 経常損益金額
    type: input
    unit: 円
    category: finance

  - id: pretax_income
    name: 税引前当期純損益金額
    type: input
    unit: 円
    category: finance
