feat(backend): Wahl-Phasen, Verantwortliche-Invites, Auth fixes
- New VerantwortlicheInvite model: LT-issued invites so a person can register as Gemeinde Verantwortliche(r) for a specific Gemeinde, skipping the self-registration approval step. - Wahl/Workshop/Teilnehmer gain phase support (phasenAnzahl, beschreibung), mirroring the WP plugin's multi-phase elections. Teilnehmer unique constraint now scoped per phase. - Auth: team login + guest auth adjustments, spec coverage. - sync.service.ts: register VerantwortlicheInvite as a synced model. - wahl.service.ts: submitTeilnehmer updated for the new phase-scoped unique key. - client: login/home screen rework, new theme.dart, FCM web tweaks. - .gitignore: ignore .DS_Store. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+10
-4
@@ -450,8 +450,14 @@ class Api {
|
||||
return j['accessToken'] as String;
|
||||
}
|
||||
|
||||
Future<String> teamLogin(String email, String password) async {
|
||||
final j = await _post('/auth/team-login', {'email': email, 'password': password});
|
||||
/// Logs a Gemeinde Teamer in by Gemeinde name (the normal path) or by
|
||||
/// email (legacy/personal accounts) — pass exactly one of the two.
|
||||
Future<String> teamLogin({String? gemeindeName, String? email, required String password}) async {
|
||||
final j = await _post('/auth/team-login', {
|
||||
if (gemeindeName != null && gemeindeName.isNotEmpty) 'gemeindeName': gemeindeName,
|
||||
if (email != null && email.isNotEmpty) 'email': email,
|
||||
'password': password,
|
||||
});
|
||||
return j['accessToken'] as String;
|
||||
}
|
||||
|
||||
@@ -772,8 +778,8 @@ class AppState extends ChangeNotifier {
|
||||
Future<void> guestLogin(String code, String first, String last) =>
|
||||
_api.guestLogin(code, first, last).then(_establish);
|
||||
|
||||
Future<void> teamLogin(String email, String password) =>
|
||||
_api.teamLogin(email, password).then(_establish);
|
||||
Future<void> teamLogin({String? gemeindeName, String? email, required String password}) =>
|
||||
_api.teamLogin(gemeindeName: gemeindeName, email: email, password: password).then(_establish);
|
||||
|
||||
Future<void> redeemInvite({
|
||||
required String token,
|
||||
|
||||
Reference in New Issue
Block a user