<?php

namespace App\Modules\Transactions\Interfaces;

use App\Models\Transaction;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;

interface TransactionRepositoryInterface
{
    public function create(array $data): Transaction;

    public function findByReference(string $reference): ?Transaction;

    public function findByUser(string $userId, int $perPage = 15, ?string $type = null, ?string $status = null): LengthAwarePaginator;

    public function updateStatus(string $id, string $status, ?array $providerResponse = null): Transaction;

    public function updateProviderReference(string $id, string $providerReference): Transaction;

    public function markSuccessful(string $id, array $providerResponse, ?array $tokenData = null): Transaction;

    public function markFailed(string $id, string $reason, array $providerResponse): Transaction;

    public function findByProviderReference(string $providerReference): ?Transaction;

    public function getStats(string $userId): array;

    public function getRecentTransactions(string $userId, int $limit = 5): \Illuminate\Database\Eloquent\Collection;
}
