feat: forced teamer data verification after configured due dates

addresses #869b33c7p
This commit is contained in:
Björn Fromme committed 2026-03-15 12:42:28 +01:00
1 parent 20da6a0afc
commit 518bc7339f
19 files changed
+357 -14

No files matched your search

+2 -1
View File
@@ -6,6 +6,7 @@ use App\BusProNet\Model\BaseDataResponse;
use App\BusProNet\Model\CrmAttributesResponse;
use App\BusProNet\Model\NotificationResponse;
use App\BusProNet\Model\ProfileResponse;
use App\BusProNet\Model\ProfileUpdateResponse;
use App\Entity\User;
use League\Flysystem\FilesystemException;
use League\Flysystem\FilesystemOperator;
@@ -60,7 +61,7 @@ class ApiClient
* @throws ApiClientException
* @throws ResponseParserException
*/
public function updateProfile(User $user, string $password): NotificationResponse|ProfileResponse
public function updateProfile(User $user, string $password): NotificationResponse|ProfileUpdateResponse
{
if (null === $teamer = $user->getTeamer()) {
throw new ApiClientException('Invalid argument');
@@ -0,0 +1,46 @@
<?php
namespace App\BusProNet\Model;
class ProfileUpdateResponse
{
private ?int $addressId = null;
private ?int $personId = null;
private bool $updated = false;
public function getAddressId(): ?int
{
return $this->addressId;
}
public function setAddressId(?int $addressId): static
{
$this->addressId = $addressId;
return $this;
}
public function getPersonId(): ?int
{
return $this->personId;
}
public function setPersonId(?int $personId): static
{
$this->personId = $personId;
return $this;
}
public function isUpdated(): bool
{
return $this->updated;
}
public function setUpdated(bool $updated): static
{
$this->updated = $updated;
return $this;
}
}
+24 -1
View File
@@ -13,6 +13,7 @@ use App\BusProNet\Model\Hotel;
use App\BusProNet\Model\NotificationResponse;
use App\BusProNet\Model\Pickup;
use App\BusProNet\Model\ProfileResponse;
use App\BusProNet\Model\ProfileUpdateResponse;
use Symfony\Component\OptionsResolver\OptionsResolver;
class ResponseParser
@@ -45,8 +46,9 @@ class ResponseParser
$subType = (string) $xml->art;
switch ($subType) {
case 'Adressdaten':
case 'Adressdaten_Ändern':
return $this->createProfileResponse($xml);
case 'Adressdaten_Ändern':
return $this->createProfileUpdateResponse($xml);
case 'SelektionCRM':
case 'SelektionCRM_Ändern':
return $this->createCrmAttributesResponse($xml);
@@ -138,6 +140,27 @@ class ResponseParser
return $response;
}
public function createProfileUpdateResponse(\SimpleXMLElement $xml): ProfileUpdateResponse
{
$addressId = (int) $xml->idadresse;
$personId = (int) $xml->idperson;
$updated = false;
$updatedXml = $xml->xpath('änderung|aenderung');
if (0 < count($updatedXml)) {
$updated = 'true' === strtolower((string) $updatedXml[0]);
}
$response = new ProfileUpdateResponse();
$response
->setAddressId($addressId)
->setPersonId($personId)
->setUpdated($updated)
;
return $response;
}
public function createCrmAttributesResponse(\SimpleXMLElement $xml): CrmAttributesResponse
{
$groups = [];