package router

import (
	"web-qudo-be/app/module/about_us_content_images"
	"web-qudo-be/app/module/about_us_contents"
	"web-qudo-be/app/module/activity_logs"
	"web-qudo-be/app/module/advertisement"
	"web-qudo-be/app/module/approval_workflow_steps"
	"web-qudo-be/app/module/approval_workflows"
	"web-qudo-be/app/module/article_approval_flows"
	"web-qudo-be/app/module/article_approval_step_logs"
	"web-qudo-be/app/module/article_approvals"
	"web-qudo-be/app/module/article_categories"
	"web-qudo-be/app/module/article_category_details"
	"web-qudo-be/app/module/article_comments"
	"web-qudo-be/app/module/article_files"
	"web-qudo-be/app/module/article_nulis_ai"
	"web-qudo-be/app/module/articles"
	"web-qudo-be/app/module/bookmarks"
	"web-qudo-be/app/module/cities"
	"web-qudo-be/app/module/client_approval_settings"
	"web-qudo-be/app/module/clients"
	"web-qudo-be/app/module/cms_media"
	"web-qudo-be/app/module/custom_static_pages"
	"web-qudo-be/app/module/districts"
	"web-qudo-be/app/module/feedbacks"
	hero_content_image "web-qudo-be/app/module/hero_content_images"
	hero_content "web-qudo-be/app/module/hero_contents"
	"web-qudo-be/app/module/magazine_files"
	"web-qudo-be/app/module/magazines"
	"web-qudo-be/app/module/master_menus"
	"web-qudo-be/app/module/master_modules"
	"web-qudo-be/app/module/our_product_content_images"
	"web-qudo-be/app/module/our_product_contents"
	"web-qudo-be/app/module/our_service_content_images"
	"web-qudo-be/app/module/our_service_contents"
	"web-qudo-be/app/module/partner_contents"
	"web-qudo-be/app/module/popup_news_content_images"
	"web-qudo-be/app/module/popup_news_contents"
	"web-qudo-be/app/module/provinces"
	"web-qudo-be/app/module/schedules"
	"web-qudo-be/app/module/subscription"
	"web-qudo-be/app/module/user_levels"
	"web-qudo-be/app/module/user_role_accesses"
	"web-qudo-be/app/module/user_roles"
	"web-qudo-be/app/module/users"
	"web-qudo-be/config/config"
	_ "web-qudo-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
	AboutUsContentsRouter         *about_us_contents.AboutUsContentsRouter
	AboutUsContentImageRouter     *about_us_content_images.AboutUsContentImageRouter
	AdvertisementRouter           *advertisement.AdvertisementRouter
	ApprovalWorkflowsRouter       *approval_workflows.ApprovalWorkflowsRouter
	ApprovalWorkflowStepsRouter   *approval_workflow_steps.ApprovalWorkflowStepsRouter
	ArticleApprovalFlowsRouter    *article_approval_flows.ArticleApprovalFlowsRouter
	ArticleApprovalStepLogsRouter *article_approval_step_logs.ArticleApprovalStepLogsRouter
	ArticleCategoriesRouter       *article_categories.ArticleCategoriesRouter
	ArticleCategoryDetailsRouter  *article_category_details.ArticleCategoryDetailsRouter
	ArticleFilesRouter            *article_files.ArticleFilesRouter
	ArticleCommentsRouter         *article_comments.ArticleCommentsRouter
	ArticleApprovalsRouter        *article_approvals.ArticleApprovalsRouter
	ArticlesRouter                *articles.ArticlesRouter
	ArticleNulisAIRouter          *article_nulis_ai.ArticleNulisAIRouter
	BookmarksRouter               *bookmarks.BookmarksRouter
	CitiesRouter                  *cities.CitiesRouter
	ClientApprovalSettingsRouter  *client_approval_settings.ClientApprovalSettingsRouter
	ClientsRouter                 *clients.ClientsRouter
	CmsMediaRouter                *cms_media.CmsMediaRouter
	HeroContentsRouter            *hero_content.HeroContentsRouter
	HeroContentImagesRouter       *hero_content_image.HeroContentImagesRouter
	CustomStaticPagesRouter       *custom_static_pages.CustomStaticPagesRouter
	DistrictsRouter               *districts.DistrictsRouter
	FeedbacksRouter               *feedbacks.FeedbacksRouter
	MagazineFilesRouter           *magazine_files.MagazineFilesRouter
	MagazinesRouter               *magazines.MagazinesRouter
	MasterMenusRouter             *master_menus.MasterMenusRouter
	MasterModulesRouter           *master_modules.MasterModulesRouter
	OurProductContentsRouter      *our_product_contents.OurProductContentsRouter
	OurProductContentImagesRouter *our_product_content_images.OurProductContentImagesRouter
	OurServiceContentRouter       *our_service_contents.OurServiceContentsRouter
	OurServiceContentImagesRouter *our_service_content_images.OurServiceContentImagesRouter
	PopUpNewsContentsRouter       *popup_news_contents.PopupNewsContentsRouter
    PopUpNewsContentImagesRouter  *popup_news_content_images.PopupNewsContentImagesRouter
	ProvincesRouter               *provinces.ProvincesRouter
	SchedulesRouter               *schedules.SchedulesRouter
	SubscriptionRouter            *subscription.SubscriptionRouter
	PartnerContentRouter          *partner_contents.PartnerContentsRouter
	UserLevelsRouter              *user_levels.UserLevelsRouter
	UserRoleAccessesRouter        *user_role_accesses.UserRoleAccessesRouter
	UserRolesRouter               *user_roles.UserRolesRouter
	UsersRouter                   *users.UsersRouter
}

