Integrasi Menu Laporan Operator

This commit is contained in:
Ariyutta
2026-11-06 14:51:38 +07:00
parent b1a8887dc8
commit 48569f3172
57 changed files with 11158 additions and 468 deletions
@@ -0,0 +1,31 @@
<?php
namespace App\Support\Legacy\Reports;
/** Hasil satu laporan: kolom, baris (nilai skalar), keterangan di atas tabel, dan jumlah baris sebenarnya. */
final readonly class ReportResult
{
/**
* @param list<array{key: string, label: string, num?: bool}> $columns
* @param list<array<string, scalar|null>> $rows kunci = 'key' kolom
* @param int|null $total jumlah baris sebenarnya (bila lebih banyak dari $rows)
* @param list<string> $summary baris keterangan (mis. "Periode: 2020/2021 Ganjil", "Jumlah: 120 mahasiswa")
*/
public function __construct(
public array $columns,
public array $rows,
public ?int $total = null,
public array $summary = [],
public ?string $note = null,
) {}
public function count(): int
{
return $this->total ?? count($this->rows);
}
public function truncated(): bool
{
return $this->total !== null && $this->total > count($this->rows);
}
}