update info
This commit is contained in:
@@ -60,6 +60,33 @@ class UserInfo {
|
||||
/// CCCD/ID card number
|
||||
final String? cccd;
|
||||
|
||||
/// Date of birth
|
||||
final DateTime? dateOfBirth;
|
||||
|
||||
/// Gender
|
||||
final String? gender;
|
||||
|
||||
/// ID card front image URL
|
||||
final String? idCardFront;
|
||||
|
||||
/// ID card back image URL
|
||||
final String? idCardBack;
|
||||
|
||||
/// Certificate image URLs
|
||||
final List<String> certificates;
|
||||
|
||||
/// Membership verification status text
|
||||
final String? membershipStatus;
|
||||
|
||||
/// Membership status color indicator
|
||||
final String? membershipStatusColor;
|
||||
|
||||
/// Whether user is verified
|
||||
final bool isVerified;
|
||||
|
||||
/// Whether to display credential verification form
|
||||
final bool credentialDisplay;
|
||||
|
||||
/// Referral code
|
||||
final String? referralCode;
|
||||
|
||||
@@ -88,6 +115,15 @@ class UserInfo {
|
||||
this.taxId,
|
||||
this.address,
|
||||
this.cccd,
|
||||
this.dateOfBirth,
|
||||
this.gender,
|
||||
this.idCardFront,
|
||||
this.idCardBack,
|
||||
this.certificates = const [],
|
||||
this.membershipStatus,
|
||||
this.membershipStatusColor,
|
||||
this.isVerified = false,
|
||||
this.credentialDisplay = false,
|
||||
this.referralCode,
|
||||
this.erpnextCustomerId,
|
||||
required this.createdAt,
|
||||
@@ -151,6 +187,15 @@ class UserInfo {
|
||||
String? taxId,
|
||||
String? address,
|
||||
String? cccd,
|
||||
DateTime? dateOfBirth,
|
||||
String? gender,
|
||||
String? idCardFront,
|
||||
String? idCardBack,
|
||||
List<String>? certificates,
|
||||
String? membershipStatus,
|
||||
String? membershipStatusColor,
|
||||
bool? isVerified,
|
||||
bool? credentialDisplay,
|
||||
String? referralCode,
|
||||
String? erpnextCustomerId,
|
||||
DateTime? createdAt,
|
||||
@@ -172,6 +217,15 @@ class UserInfo {
|
||||
taxId: taxId ?? this.taxId,
|
||||
address: address ?? this.address,
|
||||
cccd: cccd ?? this.cccd,
|
||||
dateOfBirth: dateOfBirth ?? this.dateOfBirth,
|
||||
gender: gender ?? this.gender,
|
||||
idCardFront: idCardFront ?? this.idCardFront,
|
||||
idCardBack: idCardBack ?? this.idCardBack,
|
||||
certificates: certificates ?? this.certificates,
|
||||
membershipStatus: membershipStatus ?? this.membershipStatus,
|
||||
membershipStatusColor: membershipStatusColor ?? this.membershipStatusColor,
|
||||
isVerified: isVerified ?? this.isVerified,
|
||||
credentialDisplay: credentialDisplay ?? this.credentialDisplay,
|
||||
referralCode: referralCode ?? this.referralCode,
|
||||
erpnextCustomerId: erpnextCustomerId ?? this.erpnextCustomerId,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
|
||||
@@ -32,4 +32,27 @@ abstract class UserInfoRepository {
|
||||
///
|
||||
/// Returns [UserInfo] entity with fresh user data.
|
||||
Future<UserInfo> refreshUserInfo();
|
||||
|
||||
/// Update user information
|
||||
///
|
||||
/// Updates the authenticated user's profile information.
|
||||
///
|
||||
/// [data] should contain:
|
||||
/// - full_name: String
|
||||
/// - date_of_birth: String (YYYY-MM-DD format)
|
||||
/// - gender: String
|
||||
/// - company_name: String?
|
||||
/// - tax_code: String?
|
||||
/// - avatar_base64: String? (base64 encoded image)
|
||||
/// - id_card_front_base64: String? (base64 encoded image)
|
||||
/// - id_card_back_base64: String? (base64 encoded image)
|
||||
/// - certificates_base64: List<String> (array of base64 encoded images)
|
||||
///
|
||||
/// Returns updated [UserInfo] entity after successful update.
|
||||
///
|
||||
/// Throws:
|
||||
/// - [UnauthorizedException] if session expired
|
||||
/// - [NetworkException] if network error occurs
|
||||
/// - [ServerException] if server error occurs
|
||||
Future<UserInfo> updateUserInfo(Map<String, dynamic> data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user