✨feature: Initial MVP
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
// phpcs:disable PEAR.Commenting.FileComment,PEAR.Commenting.ClassComment
|
||||
|
||||
/**
|
||||
* Board domain model.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace IronKanban\Domain;
|
||||
|
||||
/**
|
||||
* Represents a project's kanban board.
|
||||
*/
|
||||
final class Board
|
||||
{
|
||||
/**
|
||||
* Create a board instance.
|
||||
*
|
||||
* @param string $projectId Project identifier.
|
||||
* @param list<Column> $columns Board columns.
|
||||
* @param array<string, mixed> $meta Additional board metadata.
|
||||
*/
|
||||
public function __construct(
|
||||
public string $projectId,
|
||||
public array $columns,
|
||||
public array $meta = []
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the board into an API-friendly array.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
return [
|
||||
'project_id' => $this->projectId,
|
||||
'columns' => array_map(static fn (Column $column) => $column->toArray(), $this->columns),
|
||||
'meta' => $this->meta,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user