<?php

declare(strict_types=1);

namespace App\Contracts\Repositories;

use App\Models\PartnerBalanceTransaction;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Pagination\LengthAwarePaginator;

interface PartnerBalanceTransactionRepositoryInterface
{
    /**
     * Find transaction by ID
     */
    public function findById(int $id): ?PartnerBalanceTransaction;

    /**
     * Get transactions by partner
     */
    public function getByPartner(int $partnerId): Collection;

    /**
     * Get paginated transactions by partner
     */
    public function getPaginatedByPartner(int $partnerId, int $perPage = 15): LengthAwarePaginator;

    /**
     * Get transactions by type
     */
    public function getByType(int $partnerId, string $type): Collection;

    /**
     * Get completed transactions
     */
    public function getCompleted(int $partnerId): Collection;

    /**
     * Get pending transactions
     */
    public function getPending(int $partnerId): Collection;

    /**
     * Create new transaction
     *
     * @param  array<string, mixed>  $data
     */
    public function create(array $data): PartnerBalanceTransaction;

    /**
     * Update transaction
     *
     * @param  array<string, mixed>  $data
     */
    public function update(int $id, array $data): PartnerBalanceTransaction;

    /**
     * Get total deposits by partner
     */
    public function getTotalDeposits(int $partnerId): float;

    /**
     * Get total withdrawals by partner
     */
    public function getTotalWithdrawals(int $partnerId): float;
}
