Skip to content

refactor: extract SearchProductsUseCase from SearchViewModel for SRP … - #11

Merged
Prajwal-4121998 merged 1 commit into
developfrom
feature/search-usecase-extraction
Jul 28, 2026
Merged

Prajwal-4121998 merged 1 commit into
developfrom
feature/search-usecase-extraction

Conversation

@Prajwal-4121998

Copy link
Copy Markdown
Owner

…compliance

refactor: extract SearchProductsUseCase

Follow-up to feature/search. Moves filter-matching logic (title/category
substring match) out of SearchViewModel into a new domain use case,
SearchProductsUseCase, for SRP compliance — ViewModel should orchestrate
state, not own business rules about what constitutes a search match.

Test suite split accordingly: SearchProductsUseCaseTest covers matching
correctness in isolation (no mocking needed), SearchViewModelTest now mocks
the use case and covers only ViewModel-level concerns (debounce timing,
state transitions, recent searches, effects).

No behavior change from a user's perspective — this is a pure architecture
improvement.

@Prajwal-4121998
Prajwal-4121998 merged commit 8630e76 into develop Jul 28, 2026
6 checks 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.

1 participant