func NewRouter(
	fiber *fiber.App,
	cfg *config.Config,
    aboutUsContentsRouter *about_us_contents.AboutUsContentsRouter,
	aboutUsContentImagesRouter *about_us_content_images.AboutUsContentImageRouter,
	activityLogsRouter *activity_logs.ActivityLogsRouter,
	advertisementRouter *advertisement.AdvertisementRouter,
	approvalWorkflowsRouter *approval_workflows.ApprovalWorkflowsRouter,
	approvalWorkflowStepsRouter *approval_workflow_steps.ApprovalWorkflowStepsRouter,
	articleApprovalFlowsRouter *article_approval_flows.ArticleApprovalFlowsRouter,
	articleApprovalStepLogsRouter *article_approval_step_logs.ArticleApprovalStepLogsRouter,
	articleCategoriesRouter *article_categories.ArticleCategoriesRouter,
	articleCategoryDetailsRouter *article_category_details.ArticleCategoryDetailsRouter,
	articleFilesRouter *article_files.ArticleFilesRouter,
	articleCommentsRouter *article_comments.ArticleCommentsRouter,
	articleApprovalsRouter *article_approvals.ArticleApprovalsRouter,
	articlesRouter *articles.ArticlesRouter,
	articleNulisRouter *article_nulis_ai.ArticleNulisAIRouter,
	bookmarksRouter *bookmarks.BookmarksRouter,
	citiesRouter *cities.CitiesRouter,
	clientApprovalSettingsRouter *client_approval_settings.ClientApprovalSettingsRouter,
	clientsRouter *clients.ClientsRouter,
	cmsMediaRouter *cms_media.CmsMediaRouter,
	heroContentsRouter *hero_content.HeroContentsRouter,
	heroContentImagesRouter *hero_content_image.HeroContentImagesRouter,
	customStaticPagesRouter *custom_static_pages.CustomStaticPagesRouter,
	districtsRouter *districts.DistrictsRouter,
	feedbacksRouter *feedbacks.FeedbacksRouter,
	magazineFilesRouter *magazine_files.MagazineFilesRouter,
	magazinesRouter *magazines.MagazinesRouter,
	masterMenuRouter *master_menus.MasterMenusRouter,
	masterModuleRouter *master_modules.MasterModulesRouter,
	ourProductContentsRouter *our_product_contents.OurProductContentsRouter,
	ourProductContentImagesRouter *our_product_content_images.OurProductContentImagesRouter,
	ourServiceContentsRouter    *our_service_contents.OurServiceContentsRouter,
	ourServiceContentImagesRouter *our_service_content_images.OurServiceContentImagesRouter,
	partnerContentsRouter   *partner_contents.PartnerContentsRouter,
	popUpNewsContentsRouter *popup_news_contents.PopupNewsContentsRouter,
	popUpNewsContentImagesRouter *popup_news_content_images.PopupNewsContentImagesRouter,
	provincesRouter *provinces.ProvincesRouter,
	schedulesRouter *schedules.SchedulesRouter,
	subscriptionRouter *subscription.SubscriptionRouter,
	userLevelsRouter *user_levels.UserLevelsRouter,
	userRoleAccessesRouter *user_role_accesses.UserRoleAccessesRouter,
	userRolesRouter *user_roles.UserRolesRouter,
	usersRouter *users.UsersRouter,
) *Router {
	return &Router{
		App:                           fiber,
		Cfg:                           cfg,
		AboutUsContentsRouter:         aboutUsContentsRouter,
		AboutUsContentImageRouter:     aboutUsContentImagesRouter,
		ActivityLogsRouter:            activityLogsRouter,
		AdvertisementRouter:           advertisementRouter,
		ApprovalWorkflowsRouter:       approvalWorkflowsRouter,
		ApprovalWorkflowStepsRouter:   approvalWorkflowStepsRouter,
		ArticleApprovalFlowsRouter:    articleApprovalFlowsRouter,
		ArticleApprovalStepLogsRouter: articleApprovalStepLogsRouter,
		ArticleCategoriesRouter:       articleCategoriesRouter,
		ArticleCategoryDetailsRouter:  articleCategoryDetailsRouter,
		ArticleFilesRouter:            articleFilesRouter,
		ArticleCommentsRouter:         articleCommentsRouter,
		ArticleApprovalsRouter:        articleApprovalsRouter,
		ArticlesRouter:                articlesRouter,
		ArticleNulisAIRouter:          articleNulisRouter,
		BookmarksRouter:               bookmarksRouter,
		CitiesRouter:                  citiesRouter,
		ClientApprovalSettingsRouter:  clientApprovalSettingsRouter,
		ClientsRouter:                 clientsRouter,
		CmsMediaRouter:                cmsMediaRouter,
		HeroContentsRouter:             heroContentsRouter,
		HeroContentImagesRouter:        heroContentImagesRouter,
		CustomStaticPagesRouter:       customStaticPagesRouter,
		DistrictsRouter:               districtsRouter,
		FeedbacksRouter:               feedbacksRouter,
		MagazineFilesRouter:           magazineFilesRouter,
		MagazinesRouter:               magazinesRouter,
		MasterMenusRouter:             masterMenuRouter,
		MasterModulesRouter:           masterModuleRouter,
		OurProductContentsRouter:      ourProductContentsRouter,
		OurProductContentImagesRouter: ourProductContentImagesRouter,
		OurServiceContentRouter:       ourServiceContentsRouter,
		OurServiceContentImagesRouter:  ourServiceContentImagesRouter,
		PartnerContentRouter:          partnerContentsRouter,
		PopUpNewsContentsRouter:       popUpNewsContentsRouter,
		PopUpNewsContentImagesRouter:  popUpNewsContentImagesRouter,
		ProvincesRouter:               provincesRouter,
		SchedulesRouter:               schedulesRouter,
		SubscriptionRouter:            subscriptionRouter,
		UserLevelsRouter:              userLevelsRouter,
		UserRoleAccessesRouter:        userRoleAccessesRouter,
		UserRolesRouter:               userRolesRouter,
		UsersRouter:                   usersRouter,
	}
}

