package com.ustadmobile.core.db

import com.ustadmobile.core.db.dao.AgentDao_KtorRoute
import com.ustadmobile.core.db.dao.ChatDao_KtorRoute
import com.ustadmobile.core.db.dao.ChatMemberDao_KtorRoute
import com.ustadmobile.core.db.dao.ClazzAssignmentContentJoinDao_KtorRoute
import com.ustadmobile.core.db.dao.ClazzAssignmentDao_KtorRoute
import com.ustadmobile.core.db.dao.ClazzAssignmentRollUpDao_KtorRoute
import com.ustadmobile.core.db.dao.ClazzContentJoinDao_KtorRoute
import com.ustadmobile.core.db.dao.ClazzDao_KtorRoute
import com.ustadmobile.core.db.dao.ClazzEnrolmentDao_KtorRoute
import com.ustadmobile.core.db.dao.ClazzLogAttendanceRecordDao_KtorRoute
import com.ustadmobile.core.db.dao.ClazzLogDao_KtorRoute
import com.ustadmobile.core.db.dao.CommentsDao_KtorRoute
import com.ustadmobile.core.db.dao.ContainerDao_KtorRoute
import com.ustadmobile.core.db.dao.ContentCategoryDao_KtorRoute
import com.ustadmobile.core.db.dao.ContentCategorySchemaDao_KtorRoute
import com.ustadmobile.core.db.dao.ContentEntryContentCategoryJoinDao_KtorRoute
import com.ustadmobile.core.db.dao.ContentEntryDao_KtorRoute
import com.ustadmobile.core.db.dao.ContentEntryParentChildJoinDao_KtorRoute
import com.ustadmobile.core.db.dao.ContentEntryPictureDao_KtorRoute
import com.ustadmobile.core.db.dao.ContentEntryRelatedEntryJoinDao_KtorRoute
import com.ustadmobile.core.db.dao.ContextXObjectStatementJoinDao_KtorRoute
import com.ustadmobile.core.db.dao.CourseAssignmentMarkDao_KtorRoute
import com.ustadmobile.core.db.dao.CourseAssignmentSubmissionAttachmentDao_KtorRoute
import com.ustadmobile.core.db.dao.CourseAssignmentSubmissionDao_KtorRoute
import com.ustadmobile.core.db.dao.CourseBlockDao_KtorRoute
import com.ustadmobile.core.db.dao.CourseDiscussionDao_KtorRoute
import com.ustadmobile.core.db.dao.CourseGroupMemberDao_KtorRoute
import com.ustadmobile.core.db.dao.CourseGroupSetDao_KtorRoute
import com.ustadmobile.core.db.dao.CoursePictureDao_KtorRoute
import com.ustadmobile.core.db.dao.CourseTerminologyDao_KtorRoute
import com.ustadmobile.core.db.dao.DiscussionPostDao_KtorRoute
import com.ustadmobile.core.db.dao.DiscussionTopicDao_KtorRoute
import com.ustadmobile.core.db.dao.EntityRoleDao_KtorRoute
import com.ustadmobile.core.db.dao.ErrorReportDao_KtorRoute
import com.ustadmobile.core.db.dao.GroupLearningSessionDao_KtorRoute
import com.ustadmobile.core.db.dao.HolidayCalendarDao_KtorRoute
import com.ustadmobile.core.db.dao.HolidayDao_KtorRoute
import com.ustadmobile.core.db.dao.LanguageDao_KtorRoute
import com.ustadmobile.core.db.dao.LanguageVariantDao_KtorRoute
import com.ustadmobile.core.db.dao.LearnerGroupDao_KtorRoute
import com.ustadmobile.core.db.dao.LearnerGroupMemberDao_KtorRoute
import com.ustadmobile.core.db.dao.LeavingReasonDao_KtorRoute
import com.ustadmobile.core.db.dao.MessageDao_KtorRoute
import com.ustadmobile.core.db.dao.MessageReadDao_KtorRoute
import com.ustadmobile.core.db.dao.PersonAuth2Dao_KtorRoute
import com.ustadmobile.core.db.dao.PersonDao_KtorRoute
import com.ustadmobile.core.db.dao.PersonGroupDao_KtorRoute
import com.ustadmobile.core.db.dao.PersonGroupMemberDao_KtorRoute
import com.ustadmobile.core.db.dao.PersonParentJoinDao_KtorRoute
import com.ustadmobile.core.db.dao.PersonPictureDao_KtorRoute
import com.ustadmobile.core.db.dao.ReportDao_KtorRoute
import com.ustadmobile.core.db.dao.ScheduleDao_KtorRoute
import com.ustadmobile.core.db.dao.SchoolDao_KtorRoute
import com.ustadmobile.core.db.dao.SchoolMemberDao_KtorRoute
import com.ustadmobile.core.db.dao.ScopedGrantDao_KtorRoute
import com.ustadmobile.core.db.dao.SiteDao_KtorRoute
import com.ustadmobile.core.db.dao.StateContentDao_KtorRoute
import com.ustadmobile.core.db.dao.StateDao_KtorRoute
import com.ustadmobile.core.db.dao.StatementDao_KtorRoute
import com.ustadmobile.core.db.dao.UserSessionDao_KtorRoute
import com.ustadmobile.core.db.dao.VerbDao_KtorRoute
import com.ustadmobile.core.db.dao.XLangMapEntryDao_KtorRoute
import com.ustadmobile.core.db.dao.XObjectDao_KtorRoute
import com.ustadmobile.door.attachments.doorAttachmentsRoute
import com.ustadmobile.door.ktor.addDbVersionCheckIntercept
import com.ustadmobile.door.replication.doorReplicationRoute
import io.ktor.routing.Route
import kotlin.Unit
import kotlinx.serialization.json.Json
import org.kodein.type.TypeToken
import org.kodein.type.erased

