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

2597: Add epic relations #183

Merged
merged 161 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
4a06795
Added epic entity
jeppekroghitk Jan 2, 2025
9118d44
Added issue epic entity relation
jeppekroghitk Jan 2, 2025
7b64887
Added IssueEpic entity
jeppekroghitk Jan 2, 2025
a9b9bd6
Added isBillable property to Version entity
jeppekroghitk Jan 2, 2025
e8b0915
Added enums for non billable epics and versions
jeppekroghitk Jan 2, 2025
563b810
Added epic repository
jeppekroghitk Jan 2, 2025
c0b1596
Updated changelog
jeppekroghitk Jan 2, 2025
1d64016
Added migrations
jeppekroghitk Jan 2, 2025
0eab1b9
Added synchronization of epics
jeppekroghitk Jan 2, 2025
3c33050
Coding standards
jeppekroghitk Jan 2, 2025
a67d05e
Removed unused join entity
jeppekroghitk Jan 3, 2025
c130f6f
Update IssueData model to include epics property.
jeppekroghitk Jan 3, 2025
42af925
Inject EpicRepository into DataProviderService and handle epics durin…
jeppekroghitk Jan 3, 2025
df44c54
Refactor DataSynchronizationService to process and add epics directly…
jeppekroghitk Jan 3, 2025
e7083d5
Enhance JiraApiService to fetch, create, and associate epics with iss…
jeppekroghitk Jan 3, 2025
d38227a
Integrate epic handling into LeantimeApiService, including parsing an…
jeppekroghitk Jan 3, 2025
2671c74
Coding standards
jeppekroghitk Jan 3, 2025
6c3b17a
Removed unused references from data sync service
jeppekroghitk Jan 3, 2025
4376bad
Only add epic if exists
jeppekroghitk Jan 3, 2025
967294d
Only add epic if exists
jeppekroghitk Jan 3, 2025
fb4bf22
2597: Changed how epics are synchronized
tuj Jan 6, 2025
7a9d84b
Added flush for foreach lookup to work
jeppekroghitk Jan 6, 2025
d1b5964
Updated symfony
tuj Jan 9, 2025
099623a
Updated changelog
tuj Jan 9, 2025
abe44e7
Updated changelog
tuj Jan 9, 2025
da00460
Npm audit fix
tuj Jan 10, 2025
a4db330
Updated changelog
tuj Jan 10, 2025
5177704
Added command to migrate epics from existing issues to individual ent…
jeppekroghitk Jan 6, 2025
7b7a362
Coding standards
jeppekroghitk Jan 6, 2025
4c9ceb6
Removed old comments
jeppekroghitk Jan 8, 2025
91b10a5
Update src/Command/MigrateEpicsCommand.php
jeppekroghitk Jan 10, 2025
21921ea
Implemented SymfonyStyle, removed unnecessary entitymanager operations
jeppekroghitk Jan 10, 2025
c5a374a
Added symfonystyle use, and re-added persist and flush for migration …
jeppekroghitk Jan 10, 2025
3ec8f03
2597: Added tests for migration command
tuj Jan 13, 2025
93f7e83
2597: Applied coding standards
tuj Jan 13, 2025
b0f85a9
2597: Fixed only explode for Leantime issues
tuj Jan 13, 2025
3aeb1bf
Updated changelog
jeppekroghitk Jan 13, 2025
68cc7c5
Merge branch 'develop' into feature/2597-add-epic-relations
jeppekroghitk Jan 13, 2025
8de270a
Update src/Service/JiraApiService.php
jeppekroghitk Jan 13, 2025
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
ccb5044
Merge pull request #184 from itk-dev/feature/3489-workload-report-per…
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

