From fbbebbc7589b7b0c122b641645075df5690a25b5 Mon Sep 17 00:00:00 2001 From: Daniel Subiabre Date: Tue, 11 Feb 2025 12:22:29 +0100 Subject: [PATCH] Deprecate AccountingSeries for AccountingBalancePoint --- .../AccountingSeriesApiResource.php | 54 ------------------- src/Dto/AccountingSeriesDto.php | 41 -------------- .../AccountingBalancePointStateProvider.php | 4 +- .../AccountingSeriesStateProcessor.php | 48 ----------------- 4 files changed, 1 insertion(+), 146 deletions(-) delete mode 100644 src/ApiResource/Accounting/AccountingSeriesApiResource.php delete mode 100644 src/Dto/AccountingSeriesDto.php delete mode 100644 src/State/Accounting/AccountingSeriesStateProcessor.php diff --git a/src/ApiResource/Accounting/AccountingSeriesApiResource.php b/src/ApiResource/Accounting/AccountingSeriesApiResource.php deleted file mode 100644 index c56693d..0000000 --- a/src/ApiResource/Accounting/AccountingSeriesApiResource.php +++ /dev/null @@ -1,54 +0,0 @@ - - */ - public array $data; -} diff --git a/src/Dto/AccountingSeriesDto.php b/src/Dto/AccountingSeriesDto.php deleted file mode 100644 index 94e8087..0000000 --- a/src/Dto/AccountingSeriesDto.php +++ /dev/null @@ -1,41 +0,0 @@ -end ??= new \DateTimeImmutable('now'); - } -} diff --git a/src/State/Accounting/AccountingBalancePointStateProvider.php b/src/State/Accounting/AccountingBalancePointStateProvider.php index b719635..853eecb 100644 --- a/src/State/Accounting/AccountingBalancePointStateProvider.php +++ b/src/State/Accounting/AccountingBalancePointStateProvider.php @@ -25,9 +25,7 @@ class AccountingBalancePointStateProvider implements ProviderInterface $accounting = $this->getAccounting($parameters); $period = $this->buildPeriod($parameters); - $points = $this->accountingService->calcBalancePoints($accounting, $period); - - dd($points); + return $this->accountingService->calcBalancePoints($accounting, $period); } private function getAccounting(Parameters $parameters): Accounting diff --git a/src/State/Accounting/AccountingSeriesStateProcessor.php b/src/State/Accounting/AccountingSeriesStateProcessor.php deleted file mode 100644 index cbd4ad1..0000000 --- a/src/State/Accounting/AccountingSeriesStateProcessor.php +++ /dev/null @@ -1,48 +0,0 @@ -autoMapper->map($data->accounting, Accounting::class); - - $points = $this->accountingService->calcBalanceSeries( - $accounting, - new \DatePeriod( - $data->start, - new \DateInterval(\sprintf('PT%s', $data->interval)), - $data->end, - \DatePeriod::INCLUDE_END_DATE - ) - ); - - /** @var AccountingSeriesApiResource */ - $series = $this->autoMapper->map($data, AccountingSeriesApiResource::class); - - $series->data = $points; - $series->length = \count($points); - - return $series; - } -}