SprintWorker.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /*
  3. * Copyright 2026 Alessandro Chiapparini <sprint_planer_web@chiapparini.org>
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * See the LICENSE file in the project root for the full license text.
  9. */
  10. declare(strict_types=1);
  11. namespace App\Domain;
  12. final class SprintWorker
  13. {
  14. public function __construct(
  15. public readonly int $id,
  16. public readonly int $sprintId,
  17. public readonly int $workerId,
  18. public readonly string $workerName,
  19. public readonly float $rtb,
  20. public readonly int $sortOrder,
  21. ) {
  22. }
  23. /**
  24. * Snapshot of the sprint_workers row as stored in the DB (excludes the
  25. * denormalised worker name which belongs to the workers table).
  26. */
  27. public function toAuditSnapshot(): array
  28. {
  29. return [
  30. 'id' => $this->id,
  31. 'sprint_id' => $this->sprintId,
  32. 'worker_id' => $this->workerId,
  33. 'rtb' => $this->rtb,
  34. 'sort_order' => $this->sortOrder,
  35. ];
  36. }
  37. }