// ignore: depend_on_referenced_packages
import 'package:flutter/foundation.dart';
import '../../domain/entities/payment_summary.dart';
import '../../domain/entities/payment_transaction.dart';
import 'payments_remote_datasource.dart';

class PaymentsMockDataSource implements PaymentsRemoteDataSource {
  @override
  Future<PaymentSummary> fetchPaymentSummary() async {
    // Simulate network delay
    await Future.delayed(const Duration(milliseconds: 800));
    
    // Mock data matching the prototype
    return const PaymentSummary(
      weeklyEarnings: 847.50,
      monthlyEarnings: 3240.0,
      pendingEarnings: 285.0,
      totalEarnings: 12450.0,
    );
  }

  @override
  Future<List<PaymentTransaction>> fetchPaymentHistory(String period) async {
    await Future.delayed(const Duration(milliseconds: 1000));
    
    // Mock data matching the prototype
    // In a real scenario, this would filter by 'period' (week/month/year)
    return [
      PaymentTransaction(
        id: '1',
        title: 'Cook',
        location: 'LA Convention Center',
        address: '1201 S Figueroa St, Los Angeles, CA 90015',
        workedTime: '2:00 PM - 10:00 PM',
        amount: 160.00,
        status: 'PAID',
        hours: 8,
        rate: 20.0,
        date: DateTime(2025, 12, 6), // "Sat, Dec 6" (Using future date to match context if needed, but keeping it simple)
      ),
      PaymentTransaction(
        id: '2',
        title: 'Server',
        location: 'The Grand Hotel',
        address: '456 Main St, Los Angeles, CA 90012',
        workedTime: '5:00 PM - 11:00 PM',
        amount: 176.00,
        status: 'PAID',
        hours: 8,
        rate: 22.0,
        date: DateTime(2025, 12, 5), // "Fri, Dec 5"
      ),
      PaymentTransaction(
        id: '3',
        title: 'Bartender',
        location: 'Club Luxe',
        address: '789 Sunset Blvd, Los Angeles, CA 90028',
        workedTime: '6:00 PM - 2:00 AM',
        amount: 225.00,
        status: 'PAID',
        hours: 9,
        rate: 25.0,
        date: DateTime(2025, 12, 4), // "Thu, Dec 4"
      ),
    ];
  }
}
