Muhamad_Syaroful_Anam/agrilinkvocpro/growth_recipe_feature
Cutiful 94b655481c feat: add ClusterViewModel for recommendation feature
This commit introduces `ClusterViewModel` to manage the state and logic for fetching growth recipe recommendations.

Key functionalities:
- Manages a `StateFlow` named `_state` to represent the current state of the recommendation request (Idle, Loading, Success, Error).
- Provides a public `state` flow for observing changes in the recommendation request.
- Implements a `getRecommendation()` function that:
    - Sets the state to `Loading`.
    - Calls the `getRecommendation()` method of the `ClusteringRepository`.
    - If successful and data is present, updates the state to `Success` with the last item from the response.
    - If the response is empty, updates the state to `Error` with a "Data tidak ditemukan" message.
    - Catches exceptions, maps them to user-friendly error messages, and updates the state to `Error`.
    - Logs detailed error messages if fetching data fails.
2025-07-10 18:18:07 +07:00
..
src feat: add ClusterViewModel for recommendation feature 2025-07-10 18:18:07 +07:00
.gitignore feat: add gitignore for dynamic feature modules 2025-06-05 13:14:12 +07:00
build.gradle.kts feat: update build.gradle.kts 2025-06-12 08:45:59 +07:00