26 Commits

Author SHA1 Message Date
89ce2e1afa fix(manage): use account-scoped device sync and remove mock device source
Preserve Manage device state across resume while preventing cross-account cache leaks by tracking synced user IDs and clearing stale local device data on account changes. Replace the mock device remote data source with Apollo-backed API queries/mutations using me.locations so Manage only shows devices belonging to the authenticated user.

Made-with: Cursor
2026-04-07 18:04:42 +02:00
0a79ee5e04 Fix city selection vs dashboard; Map/Manage updates; workspace and API logging
Made-with: Cursor
2026-04-06 23:49:35 +02:00
34ad7e4af7 feat(sdk): AuthGoogleApp mutation and Google ID token auth without Firebase
Made-with: Cursor
2026-04-06 22:48:37 +02:00
9165d26b72 refactor(auth): token store, Apollo auth, and email UI
Update ApiTokenStore, AuthServiceImpl, and interceptor; adjust login/register screens, dashboard, chart, and Firebase auth tests.

Made-with: Cursor
2026-04-06 22:20:13 +02:00
d34b3bf70e feat(map): load device time series for map panel chart
Add LocationTimeSeries GraphQL query and DeviceTimeSeriesRepository.

Extend DevicePanelState with chart data/loading/offset; MapViewModel fetches via location _id and maps with DashboardChartMapper.

Wire MapScreen preview with sample chart data.

Made-with: Cursor
2026-04-06 22:20:04 +02:00
9cbc521a0d fix(city): persist full city list and re-emit dashboard context on re-selection
- Map cityList rows without coordinates; fall back en/ru/be for display names
- Replace local city cache on sync when opening city screen
- Use SharedFlow + prefs reads so re-selecting the same city (e.g. Minsk) notifies dashboard

Made-with: Cursor
2026-04-06 22:19:42 +02:00
ac334db940 Harden Google sign-in when backend auth fails
Sign out of Firebase and clear API and local profile if the GraphQL exchange or token save fails after Firebase Google sign-in, so the user is not left in a half-authenticated state. Rename the exchange helper to exchangeFirebaseIdTokenWithBackend for clarity.

Login: ignore duplicate Google taps while loading and disable the Google button during the flow. Credential Manager: treat GetCredentialInterruptedException as cancellation and rethrow CancellationException so coroutines cancel correctly.

Tests: assert signOut is invoked when the backend exchange fails.
Made-with: Cursor
2026-04-06 20:50:20 +02:00
9869ad2476 feat(auth): email sign-in and register via GraphQL
Add loginLocal and register Apollo mutations, LocalEmailAuthStore for profile snapshot when not using Firebase, extend AuthService/FirebaseAuthService with session handoff vs Google, wire EmailLoginViewModel, refresh Manage on resume, and expand unit tests.

Made-with: Cursor
2026-04-06 19:30:31 +02:00
df4e6f9c56 feat(dashboard): city average GraphQL, metrics repository, and wiring
Adds CityAverage operations and DashboardMetricsRepository, extends CityService, updates dashboard contract/VM and chart mapping, refreshes schema, tweaks map screen and Apollo logging, and adds debug manifest.

Made-with: Cursor
2026-04-06 17:02:19 +02:00
ca3804195d chore(sdk): point GraphQL API to apitest.tartak.by
Made-with: Cursor
2026-03-23 22:53:08 +01:00
11a515b588 feat: implement city selection flow with auto-detect 2026-03-16 16:45:13 +01:00
88ebc14d24 feat: add location dependencies and permissions 2026-03-16 16:44:58 +01:00
0519936531 feat(device): add visibility/luftdata/narodmon settings, device model icons, SDK refactor
- Add SetDeviceVisibilityUseCase, SetLuftdataUseCase, SetNarodmonUseCase

- Introduce DeviceModel enum (Basic, Mobile, Solar, Radiation, Custom)

- Add device-type drawables (active/inactive icons for each model)

- Refactor Device SDK: repository, DAO, database, local/remote data sources

- Update DeviceSettingsScreen, ManageViewModel, theme colors

- Add/update string resources (default, ru, be)

