Move all remaining usecases to :core:domain - #3902
Merged
Merged
Conversation
Relocate MakeSurveyAvailableOfflineUseCase, ActivateSurveyUseCase, and ReactivateLastSurveyUseCase to :core:domain. Expose lastActiveSurveyId and isSurveyActive on SurveyRepositoryInterface to decouple use cases from Android-specific LocalValueStore. Add fast, pure KMP unit tests and remove legacy Robolectric tests.
…SurveysUseCase to :core:domain Abstract network state behind NetworkManagerInterface in :core:domain and provide FakeNetworkManager in :core:testing. Relocate ListAvailableSurveysUseCase to :core:domain, decoupling it from Android framework connectivity APIs. Update SurveySelectorFragmentTest to test through real use cases.
…odels Update UserRepository, TermsOfServiceRepository, SignInViewModel, and OfflineAreaSelectorViewModel to depend on NetworkManagerInterface rather than the Android platform implementation. Modernize SignInViewModelTest and OfflineAreaSelectorViewModelTest to use FakeNetworkManager instead of Mockito stubs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3902 +/- ##
============================================
- Coverage 69.02% 68.99% -0.03%
+ Complexity 1944 1943 -1
============================================
Files 411 412 +1
Lines 10966 10963 -3
Branches 1428 1429 +1
============================================
- Hits 7569 7564 -5
- Misses 2652 2654 +2
Partials 745 745
🚀 New features to boost your workflow:
|
andreia-ferreira
approved these changes
Aug 26, 2026
shobhitagarwal1612
requested a deployment
to
e2e-approval
August 26, 2026 15:55 — with
GitHub Actions
Queued
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Towards #3633
Migrates all survey use cases from
:appto:core:domain(KMP) and abstracts network connectivity behind an interface.Key changes:
ActivateSurveyUseCase,MakeSurveyAvailableOfflineUseCase,ReactivateLastSurveyUseCase, andListAvailableSurveysUseCaseto:core:domain.NetworkManagerInterfacein:core:domainandFakeNetworkManagerin:core:testing, decoupling use cases and repositories from Android connectivity APIs.lastActiveSurveyIdandisSurveyActive()onSurveyRepositoryInterfaceto remove use case dependencies on Android'sLocalValueStore.:core:domain:commonTest, and modernized ViewModel tests to useFakeNetworkManager.@andreia-ferreira PTAL?