package gateway import ( "net/http" "github.com/tech/sendico/gateway/mntx/internal/service/monetix" "github.com/tech/sendico/pkg/clock" msg "github.com/tech/sendico/pkg/messaging" gatewayv1 "github.com/tech/sendico/pkg/proto/common/gateway/v1" ) // Option configures optional service dependencies. type Option func(*Service) // WithClock injects a custom clock (useful for tests). func WithClock(c clock.Clock) Option { return func(s *Service) { if c != nil { s.clock = c } } } // WithProducer attaches a messaging producer to the service. func WithProducer(p msg.Producer) Option { return func(s *Service) { s.producer = p } } // WithHTTPClient injects a custom HTTP client (useful for tests). func WithHTTPClient(client *http.Client) Option { return func(s *Service) { if client != nil { s.httpClient = client } } } // WithMonetixConfig sets the Monetix connectivity options. func WithMonetixConfig(cfg monetix.Config) Option { return func(s *Service) { s.config = cfg } } // WithGatewayDescriptor sets the self-declared gateway instance descriptor. func WithGatewayDescriptor(descriptor *gatewayv1.GatewayInstanceDescriptor) Option { return func(s *Service) { if descriptor != nil { s.gatewayDescriptor = descriptor } } }