package app

import (
	"tercul/internal/app/analytics"
	"tercul/internal/app/auth"
	"tercul/internal/app/author"
	"tercul/internal/app/authz"
	"tercul/internal/app/book"
	"tercul/internal/app/bookmark"
	"tercul/internal/app/category"
	"tercul/internal/app/collection"
	"tercul/internal/app/comment"
	"tercul/internal/app/contribution"
	"tercul/internal/app/like"
	"tercul/internal/app/localization"
	appsearch "tercul/internal/app/search"
	"tercul/internal/app/tag"
	"tercul/internal/app/translation"
	"tercul/internal/app/user"
	"tercul/internal/app/work"
)

// Application is a container for all the application-layer services.
type Application struct {
	Author       *author.Service
	Book         *book.Service
	Bookmark     *bookmark.Service
	Category     *category.Service
	Collection   *collection.Service
	Comment      *comment.Service
	Contribution *contribution.Service
	Like         *like.Service
	Tag          *tag.Service
	Translation  *translation.Service
	User         *user.Service
	Localization *localization.Service
	Auth         *auth.Service
	Authz        *authz.Service
	Work         *work.Service
	Search       appsearch.Service
	Analytics    analytics.Service
}

// NewApplication creates a new Application container from pre-built services.
func NewApplication(
	authorSvc *author.Service,
	bookSvc *book.Service,
	bookmarkSvc *bookmark.Service,
	categorySvc *category.Service,
	collectionSvc *collection.Service,
	commentSvc *comment.Service,
	contributionSvc *contribution.Service,
	likeSvc *like.Service,
	tagSvc *tag.Service,
	translationSvc *translation.Service,
	userSvc *user.Service,
	localizationSvc *localization.Service,
	authSvc *auth.Service,
	authzSvc *authz.Service,
	workSvc *work.Service,
	searchSvc appsearch.Service,
	analyticsSvc analytics.Service,
) *Application {
	return &Application{
		Author:       authorSvc,
		Book:         bookSvc,
		Bookmark:     bookmarkSvc,
		Category:     categorySvc,
		Collection:   collectionSvc,
		Comment:      commentSvc,
		Contribution: contributionSvc,
		Like:         likeSvc,
		Tag:          tagSvc,
		Translation:  translationSvc,
		User:         userSvc,
		Localization: localizationSvc,
		Auth:         authSvc,
		Authz:        authzSvc,
		Work:         workSvc,
		Search:       searchSvc,
		Analytics:    analyticsSvc,
	}
}