1+ <?php
2+
3+ namespace Relaticle \Flowforge \Contracts ;
4+
5+ use Illuminate \Database \Eloquent \Model ;
6+ use Illuminate \Support \Collection ;
7+
8+ /**
9+ * Interface for Kanban board adapters.
10+ *
11+ * Adapters are responsible for the interaction between the Kanban board and models.
12+ */
13+ interface IKanbanAdapter
14+ {
15+ /**
16+ * Get the model instance.
17+ *
18+ * @return Model
19+ */
20+ public function getModel (): Model ;
21+
22+ /**
23+ * Get the status field name for the model.
24+ *
25+ * @return string
26+ */
27+ public function getStatusField (): string ;
28+
29+ /**
30+ * Get all available status values for the model.
31+ *
32+ * @return array<string, string>
33+ */
34+ public function getStatusValues (): array ;
35+
36+ /**
37+ * Get all items for the Kanban board.
38+ *
39+ * @return Collection
40+ */
41+ public function getItems (): Collection ;
42+
43+ /**
44+ * Update the status of an item.
45+ *
46+ * @param Model $model
47+ * @param string $status
48+ * @return bool
49+ */
50+ public function updateStatus (Model $ model , string $ status ): bool ;
51+
52+ /**
53+ * Get the attributes to display on the card.
54+ *
55+ * @return array<string, string>
56+ */
57+ public function getCardAttributes (): array ;
58+
59+ /**
60+ * Get the title attribute for the card.
61+ *
62+ * @return string
63+ */
64+ public function getTitleAttribute (): string ;
65+
66+ /**
67+ * Get the description attribute for the card.
68+ *
69+ * @return string|null
70+ */
71+ public function getDescriptionAttribute (): ?string ;
72+ }
0 commit comments