Tasks get an ordered checklist (spec 8.2, phase 3): items are checked done with who and when recorded, also by subcontractors attached to the job; others add, rename, reorder and remove items. Items go with their task. The spec gets a phase 3 chapter (18.1), and open questions move to chapter 19. Co-Authored-By: Claude Opus 5.5 <[email protected]>
38 lines
967 B
PHP
38 lines
967 B
PHP
<?php
|
|
|
|
namespace App\Modules\Jobs\Infrastructure\Persistence\Eloquent;
|
|
|
|
use Carbon\CarbonImmutable;
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Attributes\Table;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Persistence model of a task's checklist item, used only inside the Jobs
|
|
* Infrastructure layer.
|
|
*
|
|
* @property int $id
|
|
* @property int $task_id
|
|
* @property string $text
|
|
* @property int $sort_order
|
|
* @property CarbonImmutable|null $done_at
|
|
* @property int|null $done_by
|
|
*/
|
|
#[Table('task_checklist_items')]
|
|
#[Fillable(['task_id', 'text', 'sort_order', 'done_at', 'done_by'])]
|
|
class ChecklistItemModel extends Model
|
|
{
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'task_id' => 'integer',
|
|
'sort_order' => 'integer',
|
|
'done_at' => 'immutable_datetime',
|
|
'done_by' => 'integer',
|
|
];
|
|
}
|
|
}
|