Initial upload: fin65-mobile
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class PendingOperation {
|
||||
final int id;
|
||||
final String operationType;
|
||||
final Map<String, dynamic> payload;
|
||||
final DateTime createdAt;
|
||||
final String status;
|
||||
final String? error;
|
||||
|
||||
PendingOperation({
|
||||
required this.id,
|
||||
required this.operationType,
|
||||
required this.payload,
|
||||
required this.createdAt,
|
||||
required this.status,
|
||||
this.error,
|
||||
});
|
||||
|
||||
factory PendingOperation.fromDbMap(Map<String, dynamic> map) {
|
||||
return PendingOperation(
|
||||
id: map['id'] as int,
|
||||
operationType: map['operation_type'] as String,
|
||||
payload: jsonDecode(map['payload_json'] as String) as Map<String, dynamic>,
|
||||
createdAt: DateTime.parse(map['created_at'] as String),
|
||||
status: map['status'] as String? ?? 'pending',
|
||||
error: map['error'] as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user