Skip to content

Conversation

@iammukeshm
Copy link
Member

Summary

Add interfaces for RequestContextService and CurrentUserService to enable testing and follow dependency inversion principle.

Changes

  • ICurrentUserService - New interface in Contracts project combining ICurrentUser and ICurrentUserInitializer
  • IRequestContextService - New interface in Contracts project extending IRequestContext
  • Updated CurrentUserService to implement ICurrentUserService (internal sealed)
  • Updated RequestContextService to implement IRequestContextService (internal sealed)
  • Updated DI registration to use new interfaces while maintaining backward compatibility

Benefits

  • Enables mocking for unit testing
  • Follows dependency inversion principle
  • Consistent with other service interfaces in the Contracts project

Testing

  • All existing tests pass
  • Build succeeds with 0 errors

Closes #1180

…terfaces

- Create ICurrentUserService interface combining ICurrentUser and ICurrentUserInitializer
- Create IRequestContextService interface extending IRequestContext
- Update CurrentUserService to implement ICurrentUserService (internal sealed)
- Update RequestContextService to implement IRequestContextService (internal sealed)
- Update DI registration to register services with their new interfaces
- Maintain backward compatibility with existing ICurrentUser and IRequestContext consumers

Closes #1180
@iammukeshm iammukeshm merged commit b95efe9 into develop Jan 26, 2026
1 check passed
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.

[Architecture] Add interfaces for RequestContextService and CurrentUserService

2 participants