import 'package:pshared/models/payment/operation.dart';
import 'package:pshared/models/payment/status.dart';


class OperationService {
  Future<List<OperationItem>> fetchOperations() async {
    await Future.delayed(const Duration(milliseconds: 500));
    
    return [
      OperationItem(
        status: OperationStatus.error,
        fileName: 'cards_payout_sample_june.csv',
        amount: 10,
        currency: 'EUR',
        toAmount: 10,
        toCurrency: 'EUR',
        payId: '860163800',
        cardNumber: null,
        name: 'John Snow',
        date: DateTime(2025, 7, 14, 19, 59, 2),
        comment: 'EUR visa',
      ),
      OperationItem(
        status: OperationStatus.processing,
        fileName: 'cards_payout_sample_june.csv',
        amount: 10,
        currency: 'EUR',
        toAmount: 10,
        toCurrency: 'EUR',
        payId: '860163700',
        cardNumber: null,
        name: 'Baltasar Gelt',
        date: DateTime(2025, 7, 14, 19, 59, 2),
        comment: 'EUR master',
      ),
      OperationItem(
        status: OperationStatus.error,
        fileName: 'cards_payout_sample_june.csv',
        amount: 10,
        currency: 'EUR',
        toAmount: 10,
        toCurrency: 'EUR',
        payId: '40000000****0077',
        cardNumber: '40000000****0077',
        name: 'John Snow',
        date: DateTime(2025, 7, 14, 19, 23, 22),
        comment: 'EUR visa',
      ),
      OperationItem(
        status: OperationStatus.success,
        fileName: null,
        amount: 10,
        currency: 'EUR',
        toAmount: 10,
        toCurrency: 'EUR',
        payId: '54133300****0019',
        cardNumber: '54133300****0019',
        name: 'Baltasar Gelt',
        date: DateTime(2025, 7, 14, 19, 23, 21),
        comment: 'EUR master',
      ),
      OperationItem(
        status: OperationStatus.success,
        fileName: null,
        amount: 130,
        currency: 'EUR',
        toAmount: 130,
        toCurrency: 'EUR',
        payId: '54134300****0019',
        cardNumber: '54153300****0019',
        name: 'Ivan Brokov',
        date: DateTime(2025, 7, 15, 19, 23, 21),
        comment: 'EUR master 2',
      ),
    ];
  }
  
  // Add real API:
  // Future<List<OperationItem>> fetchOperations() async {
  //   final response = await _httpClient.get('/api/operations');
  //   return (response.data as List)
  //       .map((json) => OperationItem.fromJson(json))
  //       .toList();
  // }
}
