Commit Graph

10 Commits

Author SHA1 Message Date
hunteraraujo
1049a4d868 Add ApiSettingsViewModel for managing API base URL
Created a new ViewModel called ApiSettingsViewModel that is responsible for getting and setting the API's base URL. Utilized the shared_preferences package for persistent storage of the base URL.
2023-09-02 17:42:14 -07:00
hunteraraujo
7966b81e96 Update ViewModel classes for Chat and Task to handle structured responses
This commit updates the ViewModel classes for both Chat and Task to accommodate the new structured responses received from the API. These changes are essential for the correct functioning of the application as they deal with the new TaskResponse and Step objects.

Updates in ChatViewModel:
- Modified `fetchChatsForTask` to handle structured step data
- Updated how steps are retrieved and processed

Updates in TaskViewModel:
- Updated `fetchTasks` to use the new TaskResponse object
- Refactored task fetching and selection logic

These updates ensure that the ViewModel classes are aligned with the new structured API responses, improving data handling and UI updates.
2023-09-02 15:42:54 -07:00
hunteraraujo
deb84cc804 Remove mock data 2023-08-31 15:15:40 -07:00
hunteraraujo
5ae17d009b Update TaskViewModel to Use TaskService and Task API Integration
This commit includes a significant overhaul of the TaskViewModel to use the newly created TaskService and integrate it with the task API. Specifically:

- Removed dependency on mock data for tasks.
- Added real API calls through the TaskService for task operations like creating and fetching tasks.
- Updated createTask to return the ID of the newly created task.
- Updated fetchTasks method to fetch tasks from the API and update the local list.
- Updated selectTask to handle selection based on string IDs.

These changes make the TaskViewModel ready for real-world usage and remove dependencies on mock data.
2023-08-31 15:15:24 -07:00
hunteraraujo
651e112e3d Update ChatViewModel to Use ChatService and Step Model
This commit refactors the ChatViewModel to use the newly created ChatService and Step model for chat-related functionalities. The changes include:

- Replaced mock data source with real API calls via ChatService.
- Introduced _currentTaskId to keep track of the current task ID.
- Added fetchChatsForTask method to fetch steps related to the current task and populate the chat list.
- Implemented sendChatMessage to execute a step and add both user and agent messages to the chat list.

By making these changes, the ChatViewModel is now fully integrated with the backend services and models, thus enabling a more realistic and dynamic chat experience.
2023-08-31 15:11:03 -07:00
hunteraraujo
1436092a35 Implement ChatViewModel with tests and mock data
This commit introduces the ChatViewModel, which manages the business logic for chat interactions associated with tasks. The ViewModel communicates with a mock data source, offering functionalities like fetching chats for a specific task and sending chat messages.

In addition to the implementation, comprehensive tests for ChatViewModel have been provided to ensure its behavior is consistent with our design goals and expectations.

Key Features:

Chat management in ChatViewModel.
Tests covering all major functionalities of ChatViewModel.
Mock data source updates to emulate chat data interactions.
2023-08-22 07:33:54 +02:00
hunteraraujo
5b520eb5ae Implement TaskViewModel with tests and mock data
This commit introduces the TaskViewModel, which manages the business logic for tasks. The ViewModel interacts with a mock data source, providing functionalities like fetching tasks, selecting a task, creating, and deleting tasks.

Additionally, comprehensive tests for TaskViewModel have been added to ensure its behavior aligns with expectations. The mock data source has also been updated to support the new functionalities.

Key Features:
- Task management in TaskViewModel.
- Tests for each major functionality in TaskViewModel.
- Mock data source to simulate data interactions.
2023-08-21 00:03:39 +02:00
hunteraraujo
d505724e90 Update agent to task 2023-08-20 19:20:56 +02:00
hunteraraujo
66cf84b007 Remove settings view 2023-08-20 10:31:15 +02:00
hunteraraujo
b6a9d905f1 Stub files per design document 2023-08-15 15:05:34 +02:00