feat: add Flutter mobile clients and staff delivery API
This commit is contained in:
50
apps/user_app/lib/domain/models/client_models.dart
Normal file
50
apps/user_app/lib/domain/models/client_models.dart
Normal file
@@ -0,0 +1,50 @@
|
||||
class ClientRecord {
|
||||
const ClientRecord({
|
||||
required this.identity,
|
||||
required this.title,
|
||||
required this.subtitle,
|
||||
required this.raw,
|
||||
this.status,
|
||||
});
|
||||
|
||||
final String identity;
|
||||
final String title;
|
||||
final String subtitle;
|
||||
final int? status;
|
||||
final Map<String, Object?> raw;
|
||||
}
|
||||
|
||||
class UserProfile {
|
||||
const UserProfile({
|
||||
required this.identity,
|
||||
required this.name,
|
||||
required this.phone,
|
||||
required this.avatar,
|
||||
});
|
||||
|
||||
final String identity;
|
||||
final String name;
|
||||
final String phone;
|
||||
final String avatar;
|
||||
|
||||
factory UserProfile.fromJson(Map<String, Object?> json) => UserProfile(
|
||||
identity: json['identity'] as String? ?? '',
|
||||
name: json['name'] as String? ?? '',
|
||||
phone: json['phone'] as String? ?? '',
|
||||
avatar: json['avatar'] as String? ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
class WalletSummary {
|
||||
const WalletSummary({required this.balance, required this.withdrawalBalance});
|
||||
|
||||
final int balance;
|
||||
final int withdrawalBalance;
|
||||
|
||||
factory WalletSummary.fromJson(Map<String, Object?> json) => WalletSummary(
|
||||
balance: (json['balance'] as num?)?.toInt() ?? 0,
|
||||
withdrawalBalance: (json['withdrawal_balance'] as num?)?.toInt() ?? 0,
|
||||
);
|
||||
}
|
||||
|
||||
String moneyText(int cents) => '¥${(cents / 100).toStringAsFixed(2)}';
|
||||
Reference in New Issue
Block a user