Integrasi Menu Laporan Operator
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Support\Legacy\Reports;
|
||||
|
||||
/**
|
||||
* Sumber laporan (menu Laporan operator) dari DB lama. Satu sumber melayani beberapa slug SATU (repp_*).
|
||||
* Hanya baca. Kesalahan bisnis dilempar sebagai PortalException berpesan Indonesia (ditampilkan ke operator).
|
||||
*/
|
||||
interface ReportSource
|
||||
{
|
||||
/** @return list<string> slug yang dilayani (mis. 'repp_daftarmhs') */
|
||||
public function slugs(): array;
|
||||
|
||||
/**
|
||||
* Definisi parameter formulir laporan. Parameter "kop" (Gunakan KOP) ditambahkan otomatis oleh pengendali.
|
||||
* Nama parameter tidak boleh "tampil" atau "kop". Nilai select dicocokkan ke kunci 'options' oleh pengendali.
|
||||
*
|
||||
* @return array{
|
||||
* note?: string,
|
||||
* params: list<array{
|
||||
* name: string, label: string, type: 'select'|'text'|'number'|'date'|'check',
|
||||
* options?: array<int|string, string>, required?: bool, default?: mixed, hint?: string, placeholder?: string
|
||||
* }>
|
||||
* }
|
||||
*/
|
||||
public function definition(string $slug, ReportContext $context): array;
|
||||
|
||||
/**
|
||||
* Jalankan laporan. $params sudah divalidasi pengendali (select ∈ options, wajib terisi; teks dipangkas;
|
||||
* check = bool; parameter kosong = null). $limit = jumlah baris maksimum yang dikembalikan; isi
|
||||
* ReportResult::$total dengan jumlah baris sebenarnya bila murah dihitung.
|
||||
*
|
||||
* @param array<string, mixed> $params
|
||||
*/
|
||||
public function run(string $slug, array $params, ReportContext $context, int $limit): ReportResult;
|
||||
}
|
||||
Reference in New Issue
Block a user