first commit
This commit is contained in:
17
laravel/app/Contracts/WbClientInterface.php
Normal file
17
laravel/app/Contracts/WbClientInterface.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Contracts;
|
||||
|
||||
use App\DTO\WbRequestDTO;
|
||||
use App\Exceptions\WbServiceException;
|
||||
|
||||
interface WbClientInterface
|
||||
{
|
||||
/**
|
||||
* @throws WbServiceException
|
||||
*/
|
||||
public function fetch(WbRequestDTO $requestDTO): array;
|
||||
}
|
||||
12
laravel/app/Contracts/WbSyncFactoryInterface.php
Normal file
12
laravel/app/Contracts/WbSyncFactoryInterface.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Contracts;
|
||||
|
||||
use App\Enums\WbEndpoint;
|
||||
|
||||
interface WbSyncFactoryInterface
|
||||
{
|
||||
public function make(WbEndpoint $type): WbSyncInterface;
|
||||
}
|
||||
14
laravel/app/Contracts/WbSyncInterface.php
Normal file
14
laravel/app/Contracts/WbSyncInterface.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Contracts;
|
||||
|
||||
use App\DTO\WbRequestDTO;
|
||||
|
||||
interface WbSyncInterface
|
||||
{
|
||||
public function sync(WbRequestDTO $dto): array;
|
||||
|
||||
public function save(array $data): void;
|
||||
}
|
||||
41
laravel/app/Contracts/WbSyncManagerInterface.php
Normal file
41
laravel/app/Contracts/WbSyncManagerInterface.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Contracts;
|
||||
|
||||
use App\Enums\WbEndpoint;
|
||||
|
||||
interface WbSyncManagerInterface
|
||||
{
|
||||
public function start(
|
||||
WbEndpoint $endpoint,
|
||||
string $dateFrom,
|
||||
?string $dateTo = null
|
||||
): void;
|
||||
|
||||
public function handleFirstPage(
|
||||
WbEndpoint $endpoint,
|
||||
string $dateFrom,
|
||||
?string $dateTo,
|
||||
int $lastPage
|
||||
): void;
|
||||
|
||||
public function incrementProgress(
|
||||
WbEndpoint $endpoint,
|
||||
string $dateFrom,
|
||||
?string $dateTo
|
||||
): void;
|
||||
|
||||
public function markSuccess(
|
||||
WbEndpoint $endpoint,
|
||||
string $dateFrom,
|
||||
?string $dateTo
|
||||
): void;
|
||||
|
||||
public function markFailed(
|
||||
WbEndpoint $endpoint,
|
||||
string $dateFrom,
|
||||
?string $dateTo
|
||||
): void;
|
||||
}
|
||||
Reference in New Issue
Block a user