<?php

declare(strict_types=1);

namespace ApiModel\Domain\Repository;

interface JournalRepositoryInterface
{
    public function findEntryById(string $id): ?array;

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

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

    public function nextEntryNumber(string $companyId): string;

    public function insertEntry(
        string $id,
        string $companyId,
        ?string $branchId,
        string $entryNumber,
        string $entryDate,
        ?string $description,
        string $status,
        string $operatingCurrency,
        string $functionalCurrency,
        string $exchangeRate,
        ?string $createdBy
    ): void;

    public function updateEntry(
        string $id,
        ?string $branchId,
        string $entryDate,
        ?string $description,
        string $operatingCurrency,
        string $functionalCurrency,
        string $exchangeRate
    ): void;

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

    public function deleteEntry(string $id): void;

    public function deleteLinesByEntry(string $entryId): void;

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