Rejection retry flow with configurable wait days
- Usuario model: proRejectedAt parsed from professionals.updated_at - _StatusCard: shows countdown or retry button based on rejection_wait_days setting - Retry clears the rejected record via DELETE /professionals/me Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
9634aa13ff
commit
391c32f765
@@ -11,6 +11,7 @@ class Usuario {
|
||||
final String? birthday;
|
||||
final String? gender;
|
||||
final ProState proState;
|
||||
final DateTime? proRejectedAt;
|
||||
final String? token;
|
||||
final bool isPhoneVerified;
|
||||
|
||||
@@ -26,6 +27,7 @@ class Usuario {
|
||||
required this.gender,
|
||||
required this.proState,
|
||||
required this.token,
|
||||
this.proRejectedAt,
|
||||
this.isPhoneVerified = false,
|
||||
});
|
||||
|
||||
@@ -57,11 +59,24 @@ class Usuario {
|
||||
birthday: doc['birthday'],
|
||||
gender: doc['gender'],
|
||||
proState: intToEnum((doc['professional_state'] as int?) ?? 0),
|
||||
proRejectedAt: _parseRejectedAt(doc),
|
||||
token: doc['token'],
|
||||
isPhoneVerified: doc['is_phone_verified'] as bool? ?? false,
|
||||
);
|
||||
}
|
||||
|
||||
static DateTime? _parseRejectedAt(Map<String, dynamic> doc) {
|
||||
// /auth/me returns professionals nested; if pro_state==3 use professionals.updated_at
|
||||
final state = (doc['professional_state'] as int?) ?? 0;
|
||||
if (state != 3) return null;
|
||||
final pros = doc['professionals'];
|
||||
if (pros is Map) {
|
||||
final raw = pros['updated_at'];
|
||||
if (raw is String) return DateTime.tryParse(raw);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'User(id: $id, email: $email, phone: $phone, name: $name, nickname: $nickname, city: $city, picture: $picture, birthday: $birthday, gender: $gender, proState: $proState, token: $token)';
|
||||
|
||||
Reference in New Issue
Block a user