refactor: split buspro ApiClient into domain clients
This commit is contained in:
1 parent
0a55544ca8
commit
b755a6f43e
52 files changed
+805
-695
No files matched your search
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Controller\Account;
|
||||
|
||||
use App\BusProNet\ApiClient;
|
||||
use App\BusProNet\Client\AccountClient;
|
||||
use App\BusProNet\Exception\ApiClientException;
|
||||
use App\BusProNet\Model\Notification;
|
||||
use App\BusProNet\Model\PersonalData;
|
||||
@@ -39,7 +39,7 @@ class PersonalDataController extends AbstractController
|
||||
public const SESSION_REDIRECT_KEY = '_profile_completion_redirect';
|
||||
|
||||
/**
|
||||
* @param ApiClient $apiClient BusProNet API client for data operations
|
||||
* @param AccountClient $accountClient BusProNet account client
|
||||
* @param Crypt $crypt Encryption service for password handling
|
||||
* @param BookingEditDataLoader $dataLoader Data loader for cache invalidation
|
||||
* @param ProfileCompletenessChecker $completenessChecker Profile validation service
|
||||
@@ -48,7 +48,7 @@ class PersonalDataController extends AbstractController
|
||||
* @param LoggerInterface $logger Logger for audit trails and debugging
|
||||
*/
|
||||
public function __construct(
|
||||
private readonly ApiClient $apiClient,
|
||||
private readonly AccountClient $accountClient,
|
||||
private readonly Crypt $crypt,
|
||||
private readonly BookingEditDataLoader $dataLoader,
|
||||
private readonly ProfileCompletenessChecker $completenessChecker,
|
||||
@@ -100,7 +100,7 @@ class PersonalDataController extends AbstractController
|
||||
|
||||
if ($personalDataForm->isSubmitted() && $personalDataForm->isValid()) {
|
||||
try {
|
||||
$updateResult = $this->apiClient->updatePersonalData($email, $password, $personalData);
|
||||
$updateResult = $this->accountClient->updatePersonalData($email, $password, $personalData);
|
||||
|
||||
if ($updateResult instanceof Notification) {
|
||||
$this->logger->error('Personal data update rejected by BusProNet', [
|
||||
@@ -223,7 +223,7 @@ class PersonalDataController extends AbstractController
|
||||
|
||||
try {
|
||||
$personalData = $this
|
||||
->apiClient
|
||||
->accountClient
|
||||
->getPersonalData($email, $password);
|
||||
} catch (ApiClientException $e) {
|
||||
$this->addFlash('error', 'Deine persönlichen Daten konnten nicht abgerufen werden');
|
||||
|
||||
Reference in new issue
Block a user