<?php

declare(strict_types=1);

namespace App\Contracts\Repositories;

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

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

    /**
     * Get all distributions with optional filters
     *
     * @param  array<string, mixed>  $filters
     */
    public function getAll(array $filters = []): Collection;

    /**
     * Get distributions by property
     */
    public function getByProperty(int $propertyId): Collection;

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

    /**
     * Get pending distributions for specific period
     */
    public function getPendingForPeriod(string $period): Collection;

    /**
     * Get distributed (completed)
     */
    public function getDistributed(): Collection;

    /**
     * Get distributions by period
     */
    public function getByPeriod(string $startDate, string $endDate): Collection;

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

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

    /**
     * Mark distribution as distributed
     */
    public function markAsDistributed(int $id): bool;

    /**
     * Get total distributed amount by property
     */
    public function getTotalDistributedByProperty(int $propertyId): float;
}
