Submit customer identity proofs and show reviewed limits
This commit is contained in:
1 parent
7bf8b8087a
commit
1354551ae8
50 files changed
+1777
-67
No files matched your search
@@ -36,16 +36,40 @@ class Identity {
|
||||
this.reason,
|
||||
this.submissionId,
|
||||
this.simulated = false,
|
||||
this.profile = const IdentityProfile(),
|
||||
this.upgradePending = false,
|
||||
});
|
||||
final IdentityStatus status;
|
||||
final ReviewReason? reason;
|
||||
final String? submissionId;
|
||||
final bool simulated;
|
||||
final IdentityProfile profile;
|
||||
final bool upgradePending;
|
||||
bool get canSubmit =>
|
||||
status == IdentityStatus.unverified ||
|
||||
status == IdentityStatus.changesRequested;
|
||||
}
|
||||
|
||||
/// Customer assertions awaiting human review, distinct from a verified identity.
|
||||
class IdentityProfile {
|
||||
const IdentityProfile({
|
||||
this.fullName = '',
|
||||
this.dateOfBirth = '',
|
||||
this.residenceCountry = '',
|
||||
});
|
||||
final String fullName, dateOfBirth, residenceCountry;
|
||||
bool get isComplete {
|
||||
final date = DateTime.tryParse(dateOfBirth);
|
||||
return fullName.trim().isNotEmpty &&
|
||||
fullName.length <= 200 &&
|
||||
RegExp(r'^\d{4}-\d{2}-\d{2}$').hasMatch(dateOfBirth) &&
|
||||
date != null &&
|
||||
date.toIso8601String().startsWith(dateOfBirth) &&
|
||||
date.isBefore(DateTime.now()) &&
|
||||
RegExp(r'^[A-Z]{2}$').hasMatch(residenceCountry);
|
||||
}
|
||||
}
|
||||
|
||||
/// Ephemeral image data only. Never serialize this model into storage or telemetry.
|
||||
class Photo {
|
||||
Photo(Uint8List bytes)
|
||||
|
||||
Reference in new issue
Block a user