# PlanitAI KPI Configuration Example
# =====================================
# This is a sample configuration for a sales KPI tree.
# Customize it for your business needs.

# Google Sheets Settings
sheet:
  # Your Google Sheets ID (from URL)
  sheet_id: "1ABC123xyz..."

  # Range for actual KPI data
  # Format: SheetName!StartCell:EndCell
  data_range: "Monthly Data!A1:Z100"

  # Range for target data (optional)
  target_range: "Targets!A1:Z100"

  # Column name that contains the period identifier
  period_column: "period"

# Gemini API Key
# Use environment variable for security
gemini_api_key: "${GEMINI_API_KEY}"

# Output Settings
output_path: "./output"
language: "ja"  # ja, en, ko

# Google Service Account credentials file
credentials_path: "credentials.json"

# KPI Tree Definition
# ===================
# Node Types:
#   - kgi: Key Goal Indicator (top-level, usually one)
#   - kpi: Key Performance Indicator (calculated from formula)
#   - input: Input values (leaf nodes, manually entered)
#
# Categories: finance, sales, marketing, hr, product, customer, operation

tree:
  # ====== KGI (売上) ======
  - id: revenue
    name: 月間売上
    type: kgi
    formula: "{contracts} * {avg_price}"
    unit: 円
    category: finance
    description: 月間の総売上高
    children: [contracts, avg_price]

  # ====== 契約関連 KPI ======
  - id: contracts
    name: 契約数
    type: kpi
    formula: "{meetings} * {close_rate}"
    unit: 件
    category: sales
    description: 月間の新規契約数
    children: [meetings, close_rate]

  - id: avg_price
    name: 平均単価
    type: input
    unit: 円
    category: finance
    description: 1契約あたりの平均単価

  - id: close_rate
    name: 成約率
    type: input
    unit: "%"
    category: sales
    description: 商談から成約への転換率

  # ====== 商談関連 KPI ======
  - id: meetings
    name: 商談数
    type: kpi
    formula: "{leads} * {meeting_rate}"
    unit: 件
    category: sales
    description: 月間の商談実施数
    children: [leads, meeting_rate]

  - id: meeting_rate
    name: 商談化率
    type: input
    unit: "%"
    category: sales
    description: リードから商談への転換率

  # ====== マーケティング KPI ======
  - id: leads
    name: リード数
    type: kpi
    formula: "{web_visitors} * {cvr}"
    unit: 件
    category: marketing
    description: 月間の獲得リード数
    children: [web_visitors, cvr]

  - id: web_visitors
    name: サイト訪問者数
    type: input
    unit: 人
    category: marketing
    description: Webサイトのユニーク訪問者数

  - id: cvr
    name: CVR
    type: input
    unit: "%"
    category: marketing
    description: 訪問者からリードへの転換率
