fix(mobile): URL changement mdp corrigée + v3.0 — multi-org, AppAuth, sécurité prod
Auth: - profile_repository.dart: /api/auth/change-password → /api/membres/auth/change-password Multi-org (Phase 3): - OrgSelectorPage, OrgSwitcherBloc, OrgSwitcherEntry - org_context_service.dart: headers X-Active-Organisation-Id + X-Active-Role Navigation: - MorePage: navigation conditionnelle par typeOrganisation - Suppression adaptive_navigation (remplacé par main_navigation_layout) Auth AppAuth: - keycloak_webview_auth_service: fixes AppAuth Android - AuthBloc: gestion REAUTH_REQUIS + premierLoginComplet Onboarding: - Nouveaux états: payment_method_page, onboarding_shared_widgets - SouscriptionStatusModel mis à jour StatutValidationSouscription Android: - build.gradle: ProGuard/R8, network_security_config - Gradle wrapper mis à jour
This commit is contained in:
@@ -25,7 +25,7 @@ enum StatutMembre {
|
||||
inactif,
|
||||
@JsonValue('SUSPENDU')
|
||||
suspendu,
|
||||
@JsonValue('EN_ATTENTE')
|
||||
@JsonValue('EN_ATTENTE_VALIDATION')
|
||||
enAttente,
|
||||
}
|
||||
|
||||
@@ -67,6 +67,10 @@ class MembreCompletModel extends Equatable {
|
||||
/// Téléphone
|
||||
final String? telephone;
|
||||
|
||||
/// Téléphone Wave (mobile money)
|
||||
@JsonKey(name: 'telephoneWave')
|
||||
final String? telephoneWave;
|
||||
|
||||
/// Date de naissance
|
||||
@JsonKey(name: 'dateNaissance')
|
||||
final DateTime? dateNaissance;
|
||||
@@ -100,6 +104,7 @@ class MembreCompletModel extends Equatable {
|
||||
final String? photo;
|
||||
|
||||
/// Statut du membre
|
||||
@JsonKey(name: 'statutCompte')
|
||||
final StatutMembre statut;
|
||||
|
||||
/// Rôle dans l'organisation
|
||||
@@ -148,6 +153,18 @@ class MembreCompletModel extends Equatable {
|
||||
@JsonKey(name: 'derniereActivite')
|
||||
final DateTime? derniereActivite;
|
||||
|
||||
/// Statut matrimonial (CELIBATAIRE, MARIE, DIVORCE, VEUF)
|
||||
@JsonKey(name: 'statutMatrimonial')
|
||||
final String? statutMatrimonial;
|
||||
|
||||
/// Type de pièce d'identité (CNI, PASSEPORT, PERMIS_CONDUIRE, TITRE_SEJOUR)
|
||||
@JsonKey(name: 'typeIdentite')
|
||||
final String? typeIdentite;
|
||||
|
||||
/// Numéro de pièce d'identité
|
||||
@JsonKey(name: 'numeroIdentite')
|
||||
final String? numeroIdentite;
|
||||
|
||||
/// Notes internes
|
||||
final String? notes;
|
||||
|
||||
@@ -184,6 +201,7 @@ class MembreCompletModel extends Equatable {
|
||||
required this.prenom,
|
||||
required this.email,
|
||||
this.telephone,
|
||||
this.telephoneWave,
|
||||
this.dateNaissance,
|
||||
this.genre,
|
||||
this.adresse,
|
||||
@@ -207,6 +225,9 @@ class MembreCompletModel extends Equatable {
|
||||
this.cotisationAJour = false,
|
||||
this.nombreEvenementsParticipes = 0,
|
||||
this.derniereActivite,
|
||||
this.statutMatrimonial,
|
||||
this.typeIdentite,
|
||||
this.numeroIdentite,
|
||||
this.notes,
|
||||
this.dateCreation,
|
||||
this.dateModification,
|
||||
@@ -231,6 +252,7 @@ class MembreCompletModel extends Equatable {
|
||||
String? prenom,
|
||||
String? email,
|
||||
String? telephone,
|
||||
String? telephoneWave,
|
||||
DateTime? dateNaissance,
|
||||
Genre? genre,
|
||||
String? adresse,
|
||||
@@ -254,6 +276,9 @@ class MembreCompletModel extends Equatable {
|
||||
bool? cotisationAJour,
|
||||
int? nombreEvenementsParticipes,
|
||||
DateTime? derniereActivite,
|
||||
String? statutMatrimonial,
|
||||
String? typeIdentite,
|
||||
String? numeroIdentite,
|
||||
String? notes,
|
||||
DateTime? dateCreation,
|
||||
DateTime? dateModification,
|
||||
@@ -269,6 +294,7 @@ class MembreCompletModel extends Equatable {
|
||||
prenom: prenom ?? this.prenom,
|
||||
email: email ?? this.email,
|
||||
telephone: telephone ?? this.telephone,
|
||||
telephoneWave: telephoneWave ?? this.telephoneWave,
|
||||
dateNaissance: dateNaissance ?? this.dateNaissance,
|
||||
genre: genre ?? this.genre,
|
||||
adresse: adresse ?? this.adresse,
|
||||
@@ -292,6 +318,9 @@ class MembreCompletModel extends Equatable {
|
||||
cotisationAJour: cotisationAJour ?? this.cotisationAJour,
|
||||
nombreEvenementsParticipes: nombreEvenementsParticipes ?? this.nombreEvenementsParticipes,
|
||||
derniereActivite: derniereActivite ?? this.derniereActivite,
|
||||
statutMatrimonial: statutMatrimonial ?? this.statutMatrimonial,
|
||||
typeIdentite: typeIdentite ?? this.typeIdentite,
|
||||
numeroIdentite: numeroIdentite ?? this.numeroIdentite,
|
||||
notes: notes ?? this.notes,
|
||||
dateCreation: dateCreation ?? this.dateCreation,
|
||||
dateModification: dateModification ?? this.dateModification,
|
||||
@@ -341,6 +370,7 @@ class MembreCompletModel extends Equatable {
|
||||
prenom,
|
||||
email,
|
||||
telephone,
|
||||
telephoneWave,
|
||||
dateNaissance,
|
||||
genre,
|
||||
adresse,
|
||||
@@ -364,6 +394,9 @@ class MembreCompletModel extends Equatable {
|
||||
cotisationAJour,
|
||||
nombreEvenementsParticipes,
|
||||
derniereActivite,
|
||||
statutMatrimonial,
|
||||
typeIdentite,
|
||||
numeroIdentite,
|
||||
notes,
|
||||
dateCreation,
|
||||
dateModification,
|
||||
|
||||
@@ -13,6 +13,7 @@ MembreCompletModel _$MembreCompletModelFromJson(Map<String, dynamic> json) =>
|
||||
prenom: json['prenom'] as String,
|
||||
email: json['email'] as String,
|
||||
telephone: json['telephone'] as String?,
|
||||
telephoneWave: json['telephoneWave'] as String?,
|
||||
dateNaissance: json['dateNaissance'] == null
|
||||
? null
|
||||
: DateTime.parse(json['dateNaissance'] as String),
|
||||
@@ -25,7 +26,7 @@ MembreCompletModel _$MembreCompletModelFromJson(Map<String, dynamic> json) =>
|
||||
profession: json['profession'] as String?,
|
||||
nationalite: json['nationalite'] as String?,
|
||||
photo: json['photo'] as String?,
|
||||
statut: $enumDecodeNullable(_$StatutMembreEnumMap, json['statut']) ??
|
||||
statut: $enumDecodeNullable(_$StatutMembreEnumMap, json['statutCompte']) ??
|
||||
StatutMembre.actif,
|
||||
role: json['role'] as String?,
|
||||
organisationId: json['organisationId'] as String?,
|
||||
@@ -46,6 +47,9 @@ MembreCompletModel _$MembreCompletModelFromJson(Map<String, dynamic> json) =>
|
||||
derniereActivite: json['derniereActivite'] == null
|
||||
? null
|
||||
: DateTime.parse(json['derniereActivite'] as String),
|
||||
statutMatrimonial: json['statutMatrimonial'] as String?,
|
||||
typeIdentite: json['typeIdentite'] as String?,
|
||||
numeroIdentite: json['numeroIdentite'] as String?,
|
||||
notes: json['notes'] as String?,
|
||||
dateCreation: json['dateCreation'] == null
|
||||
? null
|
||||
@@ -70,6 +74,7 @@ Map<String, dynamic> _$MembreCompletModelToJson(MembreCompletModel instance) =>
|
||||
'prenom': instance.prenom,
|
||||
'email': instance.email,
|
||||
'telephone': instance.telephone,
|
||||
'telephoneWave': instance.telephoneWave,
|
||||
'dateNaissance': instance.dateNaissance?.toIso8601String(),
|
||||
'genre': _$GenreEnumMap[instance.genre],
|
||||
'adresse': instance.adresse,
|
||||
@@ -80,7 +85,7 @@ Map<String, dynamic> _$MembreCompletModelToJson(MembreCompletModel instance) =>
|
||||
'profession': instance.profession,
|
||||
'nationalite': instance.nationalite,
|
||||
'photo': instance.photo,
|
||||
'statut': _$StatutMembreEnumMap[instance.statut]!,
|
||||
'statutCompte': _$StatutMembreEnumMap[instance.statut]!,
|
||||
'role': instance.role,
|
||||
'organisationId': instance.organisationId,
|
||||
'organisationNom': instance.organisationNom,
|
||||
@@ -93,6 +98,9 @@ Map<String, dynamic> _$MembreCompletModelToJson(MembreCompletModel instance) =>
|
||||
'cotisationAJour': instance.cotisationAJour,
|
||||
'nombreEvenementsParticipes': instance.nombreEvenementsParticipes,
|
||||
'derniereActivite': instance.derniereActivite?.toIso8601String(),
|
||||
'statutMatrimonial': instance.statutMatrimonial,
|
||||
'typeIdentite': instance.typeIdentite,
|
||||
'numeroIdentite': instance.numeroIdentite,
|
||||
'notes': instance.notes,
|
||||
'dateCreation': instance.dateCreation?.toIso8601String(),
|
||||
'dateModification': instance.dateModification?.toIso8601String(),
|
||||
@@ -115,7 +123,7 @@ const _$StatutMembreEnumMap = {
|
||||
StatutMembre.actif: 'ACTIF',
|
||||
StatutMembre.inactif: 'INACTIF',
|
||||
StatutMembre.suspendu: 'SUSPENDU',
|
||||
StatutMembre.enAttente: 'EN_ATTENTE',
|
||||
StatutMembre.enAttente: 'EN_ATTENTE_VALIDATION',
|
||||
};
|
||||
|
||||
const _$NiveauVigilanceKycEnumMap = {
|
||||
|
||||
@@ -240,7 +240,7 @@ class MembreRepositoryImpl implements IMembreRepository {
|
||||
@override
|
||||
Future<MembreCompletModel> activateMembre(String id) async {
|
||||
try {
|
||||
final response = await _apiClient.post('$_baseUrl/$id/activer');
|
||||
final response = await _apiClient.put('$_baseUrl/$id/activer');
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return MembreCompletModel.fromJson(response.data as Map<String, dynamic>);
|
||||
@@ -257,7 +257,7 @@ class MembreRepositoryImpl implements IMembreRepository {
|
||||
@override
|
||||
Future<MembreCompletModel> deactivateMembre(String id) async {
|
||||
try {
|
||||
final response = await _apiClient.post('$_baseUrl/$id/desactiver');
|
||||
final response = await _apiClient.put('$_baseUrl/$id/desactiver');
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return MembreCompletModel.fromJson(response.data as Map<String, dynamic>);
|
||||
@@ -339,5 +339,114 @@ class MembreRepositoryImpl implements IMembreRepository {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MembreCompletModel> resetMotDePasse(String id) async {
|
||||
try {
|
||||
final response = await _apiClient.put('$_baseUrl/$id/reinitialiser-mot-de-passe');
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return MembreCompletModel.fromJson(response.data as Map<String, dynamic>);
|
||||
} else {
|
||||
throw Exception('Erreur lors de la réinitialisation du mot de passe: ${response.statusCode}');
|
||||
}
|
||||
} on DioException {
|
||||
rethrow;
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MembreCompletModel> affecterOrganisation(String membreId, String organisationId) async {
|
||||
try {
|
||||
final response = await _apiClient.put(
|
||||
'$_baseUrl/$membreId/affecter-organisation',
|
||||
queryParameters: {'organisationId': organisationId},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return MembreCompletModel.fromJson(response.data as Map<String, dynamic>);
|
||||
} else {
|
||||
throw Exception('Erreur lors de l\'affectation à l\'organisation: ${response.statusCode}');
|
||||
}
|
||||
} on DioException {
|
||||
rethrow;
|
||||
} catch (e) {
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
// ── Cycle de vie des adhésions ────────────────────────────────────────────
|
||||
|
||||
@override
|
||||
Future<Map<String, dynamic>> inviterMembre(
|
||||
String membreId,
|
||||
String organisationId, {
|
||||
String? roleOrg,
|
||||
}) async {
|
||||
final response = await _apiClient.put(
|
||||
'$_baseUrl/$membreId/inviter-organisation',
|
||||
queryParameters: {
|
||||
'organisationId': organisationId,
|
||||
if (roleOrg != null) 'roleOrg': roleOrg,
|
||||
},
|
||||
);
|
||||
if (response.statusCode == 200) {
|
||||
return Map<String, dynamic>.from(response.data as Map);
|
||||
}
|
||||
throw Exception('Invitation échouée: ${response.statusCode}');
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Map<String, dynamic>> activerAdhesion(
|
||||
String membreId,
|
||||
String organisationId, {
|
||||
String? motif,
|
||||
}) async {
|
||||
final response = await _apiClient.put(
|
||||
'$_baseUrl/$membreId/adhesion/activer',
|
||||
queryParameters: {'organisationId': organisationId},
|
||||
data: motif != null ? {'motif': motif} : <String, dynamic>{},
|
||||
);
|
||||
if (response.statusCode == 200) {
|
||||
return Map<String, dynamic>.from(response.data as Map);
|
||||
}
|
||||
throw Exception('Activation échouée: ${response.statusCode}');
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Map<String, dynamic>> suspendrAdhesion(
|
||||
String membreId,
|
||||
String organisationId, {
|
||||
String? motif,
|
||||
}) async {
|
||||
final response = await _apiClient.put(
|
||||
'$_baseUrl/$membreId/adhesion/suspendre',
|
||||
queryParameters: {'organisationId': organisationId},
|
||||
data: motif != null ? {'motif': motif} : <String, dynamic>{},
|
||||
);
|
||||
if (response.statusCode == 200) {
|
||||
return Map<String, dynamic>.from(response.data as Map);
|
||||
}
|
||||
throw Exception('Suspension échouée: ${response.statusCode}');
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Map<String, dynamic>> radierAdhesion(
|
||||
String membreId,
|
||||
String organisationId, {
|
||||
String? motif,
|
||||
}) async {
|
||||
final response = await _apiClient.put(
|
||||
'$_baseUrl/$membreId/adhesion/radier',
|
||||
queryParameters: {'organisationId': organisationId},
|
||||
data: motif != null ? {'motif': motif} : <String, dynamic>{},
|
||||
);
|
||||
if (response.statusCode == 200) {
|
||||
return Map<String, dynamic>.from(response.data as Map);
|
||||
}
|
||||
throw Exception('Radiation échouée: ${response.statusCode}');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user