tercul-backend/internal/app/app.go
Damir Mukimov d50722dad5
Some checks failed
Test / Integration Tests (push) Successful in 4s
Build / Build Binary (push) Failing after 2m9s
Docker Build / Build Docker Image (push) Failing after 2m32s
Test / Unit Tests (push) Failing after 3m12s
Lint / Go Lint (push) Failing after 1m0s
Refactor ID handling to use UUIDs across the application
- Updated database models and repositories to replace uint IDs with UUIDs.
- Modified test fixtures to generate and use UUIDs for authors, translations, users, and works.
- Adjusted mock implementations to align with the new UUID structure.
- Ensured all relevant functions and methods are updated to handle UUIDs correctly.
- Added necessary imports for UUID handling in various files.
2025-12-27 00:33:34 +01:00

84 lines
2.3 KiB
Go

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,
}
}