<?php

namespace App\Modules\Wallet\Interfaces;

use App\Models\Wallet;
use App\Models\WalletTransaction;

interface WalletRepositoryInterface
{
    public function findByUserId(string $userId): ?Wallet;

    public function createForUser(string $userId): Wallet;

    public function getBalance(string $walletId): float;

    public function credit(string $walletId, float $amount, string $description, string $reference, ?string $relatedType = null, ?string $relatedId = null, ?array $metadata = null): WalletTransaction;

    public function debit(string $walletId, float $amount, string $description, string $reference, ?string $relatedType = null, ?string $relatedId = null, ?array $metadata = null): WalletTransaction;

    public function canDebit(string $walletId, float $amount): bool;

    public function getTransactions(string $walletId, int $perPage = 15, ?string $type = null): \Illuminate\Contracts\Pagination\LengthAwarePaginator;

    public function getStatement(string $walletId, ?string $fromDate = null, ?string $toDate = null): \Illuminate\Database\Eloquent\Collection;
}
