<?php

declare(strict_types=1);

namespace ApiModel\Domain\Repository;

interface InvoiceRepositoryInterface
{
    /** @return list<array<string, mixed>> */
    public function listByCompany(string $companyId, ?string $branchId = null): array;

    /** @return array<string, mixed>|null */
    public function findById(string $id): ?array;

    /** @return list<array<string, mixed>> */
    public function findLinesByInvoiceId(string $invoiceId): array;

    /** @param array<string, mixed> $invoice */
    public function insert(array $invoice): void;

    /** @param array<string, mixed> $invoice */
    public function update(string $id, array $invoice): void;

    /** @param list<array<string, mixed>> $lines */
    public function insertLines(string $invoiceId, array $lines): void;

    public function deleteLines(string $invoiceId): void;

    public function delete(string $id): void;

    public function nextInvoiceNumber(string $companyId): string;

    public function updateStatusAndBalance(string $id, string $status, string $balance): void;

    /** @return list<array<string, mixed>> */
    public function listUnpaidByCustomer(string $companyId, string $customerId): array;
}
