Files
Toiminnanohjaus/app/Modules/Billing/Domain/Contracts/BillingExportRepository.php
T
petriandClaude Sonnet 5.5 7d7b72989d Add an editable menu name and reserve billing material numbers on creation
- Company details get an optional "Valikon nimi", shown at the left of the
  main menu; it falls back to the application name when empty.
- A billing material gets its running number (billing_exports.number) only
  when it is created, so discarded drafts leave no gaps. Drafts have no
  number; existing created materials are numbered by the migration, and the
  CSV file name uses the number.
- TaskAssigneeMigrationTest rolls back from its own migration onward instead
  of assuming it is the last one.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-24 19:41:57 +02:00

50 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Modules\Billing\Domain\Contracts;
use App\Modules\Billing\Domain\Entities\BillingExport;
interface BillingExportRepository
{
/**
* The material with its invoices, jobs, billable hours and lines. With
* $lock the row stays locked until the transaction ends.
*/
public function findById(int $id, bool $lock = false): ?BillingExport;
/**
* The id of the open draft, if there is one.
*/
public function openDraftId(): ?int;
/**
* Inserts a new material or replaces a stored one's invoices, and returns it.
*/
public function save(BillingExport $export): BillingExport;
public function delete(BillingExport $export): void;
/**
* The next free number of a created material (1, 2, ...), without gaps.
*/
public function nextNumber(): int;
/**
* The jobs among the given ones whose fixed price is already on a created material.
*
* @param list<int> $jobIds
* @return list<int>
*/
public function fixedPriceBilledJobIds(array $jobIds): array;
/**
* The months (Y-m) whose monthly fee is on a created material, by job.
*
* @param list<int> $jobIds
* @return array<int, list<string>>
*/
public function billedMonths(array $jobIds): array;
}