package router

import (
	"narasi-ahli-be/app/module/activity_logs"
	"narasi-ahli-be/app/module/advertisement"
	"narasi-ahli-be/app/module/agent"
	"narasi-ahli-be/app/module/ai_chat"
	"narasi-ahli-be/app/module/ai_chat_files"
	"narasi-ahli-be/app/module/article_approvals"
	"narasi-ahli-be/app/module/article_categories"
	"narasi-ahli-be/app/module/article_category_details"
	"narasi-ahli-be/app/module/article_comments"
	"narasi-ahli-be/app/module/article_files"
	"narasi-ahli-be/app/module/articles"
	"narasi-ahli-be/app/module/chat"
	"narasi-ahli-be/app/module/cities"
	"narasi-ahli-be/app/module/custom_static_pages"
	"narasi-ahli-be/app/module/districts"
	"narasi-ahli-be/app/module/ebooks"
	"narasi-ahli-be/app/module/education_history"
	"narasi-ahli-be/app/module/feedbacks"
	"narasi-ahli-be/app/module/knowledge_base"
	"narasi-ahli-be/app/module/magazine_files"
	"narasi-ahli-be/app/module/magazines"
	"narasi-ahli-be/app/module/master_menus"
	"narasi-ahli-be/app/module/master_modules"
	"narasi-ahli-be/app/module/notifications"
	"narasi-ahli-be/app/module/provinces"
	"narasi-ahli-be/app/module/research_journals"
	"narasi-ahli-be/app/module/subscription"
	"narasi-ahli-be/app/module/user_agent"
	"narasi-ahli-be/app/module/user_levels"
	"narasi-ahli-be/app/module/user_role_accesses"
	"narasi-ahli-be/app/module/user_roles"
	"narasi-ahli-be/app/module/users"
	"narasi-ahli-be/app/module/work_history"
	"narasi-ahli-be/config/config"
	_ "narasi-ahli-be/docs/swagger"

	swagger "github.com/arsmn/fiber-swagger/v2"
	"github.com/gofiber/fiber/v2"
)

type Router struct {
	App fiber.Router
	Cfg *config.Config

	ActivityLogsRouter           *activity_logs.ActivityLogsRouter
	AdvertisementRouter          *advertisement.AdvertisementRouter
	AIChatRouter                 *ai_chat.AIChatRouter
	KnowledgeBaseRouter 		 *knowledge_base.KnowledgeBaseRouter
	ArticleCategoriesRouter      *article_categories.ArticleCategoriesRouter
	ArticleCategoryDetailsRouter *article_category_details.ArticleCategoryDetailsRouter
	ArticleFilesRouter           *article_files.ArticleFilesRouter
	ArticleCommentsRouter        *article_comments.ArticleCommentsRouter
	ArticleApprovalsRouter       *article_approvals.ArticleApprovalsRouter
	ArticlesRouter               *articles.ArticlesRouter
	ChatRouter                   *chat.ChatRouter
	CitiesRouter                 *cities.CitiesRouter
	CustomStaticPagesRouter      *custom_static_pages.CustomStaticPagesRouter
	DistrictsRouter              *districts.DistrictsRouter
	EbooksRouter                 *ebooks.EbooksRouter
	FeedbacksRouter              *feedbacks.FeedbacksRouter
	MagazineFilesRouter          *magazine_files.MagazineFilesRouter
	MagazinesRouter              *magazines.MagazinesRouter
	MasterMenusRouter            *master_menus.MasterMenusRouter
	MasterModulesRouter          *master_modules.MasterModulesRouter
	ProvincesRouter              *provinces.ProvincesRouter
	SubscriptionRouter           *subscription.SubscriptionRouter
	UserLevelsRouter             *user_levels.UserLevelsRouter
	UserRoleAccessesRouter       *user_role_accesses.UserRoleAccessesRouter
	UserRolesRouter              *user_roles.UserRolesRouter
	UsersRouter                  *users.UsersRouter
	EducationHistoryRouter       *education_history.EducationHistoryRouter
	WorkHistoryRouter            *work_history.WorkHistoryRouter
	ResearchJournalsRouter       *research_journals.ResearchJournalsRouter
	AIChatFilesRouter            *ai_chat_files.AiChatFilesRouter
    NotificationRouter			 *notifications.NotificationRouter
	AgentRouter					 *agent.AgentRouter
	UserAgentRouter 			 *user_agent.UserAgentRouter

}

