From 2344ef0710394d75e6535d3f1f25e119542b680d Mon Sep 17 00:00:00 2001 From: nutcas3 Date: Sun, 3 May 2026 09:50:51 +0300 Subject: [PATCH] feat: Add logger dependency to SelectionService and refactor handler initialization - Add logrus import and logger initialization in NewSelectionIntegration - Pass logger instance to NewSelectionService constructor - Replace selectionService.GetHandler() with direct handlers.NewSelectionHandler(manager) call --- .../internal/integration/selection_integration.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/carrier-connector/internal/integration/selection_integration.go b/apps/carrier-connector/internal/integration/selection_integration.go index 7ff4977..4838a3b 100644 --- a/apps/carrier-connector/internal/integration/selection_integration.go +++ b/apps/carrier-connector/internal/integration/selection_integration.go @@ -10,6 +10,7 @@ import ( "github.com/nutcas3/telecom-platform/apps/carrier-connector/internal/repository" "github.com/nutcas3/telecom-platform/apps/carrier-connector/internal/services" "github.com/nutcas3/telecom-platform/apps/carrier-connector/internal/smdp" + "github.com/sirupsen/logrus" ) type SelectionIntegration struct { @@ -33,7 +34,8 @@ func NewSelectionIntegration(repo *repository.PostgresProfileStore) *SelectionIn manager := smdp.NewSMDPManager(repo, config) // Create selection service - selectionService := services.NewSelectionService(manager) + logger := logrus.New() + selectionService := services.NewSelectionService(manager, logger) // Create SMDP service smdpService := services.NewSMDPService(repo) @@ -41,7 +43,7 @@ func NewSelectionIntegration(repo *repository.PostgresProfileStore) *SelectionIn return &SelectionIntegration{ manager: manager, selectionService: selectionService, - selectionHandler: selectionService.GetHandler(), + selectionHandler: handlers.NewSelectionHandler(manager), smdpService: smdpService, } }