fix: geocode tool repository interface cast

This commit is contained in:
Tiago Ribeiro 2026-03-09 09:27:32 -03:00
parent 68948e3c96
commit e8586826bc

View file

@ -29,8 +29,10 @@ func main() {
mapboxClient := mapbox.New(cfg.MapboxAccessToken)
notifySvc := notifications.NewLoggerNotificationService()
// Correct parameters for NewService: repo, pay, mapbox, notify, commission, buyerFee, jwtSecret, ttl, pepper
svc := usecase.NewService(repo, nil, mapboxClient, notifySvc, 12.0, 0.06, cfg.JWTSecret, cfg.JWTExpiresIn, cfg.PasswordPepper)
// Ensure we cast repo to usecase.Repository interface explicitly if needed, but Go does this implicitly if methods match.
// NewService expects: Repository, PaymentGateway, *mapbox.Client, NotificationService, ...
var repoInterface usecase.Repository = repo
svc := usecase.NewService(repoInterface, nil, mapboxClient, notifySvc, 12.0, 0.06, cfg.JWTSecret, cfg.JWTExpiresIn, cfg.PasswordPepper)
fmt.Println("Starting retroactive geocode sync...")
count, err := svc.GeocodeAllAddresses(context.Background())