func NewRouter(
	fiber *fiber.App,
	cfg *config.Config,

	activityLogsRouter *activity_logs.ActivityLogsRouter,
	advertisementRouter *advertisement.AdvertisementRouter,
	aiChatRouter *ai_chat.AIChatRouter,
	knowledgeBaseRouter *knowledge_base.KnowledgeBaseRouter,
	articleCategoriesRouter *article_categories.ArticleCategoriesRouter,
	articleCategoryDetailsRouter *article_category_details.ArticleCategoryDetailsRouter,
	articleFilesRouter *article_files.ArticleFilesRouter,
	articleCommentsRouter *article_comments.ArticleCommentsRouter,
	articleApprovalsRouter *article_approvals.ArticleApprovalsRouter,
	articlesRouter *articles.ArticlesRouter,
	chatRouter *chat.ChatRouter,
	citiesRouter *cities.CitiesRouter,
	customStaticPagesRouter *custom_static_pages.CustomStaticPagesRouter,
	districtsRouter *districts.DistrictsRouter,
	ebooksRouter *ebooks.EbooksRouter,
	feedbacksRouter *feedbacks.FeedbacksRouter,
	magazineFilesRouter *magazine_files.MagazineFilesRouter,
	magazinesRouter *magazines.MagazinesRouter,
	masterMenuRouter *master_menus.MasterMenusRouter,
	masterModuleRouter *master_modules.MasterModulesRouter,
	provincesRouter *provinces.ProvincesRouter,
	subscriptionRouter *subscription.SubscriptionRouter,
	userLevelsRouter *user_levels.UserLevelsRouter,
	userRoleAccessesRouter *user_role_accesses.UserRoleAccessesRouter,
	userRolesRouter *user_roles.UserRolesRouter,
	usersRouter *users.UsersRouter,
	educationHistoryRouter *education_history.EducationHistoryRouter,
	workHistoryRouter *work_history.WorkHistoryRouter,
	researchJournalsRouter *research_journals.ResearchJournalsRouter,
	aiChatFilesRouter *ai_chat_files.AiChatFilesRouter,
	notificationRouter *notifications.NotificationRouter,
	agentRouter 		*agent.AgentRouter,
	userAgentRouter *user_agent.UserAgentRouter,


) *Router {
	return &Router{
		App:                          fiber,
		Cfg:                          cfg,
		ActivityLogsRouter:           activityLogsRouter,
		AdvertisementRouter:          advertisementRouter,
		AIChatRouter:                 aiChatRouter,
		ArticleCategoriesRouter:      articleCategoriesRouter,
		ArticleCategoryDetailsRouter: articleCategoryDetailsRouter,
		ArticleFilesRouter:           articleFilesRouter,
		ArticleCommentsRouter:        articleCommentsRouter,
		ArticleApprovalsRouter:       articleApprovalsRouter,
		ArticlesRouter:               articlesRouter,
		KnowledgeBaseRouter: 	  	  knowledgeBaseRouter,
		ChatRouter:                   chatRouter,
		CitiesRouter:                 citiesRouter,
		CustomStaticPagesRouter:      customStaticPagesRouter,
		DistrictsRouter:              districtsRouter,
		EbooksRouter:                 ebooksRouter,
		FeedbacksRouter:              feedbacksRouter,
		MagazineFilesRouter:          magazineFilesRouter,
		MagazinesRouter:              magazinesRouter,
		MasterMenusRouter:            masterMenuRouter,
		MasterModulesRouter:          masterModuleRouter,
		ProvincesRouter:              provincesRouter,
		SubscriptionRouter:           subscriptionRouter,
		UserLevelsRouter:             userLevelsRouter,
		UserRoleAccessesRouter:       userRoleAccessesRouter,
		UserRolesRouter:              userRolesRouter,
		UsersRouter:                  usersRouter,
		EducationHistoryRouter:       educationHistoryRouter,
		WorkHistoryRouter:            workHistoryRouter,
		ResearchJournalsRouter:       researchJournalsRouter,
		AIChatFilesRouter: 			  aiChatFilesRouter,
		NotificationRouter: notificationRouter,
		AgentRouter: agentRouter,
		UserAgentRouter: userAgentRouter,


	}
}

// Register routes
func (r *Router) Register() {
	// Test Routes
	r.App.Get("/ping", func(c *fiber.Ctx) error {
		return c.SendString("Pong! 👋")
	})

	//Swagger Documentation
	r.App.Get("/swagger/*", swagger.HandlerDefault)

	// Register routes of modules
	r.ActivityLogsRouter.RegisterActivityLogsRoutes()
	r.AdvertisementRouter.RegisterAdvertisementRoutes()
	r.AIChatRouter.RegisterAIChatRoutes()
	r.ArticleCategoriesRouter.RegisterArticleCategoriesRoutes()
	r.ArticleCategoryDetailsRouter.RegisterArticleCategoryDetailsRoutes()
	r.ArticleFilesRouter.RegisterArticleFilesRoutes()
	r.ArticleApprovalsRouter.RegisterArticleApprovalsRoutes()
	r.ArticlesRouter.RegisterArticlesRoutes()
	r.ArticleCommentsRouter.RegisterArticleCommentsRoutes()
	r.KnowledgeBaseRouter.RegisterKnowledgeBaseRoutes()
	r.ChatRouter.RegisterChatRoutes()
	r.CitiesRouter.RegisterCitiesRoutes()
	r.CustomStaticPagesRouter.RegisterCustomStaticPagesRoutes()
	r.DistrictsRouter.RegisterDistrictsRoutes()
	r.EbooksRouter.RegisterEbooksRoutes()
	r.FeedbacksRouter.RegisterFeedbacksRoutes()
	r.MagazinesRouter.RegisterMagazinesRoutes()
	r.MagazineFilesRouter.RegisterMagazineFilesRoutes()
	r.MasterMenusRouter.RegisterMasterMenusRoutes()
	r.MasterModulesRouter.RegisterMasterModulesRoutes()
	r.ProvincesRouter.RegisterProvincesRoutes()
	r.SubscriptionRouter.RegisterSubscriptionRoutes()
	r.UserLevelsRouter.RegisterUserLevelsRoutes()
	r.UserRoleAccessesRouter.RegisterUserRoleAccessesRoutes()
	r.UsersRouter.RegisterUsersRoutes()
	r.UserRolesRouter.RegisterUserRolesRoutes()
	r.EducationHistoryRouter.RegisterEducationHistoryRoutes()
	r.WorkHistoryRouter.RegisterWorkHistoryRoutes()
	r.ResearchJournalsRouter.RegisterResearchJournalsRoutes()
	r.AIChatFilesRouter.RegisterAiChatFilesRoutes()
	r.NotificationRouter.RegisterNotificationRoutes()
	r.AgentRouter.RegisterAgentRoutes()
	r.UserAgentRouter.RegisterUserAgentRoutes()


}
