Feature: Shared lists & Invite Code invitation mechanism

- Backend:
  - Migration 000002: add invite_code column to lists & list_members auto-population
  - ListStore: GetLists/GetList check owner_id & list_members; add GetInviteCode & JoinByInviteCode
  - HTTP API: add POST /api/lists/{id}/invite & POST /api/lists/join
- Android App:
  - DTOs & MitbringslApi: add JoinListRequestDto, InviteCodeResponseDto & endpoints
  - ListsScreen & ViewModel: add 'Liste beitreten' action button & dialog for entering invite code
  - ListDetailScreen & ViewModel: add 'Liste teilen' action icon in top bar with System Share Sheet
- ADB reinstall & launch verified 
This commit is contained in:
Tronax 2026-08-05 20:36:43 +02:00
parent 47b24dfcdf
commit 69591df12a
Signed by: Tronax
SSH key fingerprint: SHA256:2pKKXDZucWvaF/GzXNz0FY53EAO1YDLN80bqS+TTz/o
11 changed files with 457 additions and 56 deletions

View file

@ -0,0 +1,13 @@
-- Add invite_code to lists table for sharing
ALTER TABLE lists ADD COLUMN IF NOT EXISTS invite_code TEXT UNIQUE;
-- Generate random 8-character invite code for lists that don't have one
UPDATE lists
SET invite_code = UPPER(SUBSTRING(MD5(RANDOM()::TEXT) FROM 1 FOR 8))
WHERE invite_code IS NULL;
-- Automatically insert owner into list_members on list creation if missing
INSERT INTO list_members (list_id, user_id, role)
SELECT id, owner_id, 'owner'
FROM lists
ON CONFLICT (list_id, user_id) DO NOTHING;