/**
 * 租户相关类型定义
 */

/**
 * 租户状态
 */
export enum TenantStatus {
  ACTIVE = 'ACTIVE',
  SUSPENDED = 'SUSPENDED',
  ARCHIVED = 'ARCHIVED',
}

/**
 * 租户套餐
 */
export enum TenantPlan {
  FREE = 'FREE',
  STANDARD = 'STANDARD',
  ENTERPRISE = 'ENTERPRISE',
}

/**
 * 品牌配置
 */
export interface BrandingConfig {
  logoUrl?: string;
  primaryColor?: string;
  companyName?: string;
  favicon?: string;
}

/**
 * AI 配置
 */
export interface AIConfig {
  systemPrompt?: string;
  model?: string;
  temperature?: number;
  maxTokens?: number;
}

/**
 * 功能开关配置
 */
export interface FeatureConfig {
  enableFileUpload?: boolean;
  enableKnowledgeBase?: boolean;
  enablePayments?: boolean;
  enableUserMemory?: boolean;
  enableAnalytics?: boolean;
}

/**
 * 通知配置
 */
export interface NotificationConfig {
  webhookUrl?: string;
  emailNotifications?: boolean;
  smsNotifications?: boolean;
}

/**
 * 租户配置
 */
export interface TenantConfig {
  branding?: BrandingConfig;
  ai?: AIConfig;
  features?: FeatureConfig;
  notifications?: NotificationConfig;
}

/**
 * 租户上下文 - 用于请求级别的租户信息
 */
export interface TenantContext {
  id: string;
  slug: string;
  name: string;
  status: TenantStatus;
  plan: TenantPlan;
  config: TenantConfig;
}

/**
 * 带租户上下文的请求
 */
export interface TenantRequest extends Request {
  tenant: TenantContext;
  tenantId: string;
}

/**
 * 默认租户 ID (用于迁移现有数据)
 */
export const DEFAULT_TENANT_ID = '00000000-0000-0000-0000-000000000001';