* [PR-185](https://github.com/itk-dev/economics/pull/186)
2597: Added epic migration command.
* [PR-183](https://github.com/itk-dev/economics/pull/183)
2597: Added epic relations.
* [PR-187](https://github.com/itk-dev/economics/pull/187)
Updated symfony bundles.
* [PR-189](https://github.com/itk-dev/economics/pull/189)
Npm audit.
* [PR-187](https://github.com/itk-dev/economics/pull/187)
Expand Down
39 changes: 39 additions & 0 deletions migrations/Version20250102102102.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?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 Version20250102102102 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('CREATE TABLE epic (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE issue_epic (issue_id INT NOT NULL, epic_id INT NOT NULL, INDEX IDX_412E98BD5E7AA58C (issue_id), INDEX IDX_412E98BD6B71E00E (epic_id), PRIMARY KEY(issue_id, epic_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE issue_epic ADD CONSTRAINT FK_412E98BD5E7AA58C FOREIGN KEY (issue_id) REFERENCES issue (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE issue_epic ADD CONSTRAINT FK_412E98BD6B71E00E FOREIGN KEY (epic_id) REFERENCES epic (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE version ADD is_billable TINYINT(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 issue_epic DROP FOREIGN KEY FK_412E98BD5E7AA58C');
$this->addSql('ALTER TABLE issue_epic DROP FOREIGN KEY FK_412E98BD6B71E00E');
$this->addSql('DROP TABLE epic');
$this->addSql('DROP TABLE issue_epic');
$this->addSql('ALTER TABLE version DROP is_billable');
}
}
42 changes: 42 additions & 0 deletions src/Command/MigrateEpicsCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace App\Command;

use App\Service\DataSynchronizationService;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

#[AsCommand(
name: 'app:migrate-epics',
description: 'Migrate epics for existing legacy issues, create the epics and add link to join table.',
)]
class MigrateEpicsCommand extends Command
{
public function __construct(
private DataSynchronizationService $dataSynchronizationService,
) {
parent::__construct();
}

protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);

$this->dataSynchronizationService->migrateEpics(function ($i, $length) use ($io) {
if (0 == $i) {
$io->progressStart($length);
} elseif ($i >= $length - 1) {
$io->progressFinish();
} else {
$io->progressAdvance();
}
});

$io->success('All issues have been processed successfully.');

return Command::SUCCESS;
}
}
14 changes: 11 additions & 3 deletions src/DataFixtures/AppFixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Entity\Client;
use App\Entity\DataProvider;
use App\Entity\Epic;
use App\Entity\Issue;
use App\Entity\Project;
use App\Entity\Version;
Expand Down Expand Up @@ -51,6 +52,10 @@ public function load(ObjectManager $manager): void
$workerArray[] = 'test'.$i.'@test';
}

$epic = new Epic();
$epic->setTitle('Epic 1');
$manager->persist($epic);

foreach ($dataProviders as $key => $dataProvider) {
$manager->persist($dataProvider);

Expand Down Expand Up @@ -113,8 +118,8 @@ public function load(ObjectManager $manager): void
$issue->setProjectTrackerId("issue-$i-$j");
$issue->setAccountId('Account 1');
$issue->setAccountKey('Account 1');
$issue->setEpicName('Epic 1');
$issue->setEpicKey('Epic 1');
$issue->setEpicName('Epic '.$j % 2 .(1 == $key && 0 == $j % 5 ? ',More than one Epic' : ''));
$issue->setEpicKey('Epic '.$j % 2 .(1 == $key && 0 == $j % 5 ? ',More than one Epic' : ''));
$issue->setStatus($modStatus);
$issue->setDataProvider($dataProvider);
$issue->addVersion($versions[$j % count($versions)]);
Expand All @@ -125,9 +130,12 @@ public function load(ObjectManager $manager): void
$issue->setDueDate(new \DateTime());
$issue->setWorker($workerArray[rand(0, 9)]);
$issue->setLinkToIssue('www.example.com');

$manager->persist($issue);

if (0 == $key && 0 == $i && 0 == $j) {
$issue->addEpic($epic);
}

for ($k = 0; $k < 100; ++$k) {
$year = (new \DateTime())->format('Y');

Expand Down
68 changes: 68 additions & 0 deletions src/Entity/Epic.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

namespace App\Entity;

use App\Repository\EpicRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity(repositoryClass: EpicRepository::class)]
class Epic
{
public function __construct()
{
$this->issues = new ArrayCollection();
}
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;

#[ORM\Column(length: 255)]
private ?string $title = null;

#[ORM\ManyToMany(targetEntity: Issue::class, mappedBy: 'epics')]
private Collection $issues;

public function getId(): ?int
{
return $this->id;
}

public function getTitle(): ?string
{
return $this->title;
}

public function setTitle(string $title): static
{
$this->title = $title;

return $this;
}

/**
* @return Collection<int, Epic>
*/
public function getIssues(): Collection
{
return $this->issues;
}

public function addIssue(Issue $issue): self
{
if (!$this->issues->contains($issue)) {
$this->issues->add($issue);
}

return $this;
}

public function removeIssue(Issue $issues): self
{
$this->issues->removeElement($issues);

return $this;
}
}
28 changes: 28 additions & 0 deletions src/Entity/Issue.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class Issue extends AbstractBaseEntity
#[ORM\Column(length: 255, nullable: true)]
private ?string $epicName = null;

#[ORM\ManyToMany(targetEntity: Epic::class, inversedBy: 'issues')]
private Collection $epics;

#[ORM\ManyToMany(targetEntity: Version::class, inversedBy: 'issues')]
private Collection $versions;

Expand Down Expand Up @@ -79,6 +82,7 @@ public function __construct()
$this->versions = new ArrayCollection();
$this->worklogs = new ArrayCollection();
$this->products = new ArrayCollection();
$this->epics = new ArrayCollection();
}

public function getName(): ?string
Expand Down Expand Up @@ -177,6 +181,30 @@ public function setEpicName(?string $epicName): self
return $this;
}

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

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

return $this;
}

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

return $this;
}

/**
* @return Collection<int, Version>
*/
Expand Down
15 changes: 15 additions & 0 deletions src/Entity/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class Version extends AbstractBaseEntity
#[ORM\ManyToMany(targetEntity: Issue::class, mappedBy: 'versions')]
private Collection $issues;

#[ORM\Column]
private ?bool $isBillable = true;

public function __construct()
{
$this->issues = new ArrayCollection();
Expand Down Expand Up @@ -101,4 +104,16 @@ public function removeIssue(Issue $issue): self

return $this;
}

public function isBillable(): ?bool
{
return $this->isBillable;
}

public function setIsBillable(bool $isBillable): static
{
$this->isBillable = $isBillable;

return $this;
}
}
24 changes: 24 additions & 0 deletions src/Enum/NonBillableEpicsEnum.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Enum;

/*
* Kind is a term on a worklog in Leantime:
* https://github.com/Leantime/leantime/blob/80c4542e19692e423820bd9030907070d281571e/app/Domain/Timesheets/Services/Timesheets.php#L22
* */
enum NonBillableEpicsEnum: string
{
case UB = 'UB';

/**
* @return array<string,string>
*/
public static function getAsArray(): array
{
return array_reduce(
self::cases(),
static fn (array $choices, NonBillableEpicsEnum $type) => $choices + [$type->name => $type->value],
[],
);
}
}
20 changes: 20 additions & 0 deletions src/Enum/NonBillableVersionsEnum.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\Enum;

enum NonBillableVersionsEnum: string
{
case UB = 'UB';

/**
* @return array<string,string>
*/
public static function getAsArray(): array
{
return array_reduce(
self::cases(),
static fn (array $choices, NonBillableVersionsEnum $type) => $choices + [$type->name => $type->value],
[],
);
}
}
3 changes: 2 additions & 1 deletion src/Model/Invoices/IssueData.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ class IssueData
public ?string $accountKey = null;
public ?string $epicName = null;
public ?string $epicKey = null;
public array $epics;
/** @var Collection<string, VersionData> */
public ?Collection $versions;
public Collection $versions;
public ?\DateTime $resolutionDate = null;
public string $projectId;
public ?int $planHours;
Expand Down
41 changes: 41 additions & 0 deletions src/Repository/EpicRepository.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace App\Repository;

use App\Entity\Epic;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;

/**
* @extends ServiceEntityRepository<Epic>
*
* @method Epic|null find($id, $lockMode = null, $lockVersion = null)
* @method Epic|null findOneBy(array $criteria, array $orderBy = null)
* @method Epic[] findAll()
* @method Epic[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class EpicRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Epic::class);
}

public function save(Epic $entity, bool $flush = false): void
{
$this->getEntityManager()->persist($entity);

if ($flush) {
$this->getEntityManager()->flush();
}
}

public function remove(Epic $entity, bool $flush = false): void
{
$this->getEntityManager()->remove($entity);

if ($flush) {
$this->getEntityManager()->flush();
}
}
}
2 changes: 1 addition & 1 deletion src/Service/DataProviderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function getService(DataProvider $dataProvider): DataProviderServiceInter
$this->weekGoalLow,
$this->weekGoalHigh,
$this->sprintNameRegex,
$this->dateTimeHelper
$this->dateTimeHelper,
);
break;
default:
Expand Down
Loading
Loading