import { drizzle } from 'drizzle-orm/node-postgres';
import { getPool } from './index';
import * as schema from './schema/schema';

export const db = drizzle(getPool(), { schema });

export { schema };
export const {
  languages,
  translations,
  translationKeys,
  users,
  restaurants,
  branches,
  subscriptions,
  plans,
  passwordResetTokens,
  orders,
  bookings,
  customers,
  menuCategories,
  menuItems,
  menuModifierGroups,
  menuModifierOptions,
  phoneNumbers,
  conversations,
  aiAgentConfigs,
  aiAgents,
  llmModels,
  voiceModels,
  voiceProviders,
  knowledgeBase,
  staff,
  webhooks,
  apiKeys,
  notifications,
  supportTickets,
  blogPosts,
  callLogs,
  platformSettings,
  notificationPreferences,
  messageTemplates,
  auditLogs,
  webhookDeliveryLogs,
  llmProviders,
  restaurantApiKeys,
  telephoneSettings,
  sipRegistrations,
  sipCallSessions,
  widgetSettings,
  roles,
  alertSettings,
  agentKnowledgeBases,
  adminUsers,
} = schema;
