55 lines
1.3 KiB
PHP
55 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Services\Api;
|
|
|
|
use Illuminate\Http\UploadedFile;
|
|
|
|
class FuelPriceService extends BaseApiService
|
|
{
|
|
public function getCurrentPrices(array $params = [])
|
|
{
|
|
return $this->get('/fuel-prices/current', $params);
|
|
}
|
|
|
|
public function updatePrices(array $data)
|
|
{
|
|
return $this->post('/fuel-prices/update', $data);
|
|
}
|
|
|
|
public function getScheduledUpdates(array $params = [])
|
|
{
|
|
return $this->get('/fuel-prices/schedule', $params);
|
|
}
|
|
|
|
public function createSchedule(array $data)
|
|
{
|
|
return $this->post('/fuel-prices/schedule', $data);
|
|
}
|
|
|
|
public function updateSchedule($id, array $data)
|
|
{
|
|
return $this->post("/fuel-prices/schedule/{$id}", array_merge($data, ['_method' => 'PUT']));
|
|
}
|
|
|
|
public function deleteSchedule($id)
|
|
{
|
|
return $this->post("/fuel-prices/schedule/{$id}", ['_method' => 'DELETE']);
|
|
}
|
|
|
|
public function getUpdateLogs(array $params = [])
|
|
{
|
|
return $this->get('/fuel-prices/logs', $params);
|
|
}
|
|
|
|
public function importPrices(UploadedFile $file)
|
|
{
|
|
return $this->post('/fuel-prices/import', [
|
|
'file' => $file
|
|
], true);
|
|
}
|
|
|
|
public function exportPrices()
|
|
{
|
|
return $this->get('/fuel-prices/export');
|
|
}
|
|
}
|