develop-jenkins
parent
ca23d41241
commit
179f36ebef
|
@ -58,6 +58,13 @@ final class ClientInput
|
||||||
)]
|
)]
|
||||||
public ?string $ip = null;
|
public ?string $ip = null;
|
||||||
|
|
||||||
|
#[Groups(['client:write'])]
|
||||||
|
#[ApiProperty(
|
||||||
|
description: 'El estado del cliente',
|
||||||
|
example: 'active'
|
||||||
|
)]
|
||||||
|
public ?string $status = 'power-off';
|
||||||
|
|
||||||
#[Assert\NotNull(message: 'validators.organizational_unit.not_null')]
|
#[Assert\NotNull(message: 'validators.organizational_unit.not_null')]
|
||||||
#[Groups(['client:write', 'client:patch'])]
|
#[Groups(['client:write', 'client:patch'])]
|
||||||
#[ApiProperty(
|
#[ApiProperty(
|
||||||
|
@ -109,6 +116,7 @@ final class ClientInput
|
||||||
$this->mac = $client->getMac();
|
$this->mac = $client->getMac();
|
||||||
$this->ip = $client->getIp();
|
$this->ip = $client->getIp();
|
||||||
$this->position = $client->getPosition();
|
$this->position = $client->getPosition();
|
||||||
|
$this->status = $client->getStatus();
|
||||||
|
|
||||||
if ($client->getMenu()) {
|
if ($client->getMenu()) {
|
||||||
$this->menu = new MenuOutput($client->getMenu());
|
$this->menu = new MenuOutput($client->getMenu());
|
||||||
|
@ -140,6 +148,7 @@ final class ClientInput
|
||||||
$client->setOgLive($this->ogLive?->getEntity());
|
$client->setOgLive($this->ogLive?->getEntity());
|
||||||
$client->setHardwareProfile($this->hardwareProfile?->getEntity());
|
$client->setHardwareProfile($this->hardwareProfile?->getEntity());
|
||||||
$client->setPosition($this->position);
|
$client->setPosition($this->position);
|
||||||
|
$client->setStatus($this->status);
|
||||||
|
|
||||||
return $client;
|
return $client;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ class OrganizationalUnitInput
|
||||||
public ?RemoteCalendarOutput $remoteCalendar = null;
|
public ?RemoteCalendarOutput $remoteCalendar = null;
|
||||||
|
|
||||||
#[Groups(['organizational-unit:write'])]
|
#[Groups(['organizational-unit:write'])]
|
||||||
public ?bool $remotePc = null;
|
public ?bool $remotePc = false;
|
||||||
|
|
||||||
public function __construct(?OrganizationalUnit $organizationalUnit = null)
|
public function __construct(?OrganizationalUnit $organizationalUnit = null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,6 +55,9 @@ final class ClientOutput extends AbstractOutput
|
||||||
#[Groups(['client:read'])]
|
#[Groups(['client:read'])]
|
||||||
public ?array $position = ['x' => 0, 'y' => 0];
|
public ?array $position = ['x' => 0, 'y' => 0];
|
||||||
|
|
||||||
|
#[Groups(['client:read'])]
|
||||||
|
public ?string $status = '';
|
||||||
|
|
||||||
#[Groups(['client:read'])]
|
#[Groups(['client:read'])]
|
||||||
public \DateTime $createdAt;
|
public \DateTime $createdAt;
|
||||||
|
|
||||||
|
@ -84,6 +87,7 @@ final class ClientOutput extends AbstractOutput
|
||||||
$this->position = $client->getPosition();
|
$this->position = $client->getPosition();
|
||||||
$this->hardwareProfile = $client->getHardwareProfile() ? new HardwareProfileOutput($client->getHardwareProfile()) : null;
|
$this->hardwareProfile = $client->getHardwareProfile() ? new HardwareProfileOutput($client->getHardwareProfile()) : null;
|
||||||
$this->ogLive = $client->getOgLive() ? new OgLiveOutput($client->getOgLive()) : null;
|
$this->ogLive = $client->getOgLive() ? new OgLiveOutput($client->getOgLive()) : null;
|
||||||
|
$this->status = $client->getStatus();
|
||||||
$this->createdAt = $client->getCreatedAt();
|
$this->createdAt = $client->getCreatedAt();
|
||||||
$this->createdBy = $client->getCreatedBy();
|
$this->createdBy = $client->getCreatedBy();
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,6 @@ final class OrganizationalUnitOutput extends AbstractOutput
|
||||||
)->toArray();
|
)->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->path = $organizationalUnit->getPath();
|
$this->path = $organizationalUnit->getPath();
|
||||||
$this->createdAt = $organizationalUnit->getCreatedAt();
|
$this->createdAt = $organizationalUnit->getCreatedAt();
|
||||||
$this->createdBy = $organizationalUnit->getCreatedBy();
|
$this->createdBy = $organizationalUnit->getCreatedBy();
|
||||||
|
|
|
@ -10,7 +10,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
||||||
#[Get(shortName: 'RemoteCalendar')]
|
#[Get(shortName: 'RemoteCalendar')]
|
||||||
final class RemoteCalendarOutput extends AbstractOutput
|
final class RemoteCalendarOutput extends AbstractOutput
|
||||||
{
|
{
|
||||||
#[Groups(['remote-calendar:read'])]
|
#[Groups(['remote-calendar:read', 'organizational-unit:read'])]
|
||||||
public ?string $name = null;
|
public ?string $name = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -90,7 +90,7 @@ class UDSClient
|
||||||
$this->scrambler = $data['scrambler'];
|
$this->scrambler = $data['scrambler'];
|
||||||
|
|
||||||
} catch (TransportExceptionInterface $e) {
|
} catch (TransportExceptionInterface $e) {
|
||||||
throw new TransportException('Error while logging in');
|
throw new TransportException('Error while logging in to UDS');
|
||||||
} catch (ClientExceptionInterface|ServerExceptionInterface|RedirectionExceptionInterface $e) {
|
} catch (ClientExceptionInterface|ServerExceptionInterface|RedirectionExceptionInterface $e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,14 +142,15 @@ class UDSClient
|
||||||
|
|
||||||
public function getMaxAvailableSeats(int $organizationalUnitId): int
|
public function getMaxAvailableSeats(int $organizationalUnitId): int
|
||||||
{
|
{
|
||||||
$organizationalUnit = $this->entityManager->getRepository(OrganizationalUnit::class)->find($organizationalUnitId);
|
$organizationalUnit = $this->entityManager->getRepository(OrganizationalUnit::class)->findOneBy(['migrationId' => $organizationalUnitId]);
|
||||||
|
|
||||||
if (!$organizationalUnit) {
|
if (!$organizationalUnit) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$remoteCalendar = $organizationalUnit->getRemoteCalendar();
|
$remoteCalendar = $organizationalUnit->getRemoteCalendar();
|
||||||
if (!$remoteCalendar || !$remoteCalendar->isRemoteAvailable()) {
|
$aux = $remoteCalendar->isAvailable();
|
||||||
|
if (!$remoteCalendar || !$aux) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue