Skip to content

refactor(circle): replace untyped ...any DI with typed Dependencies struct - #316

Open
Chinonso-Peter wants to merge 6 commits into
cocor-tech:masterfrom
Chinonso-Peter:refactor/circle-typed-di
Open

refactor(circle): replace untyped ...any DI with typed Dependencies struct#316
Chinonso-Peter wants to merge 6 commits into
cocor-tech:masterfrom
Chinonso-Peter:refactor/circle-typed-di

Conversation

@Chinonso-Peter

@Chinonso-Peter Chinonso-Peter commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces the fragile NewService(repo, userRepo, dependencies ...any) variadic any signature with a typed Dependencies struct. This provides compile-time type safety and eliminates the runtime type-switch that was a footgun for future dependencies.

Changes

  • Added Dependencies struct with typed fields for all optional collaborators (CommunityChecker, Broadcaster, Transactor, AuditLogger, NotificationSvc)
  • Changed NewService to accept Dependencies instead of ...any
  • Updated all callers across service tests, handler tests, integration tests, attack vector tests, and main.go

Verification

  • go build ./internal/domain/circle/... passes
  • All 48 call sites updated to use the new signature
  • No ...any patterns remain in the circle service code

Closes #156

@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@Chinonso-Peter Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chinonso-Peter

Copy link
Copy Markdown
Contributor Author

Refreshing head ref after pushing CI fixes.

pipe.Del(ctx, fmt.Sprintf("session:%s", hash))
}
pipe.Del(ctx, userSessionsKey)
pipe.Exec(ctx)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(architecture): replace the fragile untyped dependencies ...any DI in circle service

3 participants