1: <?php
2:
3: namespace LaravelUi5\Core\Ui5\Contracts;
4:
5: use LaravelUi5\Core\Enums\AggregationLevel;
6:
7: /**
8: * Contract for UI5 KPI tiles embedded in dashboards or standalone views.
9: *
10: * Each KPI defines its own metadata, aggregation level, unit and optional scale,
11: * and references a data provider responsible for delivering dynamic content.
12: *
13: * KPIs are treated as first-class UI5 artifacts and must declare a unique
14: * namespace and version. This enables them to be listed, routed and managed
15: * like any other UI5 entity (App, Library, Card, etc.).
16: */
17: interface Ui5KpiInterface extends Ui5ArtifactInterface, SluggableInterface
18: {
19: /**
20: * Returns the aggregation level (e.g. daily, weekly, monthly).
21: *
22: * Indicates how the underlying data is grouped.
23: *
24: * @return AggregationLevel
25: */
26: public function getAggregationLevel(): AggregationLevel;
27:
28: /**
29: * Returns an array of context keys (e.g. 'project_id', 'year').
30: *
31: * These keys are expected as filters or parameters when requesting
32: * dynamic data via the data provider.
33: *
34: * @return string[]
35: */
36: public function getContextKeys(): array;
37:
38: /**
39: * Returns the data provider responsible for retrieving live KPI data.
40: *
41: * The provider will return the actual value, indicator, valueColor, etc.
42: * and is invoked at runtime inside the dashboard view.
43: *
44: * @return KpiProviderInterface
45: */
46: public function getProvider(): KpiProviderInterface;
47: }
48: