feat(dashboard): add price dashboard with Zonneplan integration
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Features\Dashboard\Repositories;
|
||||
|
||||
use App\Features\Dashboard\Contracts\PriceClient;
|
||||
use App\Features\Dashboard\Contracts\PriceRepository as ContractsPriceRepository;
|
||||
use App\Features\Dashboard\Data\ElectricityData;
|
||||
use App\Features\Dashboard\Data\GasData;
|
||||
use Illuminate\Support\Collection;
|
||||
use Override;
|
||||
|
||||
class ZonneplanPriceRepository implements ContractsPriceRepository
|
||||
{
|
||||
public function __construct(
|
||||
public PriceClient $client
|
||||
) {}
|
||||
|
||||
#[Override]
|
||||
public function retrieveElectricity(): Collection
|
||||
{
|
||||
$data = $this->client->getElectricityPrices();
|
||||
|
||||
return collect(ElectricityData::collect($data));
|
||||
}
|
||||
|
||||
#[Override]
|
||||
public function retrieveGas(): Collection
|
||||
{
|
||||
$data = $this->client->getGasPrices();
|
||||
|
||||
return collect(GasData::collect($data));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user