package servers

import (
	"service/internal/infrastructure/cache"
	"service/internal/infrastructure/config"
	"service/internal/infrastructure/database"

	"gorm.io/gorm"

	"service/internal/auth"
	roleMaster "service/internal/master/role/master"
	rolePages "service/internal/master/role/pages"
	rolePermission "service/internal/master/role/permission"
)

// MasterServices menampung kumpulan service untuk domain Master Data
type MasterServices struct {
	RolePages      rolePages.Service
	RolePermission rolePermission.Service
	RoleMaster     roleMaster.Service
}

// ServiceRegistry berfungsi sebagai Dependency Injection Container untuk transport HTTP.
// Struktur ini mencegah membengkaknya parameter pada saat inisialisasi API.
type ServiceRegistry struct {
	Config       *config.Config
	DBManager    database.Service
	PrimaryDB    *gorm.DB
	CacheManager *cache.Manager

	// Modul Aplikasi (Pisahkan berdasarkan Bounded Context)
	AuthService auth.Service
	Master      *MasterServices
}
