/**
 * Azure Cosmos DB container initialization for admin dashboard.
 *
 * Data access has moved to @/lib/datastore (cloud-agnostic).
 * This file is kept only for the seed route's initializeAllContainers().
 */

import { registerContainers, initializeAllContainers } from '@bytelyst/cosmos';
import type { ContainerConfig } from '@bytelyst/cosmos';

// Container definitions: name → partition key + optional TTL
const CONTAINER_DEFS: Record<string, ContainerConfig> = {
  users: { partitionKeyPath: '/id' },
  licenses: { partitionKeyPath: '/userId' },
  transcripts: { partitionKeyPath: '/userId' },
  usage_daily: { partitionKeyPath: '/userId', defaultTtl: 365 * 86400 },
  settings: { partitionKeyPath: '/userId' },
  audit_log: { partitionKeyPath: '/category', defaultTtl: 90 * 86400 },
  api_tokens: { partitionKeyPath: '/userId' },
  devices: { partitionKeyPath: '/userId' },
  subscriptions: { partitionKeyPath: '/userId' },
  payments: { partitionKeyPath: '/userId' },
  invitation_codes: { partitionKeyPath: '/id' },
  referrals: { partitionKeyPath: '/referrerId' },
  themes: { partitionKeyPath: '/id' },
};

// Register on module load
registerContainers(CONTAINER_DEFS);

export { initializeAllContainers };