public fun Route.UmAppDatabase_KtorRoute(json: Json = Json { encodeDefaults = true } ): Unit {
  addDbVersionCheckIntercept(60)
  val _typeToken: TypeToken<UmAppDatabase> = erased()
  doorReplicationRoute(_typeToken, UmAppDatabase::class, json)
  PersonDao_KtorRoute(
  _typeToken, 
   {
    it.personDao
  }
  )

  ClazzDao_KtorRoute(
  _typeToken, 
   {
    it.clazzDao
  }
  )

  CourseBlockDao_KtorRoute(
  _typeToken, 
   {
    it.courseBlockDao
  }
  )

  CourseTerminologyDao_KtorRoute(
  _typeToken, 
   {
    it.courseTerminologyDao
  }
  )

  CourseGroupSetDao_KtorRoute(
  _typeToken, 
   {
    it.courseGroupSetDao
  }
  )

  CourseGroupMemberDao_KtorRoute(
  _typeToken, 
   {
    it.courseGroupMemberDao
  }
  )

  ClazzEnrolmentDao_KtorRoute(
  _typeToken, 
   {
    it.clazzEnrolmentDao
  }
  )

  LeavingReasonDao_KtorRoute(
  _typeToken, 
   {
    it.leavingReasonDao
  }
  )

  ContentEntryDao_KtorRoute(
  _typeToken, 
   {
    it.contentEntryDao
  }
  )

  ContentEntryContentCategoryJoinDao_KtorRoute(
  _typeToken, 
   {
    it.contentEntryContentCategoryJoinDao
  }
  )

  ContentEntryParentChildJoinDao_KtorRoute(
  _typeToken, 
   {
    it.contentEntryParentChildJoinDao
  }
  )

  ContentEntryRelatedEntryJoinDao_KtorRoute(
  _typeToken, 
   {
    it.contentEntryRelatedEntryJoinDao
  }
  )

  ClazzContentJoinDao_KtorRoute(
  _typeToken, 
   {
    it.clazzContentJoinDao
  }
  )

  ContentCategorySchemaDao_KtorRoute(
  _typeToken, 
   {
    it.contentCategorySchemaDao
  }
  )

  ContentCategoryDao_KtorRoute(
  _typeToken, 
   {
    it.contentCategoryDao
  }
  )

  LanguageDao_KtorRoute(
  _typeToken, 
   {
    it.languageDao
  }
  )

  LanguageVariantDao_KtorRoute(
  _typeToken, 
   {
    it.languageVariantDao
  }
  )

  PersonGroupDao_KtorRoute(
  _typeToken, 
   {
    it.personGroupDao
  }
  )

  PersonGroupMemberDao_KtorRoute(
  _typeToken, 
   {
    it.personGroupMemberDao
  }
  )

  EntityRoleDao_KtorRoute(
  _typeToken, 
   {
    it.entityRoleDao
  }
  )

  PersonPictureDao_KtorRoute(
  _typeToken, 
   {
    it.personPictureDao
  }
  )

  ContainerDao_KtorRoute(
  _typeToken, 
   {
    it.containerDao
  }
  )

  VerbDao_KtorRoute(
  _typeToken, 
   {
    it.verbDao
  }
  )

  XObjectDao_KtorRoute(
  _typeToken, 
   {
    it.xObjectDao
  }
  )

  ReportDao_KtorRoute(
  _typeToken, 
   {
    it.reportDao
  }
  )

  StatementDao_KtorRoute(
  _typeToken, 
   {
    it.statementDao
  }
  )

  ContextXObjectStatementJoinDao_KtorRoute(
  _typeToken, 
   {
    it.contextXObjectStatementJoinDao
  }
  )

  StateDao_KtorRoute(
  _typeToken, 
   {
    it.stateDao
  }
  )

  StateContentDao_KtorRoute(
  _typeToken, 
   {
    it.stateContentDao
  }
  )

  AgentDao_KtorRoute(
  _typeToken, 
   {
    it.agentDao
  }
  )

  LearnerGroupDao_KtorRoute(
  _typeToken, 
   {
    it.learnerGroupDao
  }
  )

  LearnerGroupMemberDao_KtorRoute(
  _typeToken, 
   {
    it.learnerGroupMemberDao
  }
  )

  GroupLearningSessionDao_KtorRoute(
  _typeToken, 
   {
    it.groupLearningSessionDao
  }
  )

  ClazzLogAttendanceRecordDao_KtorRoute(
  _typeToken, 
   {
    it.clazzLogAttendanceRecordDao
  }
  )

  ClazzLogDao_KtorRoute(
  _typeToken, 
   {
    it.clazzLogDao
  }
  )

  ScheduleDao_KtorRoute(
  _typeToken, 
   {
    it.scheduleDao
  }
  )

  HolidayCalendarDao_KtorRoute(
  _typeToken, 
   {
    it.holidayCalendarDao
  }
  )

  HolidayDao_KtorRoute(
  _typeToken, 
   {
    it.holidayDao
  }
  )

  SchoolDao_KtorRoute(
  _typeToken, 
   {
    it.schoolDao
  }
  )

  XLangMapEntryDao_KtorRoute(
  _typeToken, 
   {
    it.xLangMapEntryDao
  }
  )

  SchoolMemberDao_KtorRoute(
  _typeToken, 
   {
    it.schoolMemberDao
  }
  )

  ClazzAssignmentDao_KtorRoute(
  _typeToken, 
   {
    it.clazzAssignmentDao
  }
  )

  ClazzAssignmentContentJoinDao_KtorRoute(
  _typeToken, 
   {
    it.clazzAssignmentContentJoinDao
  }
  )

  ClazzAssignmentRollUpDao_KtorRoute(
  _typeToken, 
   {
    it.clazzAssignmentRollUpDao
  }
  )

  CourseAssignmentSubmissionDao_KtorRoute(
  _typeToken, 
   {
    it.courseAssignmentSubmissionDao
  }
  )

  CourseAssignmentSubmissionAttachmentDao_KtorRoute(
  _typeToken, 
   {
    it.courseAssignmentSubmissionAttachmentDao
  }
  )

  CourseAssignmentMarkDao_KtorRoute(
  _typeToken, 
   {
    it.courseAssignmentMarkDao
  }
  )

  CommentsDao_KtorRoute(
  _typeToken, 
   {
    it.commentsDao
  }
  )

  SiteDao_KtorRoute(
  _typeToken, 
   {
    it.siteDao
  }
  )

  SiteTermsDao_KtorRoute(
  _typeToken, 
   {
    it.siteTermsDao
  }
  )

  PersonParentJoinDao_KtorRoute(
  _typeToken, 
   {
    it.personParentJoinDao
  }
  )

  ScopedGrantDao_KtorRoute(
  _typeToken, 
   {
    it.scopedGrantDao
  }
  )

  ErrorReportDao_KtorRoute(
  _typeToken, 
   {
    it.errorReportDao
  }
  )

  PersonAuth2Dao_KtorRoute(
  _typeToken, 
   {
    it.personAuth2Dao
  }
  )

  UserSessionDao_KtorRoute(
  _typeToken, 
   {
    it.userSessionDao
  }
  )

  CoursePictureDao_KtorRoute(
  _typeToken, 
   {
    it.coursePictureDao
  }
  )

  ContentEntryPictureDao_KtorRoute(
  _typeToken, 
   {
    it.contentEntryPictureDao
  }
  )

  ChatDao_KtorRoute(
  _typeToken, 
   {
    it.chatDao
  }
  )

  ChatMemberDao_KtorRoute(
  _typeToken, 
   {
    it.chatMemberDao
  }
  )

  MessageDao_KtorRoute(
  _typeToken, 
   {
    it.messageDao
  }
  )

  MessageReadDao_KtorRoute(
  _typeToken, 
   {
    it.messageReadDao
  }
  )

  CourseDiscussionDao_KtorRoute(
  _typeToken, 
   {
    it.courseDiscussionDao
  }
  )

  DiscussionTopicDao_KtorRoute(
  _typeToken, 
   {
    it.discussionTopicDao
  }
  )

  DiscussionPostDao_KtorRoute(
  _typeToken, 
   {
    it.discussionPostDao
  }
  )

  doorAttachmentsRoute("attachments", _typeToken)
}
