| 12345678910111213141516171819202122232425262728293031 |
- <?php
- declare(strict_types=1);
- namespace App\Domain;
- final class Worker
- {
- public function __construct(
- public readonly int $id,
- public readonly string $name,
- public readonly bool $isActive,
- public readonly float $defaultRtb,
- public readonly string $createdAt,
- public readonly string $updatedAt,
- ) {
- }
- /** Row snapshot for audit JSON. */
- public function toAuditSnapshot(): array
- {
- return [
- 'id' => $this->id,
- 'name' => $this->name,
- 'is_active' => $this->isActive ? 1 : 0,
- 'default_rtb' => $this->defaultRtb,
- 'created_at' => $this->createdAt,
- 'updated_at' => $this->updatedAt,
- ];
- }
- }
|