<?php

declare(strict_types=1);

namespace App\Contracts\Repositories;

use App\Models\PartnerDistribution;
use Illuminate\Database\Eloquent\Collection;

interface PartnerDistributionRepositoryInterface
{
    /**
     * Find distribution by ID
     */
    public function findById(int $id): ?PartnerDistribution;

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

    /**
     * Get distributions by investment
     */
    public function getByInvestment(int $investmentId): Collection;

    /**
     * Get paginated distributions by investment
     */
    public function getPaginatedByInvestment(int $investmentId, int $perPage = 15);

    /**
     * Get distributions by distribution ID
     */
    public function getByDistribution(int $distributionId): Collection;

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

    /**
     * Get processed distributions
     */
    public function getProcessed(int $partnerId): Collection;

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

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

    /**
     * Mark distribution as processed
     */
    public function markAsProcessed(int $id, string $reference): bool;

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