Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3489: workload report period average + etc #184

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
c58abc4
Removed dataprovider logic and cleaned up controller
jeppekroghitk Jan 2, 2025
9b77946
Removed dataprovider select from workload report filter
jeppekroghitk Jan 2, 2025
d99f459
Renamed workload report view mode selections
jeppekroghitk Jan 2, 2025
7048e13
Applied new epic and version property filters to existing workload re…
jeppekroghitk Jan 2, 2025
83470f0
Added period average calculations to workload report data
jeppekroghitk Jan 2, 2025
4e18500
Added workload report period averages to twig template
jeppekroghitk Jan 2, 2025
b6a305f
Added translations
jeppekroghitk Jan 2, 2025
95e96c3
Added period average to data model
jeppekroghitk Jan 2, 2025
97aa2e9
Add year handling and improve period view functionality in WorkloadRe…
jeppekroghitk Jan 2, 2025
2926ad8
Add year selection to WorkloadReportType form
jeppekroghitk Jan 2, 2025
3d30966
Update WorkloadReportFormData to include year property
jeppekroghitk Jan 2, 2025
417aa16
Enhance WorkloadReportService to support year-based reporting
jeppekroghitk Jan 2, 2025
7bd5ea7
Coding standards
jeppekroghitk Jan 2, 2025
fd6cefd
Coding standards
jeppekroghitk Jan 2, 2025
24b29de
Removed year select option for next year
jeppekroghitk Jan 2, 2025
c907cda
Updated changelog
jeppekroghitk Jan 2, 2025
9e5e498
Coding standards
jeppekroghitk Jan 3, 2025
6468d1a
Required epic in data sync service
jeppekroghitk Jan 13, 2025
4c64b9c
Updated changelog
jeppekroghitk Jan 2, 2025
7ebc3e9
Removed DataProvider related fields from WorkloadReport form
jeppekroghitk Nov 13, 2024
741b0d3
Added new tag entity
jeppekroghitk Nov 14, 2024
2b28204
Added tag repo
jeppekroghitk Nov 14, 2024
c5be33a
Modified getWorklogDataCollection method signature
jeppekroghitk Nov 14, 2024
32d0ce8
Changed method for getting paged Worklog data in LeantimeApiService
jeppekroghitk Nov 14, 2024
79777df
Introduced new Entity IssueEpic
jeppekroghitk Nov 22, 2024
1631b9c
Removed irrelevant comment
jeppekroghitk Jan 2, 2025
3dc458a
Added example SQL query for fetching billable worklogs
jeppekroghitk Nov 22, 2024
7394849
Minor formatting improvements in WorkloadReportService
jeppekroghitk Nov 22, 2024
c356276
Deleted tag related files
jeppekroghitk Nov 22, 2024
76e1936
Created migration
jeppekroghitk Nov 22, 2024
c4eca7e
Improve memory usage output and progress logic
jeppekroghitk Nov 22, 2024
85695e2
Create new VersionFilterType form
jeppekroghitk Nov 22, 2024
f13ea24
Update VersionFilterData properties
jeppekroghitk Nov 22, 2024
ccf75fa
Add method to get paginated and filtered versions
jeppekroghitk Nov 22, 2024
5d9f30d
Modify the method for syncing worklogs to process in batches
jeppekroghitk Nov 22, 2024
71418f9
Remove unused method from LeantimeApiService
jeppekroghitk Nov 22, 2024
2fadbe2
Add navigation link to versions in the template
jeppekroghitk Nov 22, 2024
7f4ac15
Added version controller
jeppekroghitk Nov 22, 2024
63ab626
Added version templates
jeppekroghitk Nov 22, 2024
4f020a3
Minor adjustments
jeppekroghitk Nov 25, 2024
666e01a
Removed ui for versions
jeppekroghitk Dec 17, 2024
6b272fb
Removed version page from navigation and fixed key value in worklaod …
jeppekroghitk Dec 17, 2024
dd01ebf
Updated changelog
jeppekroghitk Dec 17, 2024
14aecca
Coding standards
jeppekroghitk Dec 17, 2024
afadd13
Coding standards
jeppekroghitk Dec 17, 2024
3851aca
Removed migration
jeppekroghitk Dec 17, 2024
c93e6c8
Added migration
jeppekroghitk Dec 17, 2024
6bbb3ac
Removed sql example
jeppekroghitk Jan 2, 2025
070c7c0
added invoicing rate report controller
jeppekroghitk Dec 17, 2024
b2acde8
Added controller form definitions
jeppekroghitk Dec 17, 2024
37aa6aa
Added service
jeppekroghitk Dec 17, 2024
a61f9b4
Added invoicing report template
jeppekroghitk Dec 17, 2024
2b1ee89
Added method for only getting workers that has includeInReports set t…
jeppekroghitk Dec 17, 2024
46dd65f
Added ui for new includeInReports for worker
jeppekroghitk Dec 17, 2024
fc66802
Added stimulus controller for highlighting th and first td for hovere…
jeppekroghitk Dec 17, 2024
b9eaff7
Added translations
jeppekroghitk Dec 17, 2024
38c0343
Added invoicing report to navigation
jeppekroghitk Dec 17, 2024
2db8519
Added classes for special cell display and table highlighting
jeppekroghitk Dec 17, 2024
3d2a6df
Added worker includeInReports boolean
jeppekroghitk Dec 17, 2024
c3efa86
Defined invoicing report data structure
jeppekroghitk Dec 17, 2024
14e9a08
Added nonbillableversionsenum
jeppekroghitk Dec 17, 2024
95ded89
Coding standards
jeppekroghitk Dec 17, 2024
8cf790d
Coding standards
jeppekroghitk Dec 17, 2024
db1ae69
Fixed migrations
jeppekroghitk Dec 18, 2024
96f6fa3
Fixed issue regarding averages, and revised rounding
jeppekroghitk Dec 18, 2024
c7d7e06
Fixed migrations
jeppekroghitk Dec 18, 2024
679de74
Coding standards
jeppekroghitk Dec 18, 2024
4b55a9e
Improve table highlight logic and enhance comments
jeppekroghitk Dec 19, 2024
72c31e5
Add projectData property to InvoicingRateReportWorker
jeppekroghitk Dec 19, 2024
c7fd8d7
Refactor InvoicingRateReportService to handle project-based calculati…
jeppekroghitk Dec 19, 2024
b9cdf7c
Enhance invoicing rate report template with project and issue details
jeppekroghitk Dec 19, 2024
e6bdee4
Updated icons to use FontAwesome caret-right and caret-down SVGs
jeppekroghitk Dec 20, 2024
784fe5a
Added caret-right and caret-down icons to FontAwesome library
jeppekroghitk Dec 20, 2024
07fba6d
Added style for parent-child toggle with proper borders
jeppekroghitk Dec 20, 2024
d565dae
Added year and includeIssues handling in InvoicingRateReportController
jeppekroghitk Dec 20, 2024
1e0ee96
Added previous, current, and next years to PlanningController
jeppekroghitk Dec 20, 2024
f52eb46
Integrated year and includeIssues inputs in InvoicingRateReportType form
jeppekroghitk Dec 20, 2024
fe63462
Renamed includeInReports label in WorkerType form
jeppekroghitk Dec 20, 2024
d5ba427
Added includeIssues field to InvoicingRateReportData model
jeppekroghitk Dec 20, 2024
f735546
Added year and includeIssues fields to InvoicingRateReportFormData
jeppekroghitk Dec 20, 2024
173b79d
Enhanced invoicing report with year and includeIssues support in serv…
jeppekroghitk Dec 20, 2024
522ffb2
Updated invoicing rate report template with caret icons and condition…
jeppekroghitk Dec 20, 2024
1ca23f5
Updated Danish translations for invoicing rate and workload reports
jeppekroghitk Dec 20, 2024
e6441db
Removed inclusion of normal logged hours in dataset, as it is not showed
jeppekroghitk Dec 20, 2024
6e9fec4
Revised load time estimation based on selections
jeppekroghitk Dec 20, 2024
0d1f407
Adjusted rendering of 0-values
jeppekroghitk Dec 20, 2024
1a1e661
Coding standards
jeppekroghitk Dec 20, 2024
b54c12b
Updated changelog
jeppekroghitk Jan 2, 2025
7b022e8
Fixed migrations
jeppekroghitk Jan 2, 2025
2e6993b
Made selections for include_in_reports translatable
jeppekroghitk Jan 2, 2025
fe43713
Re-added year selector for workload report
jeppekroghitk Jan 2, 2025
669a143
Corrected syncworklogscommand
jeppekroghitk Jan 2, 2025
f62cf80
Re-added years for workload report type
jeppekroghitk Jan 2, 2025
aca0673
Removed paginatorinterface from versionRepo
jeppekroghitk Jan 2, 2025
02c6307
Undid changes to datasyncservice
jeppekroghitk Jan 2, 2025
eea6e36
Undid changes to api service
jeppekroghitk Jan 2, 2025
db88ee3
Removed traces of removed method
jeppekroghitk Jan 2, 2025
9422911
Fixed translations
jeppekroghitk Jan 2, 2025
aec85e0
Fixed calculation of worker average on years not current
jeppekroghitk Jan 2, 2025
481d12c
Corrected year selection to not include next year
jeppekroghitk Jan 2, 2025
b1f02d5
Coding standards
jeppekroghitk Jan 2, 2025
f057399
Added translations for list view of 'include in report'
jeppekroghitk Jan 3, 2025
ca8d47d
Re-added removed line break
jeppekroghitk Jan 3, 2025
622d2c7
Added needed fields to invoicing rate report worker instead of extend…
jeppekroghitk Jan 3, 2025
4d30d56
Coding standards
jeppekroghitk Jan 3, 2025
e260efd
Consised setting of currentPeriodNumeric when showing years not current
jeppekroghitk Jan 6, 2025
70902bf
Update src/Service/InvoicingRateReportService.php
jeppekroghitk Jan 6, 2025
8fabd04
Update src/Service/InvoicingRateReportService.php
jeppekroghitk Jan 6, 2025
f4b694e
Update src/Service/InvoicingRateReportService.php
jeppekroghitk Jan 6, 2025
2248261
Update src/Service/InvoicingRateReportService.php
jeppekroghitk Jan 6, 2025
98eac3f
Update src/Service/InvoicingRateReportService.php
jeppekroghitk Jan 6, 2025
6f9a785
Update src/Service/InvoicingRateReportService.php
jeppekroghitk Jan 6, 2025
7bf459c
Corrected changelog
jeppekroghitk Jan 6, 2025
a99b246
Removed issueepic entity
jeppekroghitk Jan 6, 2025
dad6774
Removed duplicate definitions of sum arrays
jeppekroghitk Jan 6, 2025
4a96244
Add hover cursor style for last-child span
jeppekroghitk Jan 9, 2025
b988086
Add total logged hours to invoicing rate period data
jeppekroghitk Jan 9, 2025
8cd68ed
Add hover tooltip with total logged hours in invoicing report
jeppekroghitk Jan 9, 2025
c190f5b
Update Danish translations with invoicing hover description
jeppekroghitk Jan 9, 2025
235fae0
Coding standards
jeppekroghitk Jan 13, 2025
2f88958
Merge pull request #182 from itk-dev/feature/2597-add-workload-summar…
jeppekroghitk Jan 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

