android: add chats api and cache-first repository sync

This commit is contained in:
Codex
2026-03-08 22:27:50 +03:00
parent f838fe1d5d
commit d006998867
10 changed files with 257 additions and 0 deletions

View File

@@ -30,3 +30,10 @@
- Added Room entities: `chats`, `users_short` with sort-friendly indices.
- Added `ChatDao` with `observeChats()`, `upsertChats()`, and transactional `clearAndReplaceChats()`.
- Added `MessengerDatabase` and Hilt database wiring (`DatabaseModule`).
### Step 6 - Chat API and repository sync
- Added chat REST API client for `/api/v1/chats` and `/api/v1/chats/{chat_id}`.
- Added chat DTOs and remote/local mappers (`ChatReadDto -> ChatEntity/UserShortEntity -> ChatItem`).
- Implemented `NetworkChatRepository` with cache-first flow strategy (Room first, then server sync).
- Added chat domain contracts/use-cases (`ChatRepository`, observe/refresh use-cases).
- Wired chat API/repository via Hilt modules.