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 toJson() => { 'barcode': barcode, 'code_type': codeType, 'timestamp': timestamp.toUtc().toIso8601String(), }; }