Добавил базовые датасеты и агрегации для конструктора отчетов

This commit is contained in:
brusnitsyn
2026-06-22 17:00:58 +09:00
parent 71bd4b9d1a
commit 5bad7599cf
16 changed files with 1453 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Services\Analytics;
/**
* Колонка результата отчёта (для таблицы и графика).
*/
readonly class Column
{
/**
* @param 'dimension'|'measure'|'period' $kind
* @param 'string'|'date'|'number'|'money'|'percent' $type
*/
public function __construct(
public string $key,
public string $label,
public string $kind,
public string $type,
public ?string $unit = null,
) {}
/** @return array<string,mixed> */
public function toArray(): array
{
return [
'key' => $this->key,
'label' => $this->label,
'kind' => $this->kind,
'type' => $this->type,
'unit' => $this->unit,
];
}
}