fix(services): Fix service startup failures

- Remove duplicate CoreModule() calls from all service main.go files
  - NewContainer() already includes CoreModule() automatically
  - This was causing duplicate ConfigProvider provider errors

- Update all _fx.go files to use *database.Client instead of *ent.Client
  - database.Client embeds *ent.Client, so it can be used directly
  - This fixes type mismatches between providers and consumers
  - Keep ent import for constants like ent.Desc

- All services now build and should start successfully
This commit is contained in:
2025-11-06 20:56:37 +01:00
parent 2f2a14f2c5
commit dfe460cb03
11 changed files with 1215 additions and 12 deletions

View File

@@ -12,7 +12,7 @@ import (
"time"
authv1 "git.dcentral.systems/toolz/goplt/api/proto/generated/auth/v1"
"git.dcentral.systems/toolz/goplt/internal/ent"
"git.dcentral.systems/toolz/goplt/internal/infra/database"
"git.dcentral.systems/toolz/goplt/pkg/config"
"git.dcentral.systems/toolz/goplt/pkg/logger"
"git.dcentral.systems/toolz/goplt/pkg/services"
@@ -34,7 +34,7 @@ const (
// authService provides authentication functionality.
type authService struct {
client *ent.Client
client *database.Client
logger logger.Logger
identityClient services.IdentityServiceClient
jwtSecret []byte
@@ -303,7 +303,7 @@ func provideAuthService() fx.Option {
return fx.Options(
// Auth service
fx.Provide(func(
client *ent.Client,
client *database.Client,
log logger.Logger,
identityClient services.IdentityServiceClient,
cfg config.ConfigProvider,