// 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.AboutUsContentsRouter.RegisterAboutUsContentsRoutes()
	r.AboutUsContentImageRouter.RegisterAboutUsContentImageRoutes()
	r.AdvertisementRouter.RegisterAdvertisementRoutes()
	r.ApprovalWorkflowsRouter.RegisterApprovalWorkflowsRoutes()
	r.ApprovalWorkflowStepsRouter.RegisterApprovalWorkflowStepsRoutes()
	r.ArticleApprovalFlowsRouter.RegisterArticleApprovalFlowsRoutes()
	r.ArticleApprovalStepLogsRouter.RegisterArticleApprovalStepLogsRoutes()
	r.ArticleCategoriesRouter.RegisterArticleCategoriesRoutes()
	r.ArticleCategoryDetailsRouter.RegisterArticleCategoryDetailsRoutes()
	r.ArticleFilesRouter.RegisterArticleFilesRoutes()
	r.ArticleApprovalsRouter.RegisterArticleApprovalsRoutes()
	r.ArticlesRouter.RegisterArticlesRoutes()
	r.ArticleCommentsRouter.RegisterArticleCommentsRoutes()
	r.ArticleNulisAIRouter.RegisterArticleNulisAIRoutes()
	r.BookmarksRouter.RegisterBookmarksRoutes()
	r.CitiesRouter.RegisterCitiesRoutes()
	r.ClientApprovalSettingsRouter.RegisterClientApprovalSettingsRoutes()
	r.ClientsRouter.RegisterClientsRoutes()
	r.CmsMediaRouter.RegisterCmsMediaRoutes()
	r.HeroContentsRouter.RegisterHeroContentsRoutes()
	r.HeroContentImagesRouter.RegisterHeroContentImagesRoutes()
	r.CustomStaticPagesRouter.RegisterCustomStaticPagesRoutes()
	r.DistrictsRouter.RegisterDistrictsRoutes()
	r.FeedbacksRouter.RegisterFeedbacksRoutes()
	r.MagazinesRouter.RegisterMagazinesRoutes()
	r.MagazineFilesRouter.RegisterMagazineFilesRoutes()
	r.MasterMenusRouter.RegisterMasterMenusRoutes()
	r.MasterModulesRouter.RegisterMasterModulesRoutes()
	r.OurProductContentsRouter.RegisterOurProductContentsRoutes()
	r.OurProductContentImagesRouter.RegisterOurProductContentImagesRoutes()
	r.OurServiceContentRouter.RegisterOurServiceContentsRoutes()
	r.OurServiceContentImagesRouter.RegisterOurServiceContentImagesRoutes()
	r.PartnerContentRouter.RegisterPartnerContentsRoutes()
	r.PopUpNewsContentsRouter.RegisterPopupNewsContentsRoutes()
	r.PopUpNewsContentImagesRouter.RegisterPopupNewsContentImagesRoutes()
	r.ProvincesRouter.RegisterProvincesRoutes()
	r.SchedulesRouter.RegisterSchedulesRoutes()
	r.SubscriptionRouter.RegisterSubscriptionRoutes()
	r.UserLevelsRouter.RegisterUserLevelsRoutes()
	r.UserRoleAccessesRouter.RegisterUserRoleAccessesRoutes()
	r.UsersRouter.RegisterUsersRoutes()
	r.UserRolesRouter.RegisterUserRolesRoutes()
}