Made-with: Cursor
2026-03-06 20:01:24 +01:00
e59e5aa060 feat(device): implement Device feature with SSOT, offline support, and settings screen
- Add domain layer: Device, PendingMutation, DeviceRepository
- Add Room DB: DeviceEntity, PendingMutationEntity, DAOs, DeviceLocalDataSource
- Add mock DeviceRemoteDataSource and DeviceSubscriptionManager
- Implement DeviceRepositoryImpl with optimistic updates and mutation queue
- Add UseCases: GetMyDevices, Rename, SetLocation, SetDataSharing, TriggerFirmware
- Implement DeviceSettingsScreen with rename, location, data sharing, firmware
- Wire ManageScreen to GetMyDevicesUseCase and DeviceSubscriptionManager
- Update navigation to pass deviceId and show DeviceSettingsScreen
- Add Room 2.7.0-alpha11 and Room dependencies to SDK

Made-with: Cursor
2026-03-04 19:35:07 +01:00
31f723cbd6 Implement Google->Firebase->Backend auth flow
- Add authGoogleNew GraphQL mutation and token exchange in AuthServiceImpl
- Add ApiTokenStore and SharedPreferencesApiTokenStore for API token persistence
- Add ApolloAuthInterceptor to inject Bearer token on GraphQL requests
- Introduce FirebaseSessionManager for testable Firebase auth orchestration
- Update LoginViewModel to surface backend auth errors
- Add unit tests for Firebase failure, backend failure, and auth state

Made-with: Cursor
2026-03-02 20:19:54 +01:00
436e165679 Point SDK GraphQL to api-app and switch map markers query to getMarkers.
This aligns the app with the new backend endpoint/schema and keeps map marker mapping compatible with the new response shape.

Made-with: Cursor
2026-03-02 19:22:03 +01:00
28ad63fb4a Wire Firebase auth state into settings/logout and refresh Google sign-in config.
This updates the settings account section to show/logout based on authenticated user state, refines auth service naming, and aligns app signing/Firebase config changes needed for successful Google authentication.

Made-with: Cursor
2026-03-01 21:40:58 +01:00
91a9521f3e Implement Firebase Google sign-in with enum-based auth contracts.
Refactor AuthService to use AuthProvider and User, add Firebase-backed auth wiring for login/manage flows, and fix app-level Google services configuration so Credential Manager sign-in works reliably.

Made-with: Cursor
2026-03-01 21:15:09 +01:00
9885162c4e Add firebase project 2026-03-01 18:39:56 +01:00
1823d0bf1b Port manage/settings flows to Compose and wire settings persistence.
Add contract-driven state/action/event view models for manage and settings, migrate settings UI toward legacy preference rows (with anonymous stub behavior), and back SettingsServiceImpl with SharedPreferences for real toggle/city storage.

Made-with: Cursor
2026-03-01 15:00:34 +01:00
c155a3cc2e Expose per-setting SettingsService getters/setters and wire map offline visibility to GraphQL.
This moves offline filtering to the API query path so map data respects settings at source instead of client-side post-filtering.

Made-with: Cursor
2026-03-01 00:28:43 +01:00
920a832424 Implement legacy-style map markers with UI model mapping.
Replace default OSM pins with round value-based icons, add DTO-to-domain-to-UI marker mapping, and normalize no-value/offline styling while keeping ownership icon behavior stubbed for future auth integration.

Made-with: Cursor
2026-03-01 00:19:40 +01:00
02c33e5ad5 Update map marker mapping for locations query.
Switch MapMarkers handling from getMarkers to locations, and align mapper fields with the new Location payload while preserving MapItem coordinates and online status.

Made-with: Cursor
2026-02-28 23:09:09 +01:00
81627d6b7c Add Apollo-level logging and Kotlin-driven map filter.
Pass the map marker online filter as a GraphQL variable from Kotlin so offline-inclusive behavior is controllable in code, and add a shared Apollo interceptor to log each request payload and response outcome for all operations.

Made-with: Cursor
2026-02-28 22:44:27 +01:00
117caa9122 Add SDK service contracts for core infrastructure.
Introduce interface-only service APIs and feature models for auth, device, settings, notifications, connectivity, and telemetry to scaffold implementation without backend-specific naming.

Made-with: Cursor
2026-02-28 16:58:55 +01:00
6dedaf0e8b Add SDK map module and migrate map fetching to Apollo with Hilt wiring.
This includes the new sdk module, MapService + mapper implementation, Apollo provider module, Hilt app integration, and the project .gitignore update.

Made-with: Cursor
2026-02-28 16:58:22 +01:00