version: 2

updates:
  # ── Node.js / pnpm dependencies ──────────────────────────────────
  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "weekly"
      day: "monday"
      time: "06:00"
      timezone: "Asia/Ho_Chi_Minh"
    open-pull-requests-limit: 10
    reviewers:
      - "goodgo/platform-team"
    labels:
      - "dependencies"
      - "security"
    # Group minor/patch updates to reduce PR noise
    groups:
      dev-dependencies:
        patterns:
          - "@types/*"
          - "eslint*"
          - "prettier*"
          - "typescript*"
          - "vitest*"
          - "@playwright/*"
          - "husky"
          - "lint-staged"
          - "tsx"
          - "turbo"
        update-types:
          - "minor"
          - "patch"
      nestjs:
        patterns:
          - "@nestjs/*"
        update-types:
          - "minor"
          - "patch"
      prisma:
        patterns:
          - "prisma"
          - "@prisma/*"
        update-types:
          - "minor"
          - "patch"
    # Security updates always get individual PRs (not grouped)
    commit-message:
      prefix: "deps"
      include: "scope"

  # ── Python dependencies (AI services) ────────────────────────────
  - package-ecosystem: "pip"
    directory: "/libs/ai-services"
    schedule:
      interval: "weekly"
      day: "monday"
      time: "06:00"
      timezone: "Asia/Ho_Chi_Minh"
    open-pull-requests-limit: 5
    labels:
      - "dependencies"
      - "security"
      - "ai-services"
    commit-message:
      prefix: "deps(ai)"
      include: "scope"

  # ── GitHub Actions ───────────────────────────────────────────────
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "weekly"
      day: "monday"
      time: "06:00"
      timezone: "Asia/Ho_Chi_Minh"
    open-pull-requests-limit: 5
    labels:
      - "dependencies"
      - "ci"
    groups:
      github-actions:
        patterns:
          - "*"
        update-types:
          - "minor"
          - "patch"
    commit-message:
      prefix: "ci"
      include: "scope"

  # ── Docker base images ──────────────────────────────────────────
  - package-ecosystem: "docker"
    directory: "/apps/api"
    schedule:
      interval: "weekly"
      day: "monday"
      time: "06:00"
      timezone: "Asia/Ho_Chi_Minh"
    open-pull-requests-limit: 3
    labels:
      - "dependencies"
      - "docker"
    commit-message:
      prefix: "docker(api)"

  - package-ecosystem: "docker"
    directory: "/apps/web"
    schedule:
      interval: "weekly"
      day: "monday"
      time: "06:00"
      timezone: "Asia/Ho_Chi_Minh"
    open-pull-requests-limit: 3
    labels:
      - "dependencies"
      - "docker"
    commit-message:
      prefix: "docker(web)"

  - package-ecosystem: "docker"
    directory: "/libs/ai-services"
    schedule:
      interval: "weekly"
      day: "monday"
      time: "06:00"
      timezone: "Asia/Ho_Chi_Minh"
    open-pull-requests-limit: 3
    labels:
      - "dependencies"
      - "docker"
    commit-message:
      prefix: "docker(ai)"
