1: <?php
2:
3: namespace LaravelUi5\Core\Ui5\Contracts;
4:
5: use LaravelUi5\Core\Contracts\ConfigurableInterface;
6: use LaravelUi5\Core\Contracts\ParameterizableInterface;
7: use LaravelUi5\Core\Ui5\Capabilities\DataProviderInterface;
8: use LaravelUi5\Core\Ui5\Capabilities\SluggableInterface;
9:
10: /**
11: * Contract for UI5 Card artifacts.
12: *
13: * A Card is a lightweight, embeddable UI element that typically displays
14: * summary or entry-point information (e.g. KPIs, recent items, small lists).
15: * It is backed by a {@see DataProviderInterface}, which encapsulates the
16: * domain logic and delivers the structured data required for rendering.
17: *
18: * Responsibilities:
19: * - Declares the association between the Card artifact and its provider.
20: * - Provides routing information via {@see SluggableInterface}.
21: * - Acts as a discoverable artifact within the {@see Ui5RegistryInterface}.
22: *
23: * Cross-cutting concerns:
24: * - If the provider implements {@see ParameterizableInterface}, validated
25: * request parameters are injected before execution.
26: * - If the provider implements {@see ConfigurableInterface}, resolved
27: * settings are injected before execution.
28: *
29: * Cards are read-only artifacts: they must not change application state.
30: */
31: interface Ui5CardInterface extends Ui5ArtifactInterface, SluggableInterface
32: {
33: /**
34: * Returns the class name or instance of the associated DataProvider.
35: *
36: * The provider is responsible for delivering the `card.content.data`
37: * structure as defined in the card manifest.
38: *
39: * @return DataProviderInterface
40: */
41: public function getProvider(): DataProviderInterface;
42: }
43: