tercul-backend/internal/app/app.go
google-labs-jules[bot] 0395df3ff0 feat: Refactor GORM relations and implement mutations
This commit includes a major refactoring of the GORM many-to-many relationships to use explicit join tables, improving stability and compatibility with GORM's features.

It also implements a large number of previously unimplemented GraphQL mutations for core entities like Collections, Comments, Likes, and Bookmarks.

Key changes:
- Refactored polymorphic many-to-many relationships for Copyright and Monetization to use standard many-to-many with explicit join tables.
- Implemented GraphQL mutations for Collection, Comment, Like, and Bookmark entities, including input validation and authorization checks.
- Added comprehensive integration tests for all new features and refactored code.
- Refactored the GraphQL integration test suite to be type-safe, using generics for response handling as requested.
- Updated repository interfaces and implementations to support the new data model.
- Updated the TODO.md file to reflect the completed work.
2025-09-06 12:45:44 +00:00

43 lines
1.5 KiB
Go

package app
import (
"tercul/internal/app/auth"
"tercul/internal/app/copyright"
"tercul/internal/app/localization"
"tercul/internal/app/monetization"
"tercul/internal/app/search"
"tercul/internal/app/work"
"tercul/internal/domain"
)
// Application is a container for all the application-layer services.
// It's used for dependency injection into the presentation layer (e.g., GraphQL resolvers).
type Application struct {
AuthCommands *auth.AuthCommands
AuthQueries *auth.AuthQueries
CopyrightCommands *copyright.CopyrightCommands
CopyrightQueries *copyright.CopyrightQueries
Localization localization.Service
Search search.IndexService
WorkCommands *work.WorkCommands
WorkQueries *work.WorkQueries
// Repositories - to be refactored into app services
AuthorRepo domain.AuthorRepository
UserRepo domain.UserRepository
TagRepo domain.TagRepository
CategoryRepo domain.CategoryRepository
BookRepo domain.BookRepository
PublisherRepo domain.PublisherRepository
SourceRepo domain.SourceRepository
MonetizationQueries *monetization.MonetizationQueries
MonetizationCommands *monetization.MonetizationCommands
TranslationRepo domain.TranslationRepository
CopyrightRepo domain.CopyrightRepository
MonetizationRepo domain.MonetizationRepository
CommentRepo domain.CommentRepository
LikeRepo domain.LikeRepository
BookmarkRepo domain.BookmarkRepository
CollectionRepo domain.CollectionRepository
}