* [PR-182](https://github.com/itk-dev/economics/pull/182)
2597: Added invoicing rate report
* [PR-185](https://github.com/itk-dev/economics/pull/186)
2597: Added epic migration command.
* [PR-184](https://github.com/itk-dev/economics/pull/184)
3489: Workload report period averages.
* [PR-183](https://github.com/itk-dev/economics/pull/183)
2597: Added epic relations.
* [PR-187](https://github.com/itk-dev/economics/pull/187)
Expand Down
71 changes: 71 additions & 0 deletions assets/controllers/table_highlight_controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { Controller } from "@hotwired/stimulus";

/**
* Table highlight controller.
*
* Highlights the `<thead>` and first cell (`<th>` or `<td>`) of the row when
* hovering over a cell.
*/
export default class extends Controller {
connect() {
this.element.addEventListener(
"mouseenter",
(event) => this.highlight(event),
true,
);
this.element.addEventListener(
"mouseleave",
(event) => this.clearHighlights(event),
true,
);
}

/**
* Handles the highlighting of the appropriate `<thead>` column and row
* header.
*
* @param {MouseEvent} event
*/
highlight(event) {
// Only run if hovering a `<td>` (and not child elements like <span> or <a>)
if (event.target.tagName !== "TD") return;

const cell = event.target; // The actual hovered cell

// Find the index of the hovered cell (column index)
const cellIndex = Array.from(cell.parentNode.children).indexOf(cell);

// Highlight the corresponding column header (<th>) in the `<thead>`
const columnHeader = this.element.querySelector(
`thead th:nth-child(${cellIndex + 1})`,
);
if (columnHeader) columnHeader.classList.add("highlight-column");

// Highlight the first cell in the row (supports both <td> and <th>)
const rowStartCell = cell.parentNode.querySelector(
"th:first-child, td:first-child",
);
if (rowStartCell) rowStartCell.classList.add("highlight-row");
}

/**
* Clears all highlights when leaving a cell.
*
* @param {MouseEvent} event
*/
clearHighlights(event) {
// Only run if leaving a `<td>` (and not child elements)
if (event.target.tagName !== "TD") return;

// Remove the highlight class from all highlighted elements
this.element.querySelectorAll(".highlight-column").forEach((header) => {
header.classList.remove("highlight-column");
});

this.element
.querySelectorAll(".highlight-row")
.forEach((rowStartCell) => {
rowStartCell.classList.remove("highlight-row");
});
}
}
8 changes: 2 additions & 6 deletions assets/controllers/toggle-parent-child_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ export default class extends Controller {

displayChildrenForParentIds = [];

svgExpand = `<svg fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"></path>
</svg>`;
svgExpand = `<svg class="svg-inline--fa fa-caret-right" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="caret-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512" data-fa-i2svg=""><path fill="currentColor" d="M246.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-128-128c-9.2-9.2-22.9-11.9-34.9-6.9s-19.8 16.6-19.8 29.6l0 256c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l128-128z"></path></svg>`;

svgCollapse = `<svg fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25"></path>
</svg>`;
svgCollapse = `<svg class="svg-inline--fa fa-caret-down" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="caret-down" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" data-fa-i2svg=""><path fill="currentColor" d="M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"></path></svg>`;

connect() {
this.parentTargets.forEach((target) => {
Expand Down
4 changes: 3 additions & 1 deletion assets/fontawesome.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import {
faMaximize,
faEyeSlash,
faMinimize,
faCaretRight,
faCaretDown,
} from "@fortawesome/free-solid-svg-icons";

library.add(faMaximize, faEyeSlash, faMinimize);
library.add(faMaximize, faEyeSlash, faMinimize, faCaretRight, faCaretDown);
dom.i2svg();
15 changes: 15 additions & 0 deletions assets/styles/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -454,5 +454,20 @@
@apply text-right;
max-width: 200px;
}
.double-number-container {
span {
max-width: 47px;
}
span:last-child {
cursor: help;
}
}
.highlight-column, .highlight-row {
border: 1px solid #fff !important;
}

tr[data-toggle-parent-child-target="child"]:not(.hidden) + tr[data-toggle-parent-child-target="parent"] > td,
tr[data-toggle-parent-child-target="child"]:not(.hidden) + tr[data-toggle-parent-child-target="parent"] > th {
border-top: 1px solid #fff;
}
}
31 changes: 31 additions & 0 deletions migrations/Version20250102120303.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250102120303 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE worker ADD include_in_reports TINYINT(1) DEFAULT 1 NOT NULL');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE worker DROP include_in_reports');
}
}
72 changes: 72 additions & 0 deletions src/Controller/InvoicingRateReportController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

namespace App\Controller;

use App\Form\InvoicingRateReportType;
use App\Model\Reports\InvoicingRateReportFormData;
use App\Model\Reports\InvoicingRateReportViewModeEnum;
use App\Model\Reports\WorkloadReportPeriodTypeEnum as PeriodTypeEnum;
use App\Service\InvoicingRateReportService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;

#[Route('/admin/reports/invoicing_rate_report')]
#[IsGranted('ROLE_REPORT')]
class InvoicingRateReportController extends AbstractController
{
public function __construct(
private readonly InvoicingRateReportService $invoicingRateReportService,
) {
}

/**
* @throws \DateMalformedStringException
*/
#[Route('/', name: 'app_invoicing_rate_report')]
public function index(Request $request): Response
{
$reportData = null;
$error = null;
$mode = 'invoicing_rate_report';
$reportFormData = new InvoicingRateReportFormData();

$form = $this->createForm(InvoicingRateReportType::class, $reportFormData, [
'action' => $this->generateUrl('app_invoicing_rate_report'),
'method' => 'GET',
'attr' => [
'id' => 'sprint_report',
],
'years' => [
(new \DateTime())->modify('-1 year')->format('Y'),
(new \DateTime())->format('Y'),
],
'csrf_protection' => false,
]);

$form->handleRequest($request);

if ($form->isSubmitted() && $form->isValid()) {
$viewPeriodType = $form->get('viewPeriodType')->getData() ?? PeriodTypeEnum::WEEK;
$viewMode = InvoicingRateReportViewModeEnum::SUMMARY;
$year = $form->get('year')->getData();
$includeIssues = $form->get('includeIssues')->getData();

try {
$reportData = $this->invoicingRateReportService->getInvoicingRateReport($year, $viewPeriodType, $viewMode, $includeIssues);
} catch (\Exception $e) {
$error = $e->getMessage();
}
}

return $this->render('reports/reports.html.twig', [
'controller_name' => 'InvoicingRateReportController',
'form' => $form,
'error' => $error,
'data' => $reportData,
'mode' => $mode,
]);
}
}
6 changes: 5 additions & 1 deletion src/Controller/PlanningController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ private function preparePlanningData(Request $request): array
'attr' => [
'id' => 'sprint_report',
],
'years' => [(new \DateTime())->format('Y'), (new \DateTime())->modify('+1 year')->format('Y')],
'years' => [
(new \DateTime())->modify('-1 year')->format('Y'),
(new \DateTime())->format('Y'),
(new \DateTime())->modify('+1 year')->format('Y'),
],
'method' => 'GET',
'csrf_protection' => false,
]);
Expand Down
33 changes: 15 additions & 18 deletions src/Controller/WorkloadReportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use App\Model\Reports\WorkloadReportFormData;
use App\Model\Reports\WorkloadReportPeriodTypeEnum as PeriodTypeEnum;
use App\Model\Reports\WorkloadReportViewModeEnum as ViewModeEnum;
use App\Repository\DataProviderRepository;
use App\Service\WorkloadReportService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
Expand All @@ -19,11 +18,13 @@
class WorkloadReportController extends AbstractController
{
public function __construct(
private readonly DataProviderRepository $dataProviderRepository,
private readonly WorkloadReportService $workloadReportService,
) {
}

/**
* @throws \DateMalformedStringException
*/
#[Route('/', name: 'app_workload_report')]
public function index(Request $request): Response
{
Expand All @@ -38,28 +39,24 @@ public function index(Request $request): Response
'attr' => [
'id' => 'sprint_report',
],
'years' => [
(new \DateTime())->modify('-1 year')->format('Y'),
(new \DateTime())->format('Y'),
],
'csrf_protection' => false,
]);

$form->handleRequest($request);

$requestData = $request->query->all('workload_report');

if (!empty($requestData['dataProvider'])) {
$dataProvider = $this->dataProviderRepository->find($requestData['dataProvider']);

if ($form->isSubmitted() && $form->isValid()) {
$selectedDataProvider = $form->get('dataProvider')->getData() ?? $dataProvider;
$viewPeriodType = $form->get('viewPeriodType')->getData() ?? PeriodTypeEnum::WEEK;
$viewMode = $form->get('viewMode')->getData() ?? ViewModeEnum::WORKLOAD;
if ($form->isSubmitted() && $form->isValid()) {
$viewPeriodType = $form->get('viewPeriodType')->getData() ?? PeriodTypeEnum::WEEK;
$viewMode = $form->get('viewMode')->getData() ?? ViewModeEnum::WORKLOAD;
$year = $form->get('year')->getData();

if ($selectedDataProvider) {
try {
$reportData = $this->workloadReportService->getWorkloadReport($viewPeriodType, $viewMode);
} catch (\Exception $e) {
$error = $e->getMessage();
}
}
try {
$reportData = $this->workloadReportService->getWorkloadReport($year, $viewPeriodType, $viewMode);
} catch (\Exception $e) {
$error = $e->getMessage();
}
}

Expand Down
32 changes: 16 additions & 16 deletions src/Entity/Issue.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,49 +182,49 @@ public function setEpicName(?string $epicName): self
}

/**
* @return Collection<int, Epic>
* @return Collection<int, Version>
*/
public function getEpics(): Collection
public function getVersions(): Collection
{
return $this->epics;
return $this->versions;
}

public function addEpic(Epic $epic): self
public function addVersion(Version $version): self
{
if (!$this->epics->contains($epic)) {
$this->epics->add($epic);
if (!$this->versions->contains($version)) {
$this->versions->add($version);
}

return $this;
}

public function removeEpic(Epic $epic): self
public function removeVersion(Version $version): self
{
$this->epics->removeElement($epic);
$this->versions->removeElement($version);

return $this;
}

/**
* @return Collection<int, Version>
* @return Collection<int, Epic>
*/
public function getVersions(): Collection
public function getEpics(): Collection
{
return $this->versions;
return $this->epics;
}

public function addVersion(Version $version): self
public function addEpic(Epic $epic): self
{
if (!$this->versions->contains($version)) {
$this->versions->add($version);
if (!$this->epics->contains($epic)) {
$this->epics->add($epic);
}

return $this;
}

public function removeVersion(Version $version): self
public function removeEpic(Epic $epic): self
{
$this->versions->removeElement($version);
$this->epics->removeElement($epic);

return $this;
}
Expand Down
Loading
Loading