feat: add ScanRecord model with toJson

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-05-07 19:53:48 +08:00
parent 366e56710c
commit 2693c13133
2 changed files with 50 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
enum SendStatus { pending, success, failed }
class ScanRecord {
final String barcode;
final String codeType;
final DateTime timestamp;
SendStatus status;
ScanRecord({
required this.barcode,
required this.codeType,
required this.timestamp,
this.status = SendStatus.pending,
});
Map<String, dynamic> toJson() => {
'barcode': barcode,
'code_type': codeType,
'timestamp': timestamp.toUtc().toIso8601String(),
};
}