Firestore スキーマリファレンス

TeamDay プラットフォーム用の完全な Firestore データモデルとコレクション。

コレクション概要

TeamDay はプライマリデータベースとして Firebase Firestore を使用します。スキーマは、強力なセキュリティルールとリアルタイムサブスクリプション付きの階層的な構造に従います。

コレクション目的アクセス制御
organizations組織/チーム管理メンバーのみ
usersユーザーアカウントデータ所有者のみ
userProfilesユーザーのプリファレンスと設定所有者のみ
characterAI エージェント/アシスタント可視性ベース
spacesエージェント用ワークスペース可視性ベース
chats会話所有者/組織メンバー
tasksエージェント作成のタスク組織メンバー
executionsエージェント実行履歴組織メンバー
missions長時間実行される自動化タスク組織メンバー
scheduledTasksスケジュール済みエージェントオートメーション組織メンバー
skills再利用可能なプロンプトパッケージ可視性ベース
subagents専門化されたエージェント設定可視性ベース
plugins設定パッケージ可視性ベース
pluginInstallationsスペースごとのプラグインインストール組織メンバー
mcpInstancesMCP サーバーインスタンス組織メンバー
personal_access_tokensAPI トークン所有者のみ
invites組織招待パブリック読み取り
usageAggregates使用メトリクス組織メンバー
creditTransactionsクレジット残高履歴組織メンバー

コアコレクション

organizations

組織/チーム管理。各ユーザーは 1 つ以上の組織に属します。

interface Organization {
  id: string
  name: string
  logoUrl?: string
  ownerId: string                    // 組織を作成したユーザー
  members: string[]                  // ユーザー ID の配列
  subscription?: OrganizationSubscription
  createdAt: Timestamp
  updatedAt: Timestamp

  // 暗号化されたフィールド (サーバー側のみ)
  encryptedAnthropicApiKey?: string  // 暗号化された API キー
}

ドキュメント例:

{
  "id": "org_abc123",
  "name": "Acme Corporation",
  "logoUrl": "https://storage.googleapis.com/...",
  "ownerId": "user_xyz",
  "members": ["user_xyz", "user_abc", "user_def"],

詳細については、Firestore スキーマリファレンス を参照してください。