import { router } from '../trpc'
import { programRouter } from './program'
import { projectRouter } from './project'
import { userRouter } from './user'
import { assignmentRouter } from './assignment'
import { evaluationRouter } from './evaluation'
import { fileRouter } from './file'
import { exportRouter } from './export'
import { auditRouter } from './audit'
import { settingsRouter } from './settings'
import { gracePeriodRouter } from './gracePeriod'
// Phase 2 routers
import { learningResourceRouter } from './learningResource'
import { partnerRouter } from './partner'
import { notionImportRouter } from './notion-import'
import { typeformImportRouter } from './typeform-import'
// Phase 2B routers
import { tagRouter } from './tag'
import { applicantRouter } from './applicant'
import { liveVotingRouter } from './live-voting'
import { analyticsRouter } from './analytics'
// Storage routers
import { avatarRouter } from './avatar'
import { logoRouter } from './logo'
// Applicant system routers
import { applicationRouter } from './application'
import { mentorRouter } from './mentor'
import { filteringRouter } from './filtering'
import { rankingRouter } from './ranking'
import { specialAwardRouter } from './specialAward'
import { notificationRouter } from './notification'
// Feature expansion routers
import { messageRouter } from './message'
import { webhookRouter } from './webhook'
import { projectPoolRouter } from './project-pool'
import { wizardTemplateRouter } from './wizard-template'
import { dashboardRouter } from './dashboard'
// Legacy round routers (kept)
import { liveRouter } from './live'
// Competition architecture routers (Phase 0+1)
import { competitionRouter } from './competition'
import { roundRouter } from './round'
import { juryGroupRouter } from './juryGroup'
// Competition architecture routers (Phase 2)
import { assignmentPolicyRouter } from './assignmentPolicy'
import { assignmentIntentRouter } from './assignmentIntent'
// Competition architecture routers (Phase 4 - Backend Orchestration)
import { roundEngineRouter } from './roundEngine'
import { roundAssignmentRouter } from './roundAssignment'
import { deliberationRouter } from './deliberation'
import { resultLockRouter } from './resultLock'
// Grand-finale logistics
import { finalistRouter } from './finalist'
import { logisticsRouter } from './logistics'
import { lunchRouter } from './lunch'

/**
 * Root tRPC router that combines all domain routers
 */
export const appRouter = router({
  program: programRouter,
  project: projectRouter,
  user: userRouter,
  assignment: assignmentRouter,
  evaluation: evaluationRouter,
  file: fileRouter,
  export: exportRouter,
  audit: auditRouter,
  settings: settingsRouter,
  gracePeriod: gracePeriodRouter,
  // Phase 2 routers
  learningResource: learningResourceRouter,
  partner: partnerRouter,
  notionImport: notionImportRouter,
  typeformImport: typeformImportRouter,
  // Phase 2B routers
  tag: tagRouter,
  applicant: applicantRouter,
  liveVoting: liveVotingRouter,
  analytics: analyticsRouter,
  // Storage routers
  avatar: avatarRouter,
  logo: logoRouter,
  // Applicant system routers
  application: applicationRouter,
  mentor: mentorRouter,
  filtering: filteringRouter,
  ranking: rankingRouter,
  specialAward: specialAwardRouter,
  notification: notificationRouter,
  // Feature expansion routers
  message: messageRouter,
  webhook: webhookRouter,
  projectPool: projectPoolRouter,
  wizardTemplate: wizardTemplateRouter,
  dashboard: dashboardRouter,
  // Legacy round routers (kept)
  live: liveRouter,
  // Competition architecture routers (Phase 0+1)
  competition: competitionRouter,
  round: roundRouter,
  juryGroup: juryGroupRouter,
  // Competition architecture routers (Phase 2)
  assignmentPolicy: assignmentPolicyRouter,
  assignmentIntent: assignmentIntentRouter,
  // Competition architecture routers (Phase 4 - Backend Orchestration)
  roundEngine: roundEngineRouter,
  roundAssignment: roundAssignmentRouter,
  deliberation: deliberationRouter,
  resultLock: resultLockRouter,
  // Grand-finale logistics
  finalist: finalistRouter,
  logistics: logisticsRouter,
  lunch: lunchRouter,
})

export type AppRouter = typeof appRouter
