import '../models/scan_history_model.dart';

class ScanHistoryRepository {
  Future<List<ScanHistoryModel>> fetchScanHistory(DateTime date, String statusFilter) async {
    await Future.delayed(const Duration(milliseconds: 500));

    // Mock data
    List<ScanHistoryModel> data = [
      ScanHistoryModel(passId: '#P214125125', reason: 'Already Used', time: '05/11/24 on 11:00PM', status: 'Failed'),
      ScanHistoryModel(passId: '#P214125125', time: '05/11/24 on 11:00PM', status: 'Success'),
      ScanHistoryModel(passId: '#P214125125', reason: 'Invalid Code', time: '05/11/24 on 11:00PM', status: 'Failed'),
      ScanHistoryModel(passId: '#P214125125', time: '05/11/24 on 11:00PM', status: 'Success'),
    ];

    if (statusFilter == 'All Status') return data;
    return data.where((item) => item.status == statusFilter).toList();
  }
}
