WithdrawalRequest.fromJSON constructor
WithdrawalRequest.fromJSON(
- dynamic json
Implementation
factory WithdrawalRequest.fromJSON(dynamic json) {
return WithdrawalRequest(
id: json['id'] ?? '',
ownerEmail: json['ownerEmail'] ?? '',
appCoinsAmount: (json['appCoinsAmount'] ?? 0).toDouble(),
mxnAmount: (json['mxnAmount'] ?? 0).toDouble(),
bankClabe: json['bankClabe'] ?? '',
status: EnumToString.fromString(
WithdrawalStatus.values,
json['status']?.toString() ?? 'pending',
) ?? WithdrawalStatus.pending,
createdTime: json['createdTime'] ?? 0,
processedTime: json['processedTime'] ?? 0,
adminNote: json['adminNote'] ?? '',
);
}