From 272ec995385dc1ed05e21b66a7a65ada7845847f Mon Sep 17 00:00:00 2001 From: Dani Garcia Date: Mon, 28 Oct 2024 09:15:23 +0100 Subject: [PATCH 01/10] schema: remove obsolete fields --- .../Mapping/Carrier.CarrierAbstract.orm.xml | 5 -- .../Mapping/Company.CompanyAbstract.orm.xml | 10 ---- .../DdiProvider.DdiProviderAbstract.orm.xml | 5 -- .../Version20241028083130.php | 53 +++++++++++++++++++ 4 files changed, 53 insertions(+), 20 deletions(-) create mode 100644 schema/DoctrineMigrations/Version20241028083130.php diff --git a/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/Mapping/Carrier.CarrierAbstract.orm.xml b/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/Mapping/Carrier.CarrierAbstract.orm.xml index a4f3c8a9c3..4ee8c0520e 100644 --- a/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/Mapping/Carrier.CarrierAbstract.orm.xml +++ b/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/Mapping/Carrier.CarrierAbstract.orm.xml @@ -46,11 +46,6 @@ - - - - - diff --git a/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/Mapping/Company.CompanyAbstract.orm.xml b/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/Mapping/Company.CompanyAbstract.orm.xml index e53ffb8d8d..ece5e89edf 100644 --- a/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/Mapping/Company.CompanyAbstract.orm.xml +++ b/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/Mapping/Company.CompanyAbstract.orm.xml @@ -109,11 +109,6 @@ - - - - - @@ -129,11 +124,6 @@ - - - - - diff --git a/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/Mapping/DdiProvider.DdiProviderAbstract.orm.xml b/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/Mapping/DdiProvider.DdiProviderAbstract.orm.xml index d84323c20c..22c48c2e92 100644 --- a/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/Mapping/DdiProvider.DdiProviderAbstract.orm.xml +++ b/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/Mapping/DdiProvider.DdiProviderAbstract.orm.xml @@ -30,11 +30,6 @@ - - - - - diff --git a/schema/DoctrineMigrations/Version20241028083130.php b/schema/DoctrineMigrations/Version20241028083130.php new file mode 100644 index 0000000000..9be476a182 --- /dev/null +++ b/schema/DoctrineMigrations/Version20241028083130.php @@ -0,0 +1,53 @@ +addSql('ALTER TABLE Carriers DROP FOREIGN KEY FK_F63EC8E3C8555117'); + $this->addSql('DROP INDEX IDX_F63EC8E3C8555117 ON Carriers'); + $this->addSql('ALTER TABLE Carriers DROP mediaRelaySetsId'); + + $this->addSql('ALTER TABLE Companies DROP FOREIGN KEY FK_B52899C8555117'); + $this->addSql('ALTER TABLE Companies DROP FOREIGN KEY Companies_ibfk_5'); + $this->addSql('DROP INDEX IDX_B52899F862FFE7 ON Companies'); + $this->addSql('DROP INDEX IDX_B52899C8555117 ON Companies'); + $this->addSql('ALTER TABLE Companies DROP applicationServerId, DROP mediaRelaySetsId'); + + $this->addSql('ALTER TABLE DDIProviders DROP FOREIGN KEY FK_CA534EFDC8555117'); + $this->addSql('DROP INDEX IDX_CA534EFDC8555117 ON DDIProviders'); + $this->addSql('ALTER TABLE DDIProviders DROP mediaRelaySetsId'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE Carriers ADD mediaRelaySetsId INT UNSIGNED DEFAULT NULL'); + $this->addSql('ALTER TABLE Carriers ADD CONSTRAINT FK_F63EC8E3C8555117 FOREIGN KEY (mediaRelaySetsId) REFERENCES MediaRelaySets (id) ON UPDATE NO ACTION ON DELETE SET NULL'); + $this->addSql('CREATE INDEX IDX_F63EC8E3C8555117 ON Carriers (mediaRelaySetsId)'); + + $this->addSql('ALTER TABLE Companies ADD applicationServerId INT UNSIGNED DEFAULT NULL, ADD mediaRelaySetsId INT UNSIGNED DEFAULT NULL'); + $this->addSql('ALTER TABLE Companies ADD CONSTRAINT FK_B52899C8555117 FOREIGN KEY (mediaRelaySetsId) REFERENCES MediaRelaySets (id) ON DELETE SET NULL'); + $this->addSql('ALTER TABLE Companies ADD CONSTRAINT Companies_ibfk_5 FOREIGN KEY (applicationServerId) REFERENCES ApplicationServers (id) ON DELETE SET NULL'); + $this->addSql('CREATE INDEX IDX_B52899F862FFE7 ON Companies (applicationServerId)'); + $this->addSql('CREATE INDEX IDX_B52899C8555117 ON Companies (mediaRelaySetsId)'); + + $this->addSql('ALTER TABLE DDIProviders ADD mediaRelaySetsId INT UNSIGNED DEFAULT NULL'); + $this->addSql('ALTER TABLE DDIProviders ADD CONSTRAINT FK_CA534EFDC8555117 FOREIGN KEY (mediaRelaySetsId) REFERENCES MediaRelaySets (id) ON UPDATE NO ACTION ON DELETE SET NULL'); + $this->addSql('CREATE INDEX IDX_CA534EFDC8555117 ON DDIProviders (mediaRelaySetsId)'); + } +} \ No newline at end of file From cbe12f74f00d1802e15c2ac10c04bb0c6b6d508a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Mon, 28 Oct 2024 09:30:27 +0100 Subject: [PATCH 02/10] core: regenerated entities --- .../Domain/Model/Carrier/CarrierAbstract.php | 21 ----- .../Model/Carrier/CarrierDtoAbstract.php | 37 --------- .../Domain/Model/Carrier/CarrierInterface.php | 2 - .../Domain/Model/Company/CompanyAbstract.php | 48 +----------- .../Model/Company/CompanyDtoAbstract.php | 77 +------------------ .../Domain/Model/Company/CompanyInterface.php | 7 +- .../Model/DdiProvider/DdiProviderAbstract.php | 21 ----- .../DdiProvider/DdiProviderDtoAbstract.php | 37 --------- .../DdiProvider/DdiProviderInterface.php | 2 - .../CompanyLifecycleServiceCollection.php | 1 - 10 files changed, 4 insertions(+), 249 deletions(-) diff --git a/library/Ivoz/Provider/Domain/Model/Carrier/CarrierAbstract.php b/library/Ivoz/Provider/Domain/Model/Carrier/CarrierAbstract.php index e1d415afde..6a7a8be6e9 100644 --- a/library/Ivoz/Provider/Domain/Model/Carrier/CarrierAbstract.php +++ b/library/Ivoz/Provider/Domain/Model/Carrier/CarrierAbstract.php @@ -68,11 +68,6 @@ abstract class CarrierAbstract */ protected $proxyTrunk = null; - /** - * @var ?MediaRelaySetInterface - */ - protected $mediaRelaySets = null; - /** * @var MediaRelaySetInterface */ @@ -171,7 +166,6 @@ public static function fromDto( ->setTransformationRuleSet($fkTransformer->transform($dto->getTransformationRuleSet())) ->setCurrency($fkTransformer->transform($dto->getCurrency())) ->setProxyTrunk($fkTransformer->transform($dto->getProxyTrunk())) - ->setMediaRelaySets($fkTransformer->transform($dto->getMediaRelaySets())) ->setMediaRelaySet($fkTransformer->transform($mediaRelaySet)); $self->initChangelog(); @@ -207,7 +201,6 @@ public function updateFromDto( ->setTransformationRuleSet($fkTransformer->transform($dto->getTransformationRuleSet())) ->setCurrency($fkTransformer->transform($dto->getCurrency())) ->setProxyTrunk($fkTransformer->transform($dto->getProxyTrunk())) - ->setMediaRelaySets($fkTransformer->transform($dto->getMediaRelaySets())) ->setMediaRelaySet($fkTransformer->transform($mediaRelaySet)); return $this; @@ -227,7 +220,6 @@ public function toDto(int $depth = 0): CarrierDto ->setTransformationRuleSet(TransformationRuleSet::entityToDto(self::getTransformationRuleSet(), $depth)) ->setCurrency(Currency::entityToDto(self::getCurrency(), $depth)) ->setProxyTrunk(ProxyTrunk::entityToDto(self::getProxyTrunk(), $depth)) - ->setMediaRelaySets(MediaRelaySet::entityToDto(self::getMediaRelaySets(), $depth)) ->setMediaRelaySet(MediaRelaySet::entityToDto(self::getMediaRelaySet(), $depth)); } @@ -245,7 +237,6 @@ protected function __toArray(): array 'transformationRuleSetId' => self::getTransformationRuleSet()?->getId(), 'currencyId' => self::getCurrency()?->getId(), 'proxyTrunkId' => self::getProxyTrunk()?->getId(), - 'mediaRelaySetsId' => self::getMediaRelaySets()?->getId(), 'mediaRelaySetId' => self::getMediaRelaySet()->getId() ]; } @@ -354,18 +345,6 @@ public function getProxyTrunk(): ?ProxyTrunkInterface return $this->proxyTrunk; } - protected function setMediaRelaySets(?MediaRelaySetInterface $mediaRelaySets = null): static - { - $this->mediaRelaySets = $mediaRelaySets; - - return $this; - } - - public function getMediaRelaySets(): ?MediaRelaySetInterface - { - return $this->mediaRelaySets; - } - protected function setMediaRelaySet(MediaRelaySetInterface $mediaRelaySet): static { $this->mediaRelaySet = $mediaRelaySet; diff --git a/library/Ivoz/Provider/Domain/Model/Carrier/CarrierDtoAbstract.php b/library/Ivoz/Provider/Domain/Model/Carrier/CarrierDtoAbstract.php index cce6fe4c6d..6581b83e81 100644 --- a/library/Ivoz/Provider/Domain/Model/Carrier/CarrierDtoAbstract.php +++ b/library/Ivoz/Provider/Domain/Model/Carrier/CarrierDtoAbstract.php @@ -68,11 +68,6 @@ abstract class CarrierDtoAbstract implements DataTransferObjectInterface */ private $proxyTrunk = null; - /** - * @var MediaRelaySetDto | null - */ - private $mediaRelaySets = null; - /** * @var MediaRelaySetDto | null */ @@ -127,7 +122,6 @@ public static function getPropertyMap(string $context = '', string $role = null) 'transformationRuleSetId' => 'transformationRuleSet', 'currencyId' => 'currency', 'proxyTrunkId' => 'proxyTrunk', - 'mediaRelaySetsId' => 'mediaRelaySets', 'mediaRelaySetId' => 'mediaRelaySet' ]; } @@ -147,7 +141,6 @@ public function toArray(bool $hideSensitiveData = false): array 'transformationRuleSet' => $this->getTransformationRuleSet(), 'currency' => $this->getCurrency(), 'proxyTrunk' => $this->getProxyTrunk(), - 'mediaRelaySets' => $this->getMediaRelaySets(), 'mediaRelaySet' => $this->getMediaRelaySet(), 'outgoingRoutings' => $this->getOutgoingRoutings(), 'outgoingRoutingsRelCarriers' => $this->getOutgoingRoutingsRelCarriers(), @@ -353,36 +346,6 @@ public function getProxyTrunkId(): ?int return null; } - public function setMediaRelaySets(?MediaRelaySetDto $mediaRelaySets): static - { - $this->mediaRelaySets = $mediaRelaySets; - - return $this; - } - - public function getMediaRelaySets(): ?MediaRelaySetDto - { - return $this->mediaRelaySets; - } - - public function setMediaRelaySetsId(?int $id): static - { - $value = !is_null($id) - ? new MediaRelaySetDto($id) - : null; - - return $this->setMediaRelaySets($value); - } - - public function getMediaRelaySetsId(): ?int - { - if ($dto = $this->getMediaRelaySets()) { - return $dto->getId(); - } - - return null; - } - public function setMediaRelaySet(?MediaRelaySetDto $mediaRelaySet): static { $this->mediaRelaySet = $mediaRelaySet; diff --git a/library/Ivoz/Provider/Domain/Model/Carrier/CarrierInterface.php b/library/Ivoz/Provider/Domain/Model/Carrier/CarrierInterface.php index d079fa1169..358e46f7f0 100644 --- a/library/Ivoz/Provider/Domain/Model/Carrier/CarrierInterface.php +++ b/library/Ivoz/Provider/Domain/Model/Carrier/CarrierInterface.php @@ -91,8 +91,6 @@ public function getCurrency(): ?CurrencyInterface; public function getProxyTrunk(): ?ProxyTrunkInterface; - public function getMediaRelaySets(): ?MediaRelaySetInterface; - public function getMediaRelaySet(): MediaRelaySetInterface; public function addOutgoingRouting(OutgoingRoutingInterface $outgoingRouting): CarrierInterface; diff --git a/library/Ivoz/Provider/Domain/Model/Company/CompanyAbstract.php b/library/Ivoz/Provider/Domain/Model/Company/CompanyAbstract.php index 662ec55e1b..0f7411a95a 100755 --- a/library/Ivoz/Provider/Domain/Model/Company/CompanyAbstract.php +++ b/library/Ivoz/Provider/Domain/Model/Company/CompanyAbstract.php @@ -11,11 +11,9 @@ use Ivoz\Core\Domain\ForeignKeyTransformerInterface; use Ivoz\Provider\Domain\Model\Company\Invoicing; use Ivoz\Provider\Domain\Model\Language\LanguageInterface; -use Ivoz\Provider\Domain\Model\MediaRelaySet\MediaRelaySetInterface; use Ivoz\Provider\Domain\Model\Timezone\TimezoneInterface; use Ivoz\Provider\Domain\Model\Brand\BrandInterface; use Ivoz\Provider\Domain\Model\Domain\DomainInterface; -use Ivoz\Provider\Domain\Model\ApplicationServer\ApplicationServerInterface; use Ivoz\Provider\Domain\Model\Country\CountryInterface; use Ivoz\Provider\Domain\Model\Currency\CurrencyInterface; use Ivoz\Provider\Domain\Model\TransformationRuleSet\TransformationRuleSetInterface; @@ -24,12 +22,11 @@ use Ivoz\Provider\Domain\Model\NotificationTemplate\NotificationTemplateInterface; use Ivoz\Provider\Domain\Model\Corporation\CorporationInterface; use Ivoz\Provider\Domain\Model\ApplicationServerSet\ApplicationServerSetInterface; +use Ivoz\Provider\Domain\Model\MediaRelaySet\MediaRelaySetInterface; use Ivoz\Provider\Domain\Model\Language\Language; -use Ivoz\Provider\Domain\Model\MediaRelaySet\MediaRelaySet; use Ivoz\Provider\Domain\Model\Timezone\Timezone; use Ivoz\Provider\Domain\Model\Brand\Brand; use Ivoz\Provider\Domain\Model\Domain\Domain; -use Ivoz\Provider\Domain\Model\ApplicationServer\ApplicationServer; use Ivoz\Provider\Domain\Model\Country\Country; use Ivoz\Provider\Domain\Model\Currency\Currency; use Ivoz\Provider\Domain\Model\TransformationRuleSet\TransformationRuleSet; @@ -38,6 +35,7 @@ use Ivoz\Provider\Domain\Model\NotificationTemplate\NotificationTemplate; use Ivoz\Provider\Domain\Model\Corporation\Corporation; use Ivoz\Provider\Domain\Model\ApplicationServerSet\ApplicationServerSet; +use Ivoz\Provider\Domain\Model\MediaRelaySet\MediaRelaySet; /** * CompanyAbstract @@ -153,11 +151,6 @@ abstract class CompanyAbstract */ protected $language = null; - /** - * @var ?MediaRelaySetInterface - */ - protected $mediaRelaySets = null; - /** * @var ?TimezoneInterface */ @@ -174,11 +167,6 @@ abstract class CompanyAbstract */ protected $domain = null; - /** - * @var ?ApplicationServerInterface - */ - protected $applicationServer = null; - /** * @var CountryInterface */ @@ -401,11 +389,9 @@ public static function fromDto( ->setBalance($dto->getBalance()) ->setShowInvoices($dto->getShowInvoices()) ->setLanguage($fkTransformer->transform($dto->getLanguage())) - ->setMediaRelaySets($fkTransformer->transform($dto->getMediaRelaySets())) ->setDefaultTimezone($fkTransformer->transform($dto->getDefaultTimezone())) ->setBrand($fkTransformer->transform($brand)) ->setDomain($fkTransformer->transform($dto->getDomain())) - ->setApplicationServer($fkTransformer->transform($dto->getApplicationServer())) ->setCountry($fkTransformer->transform($country)) ->setCurrency($fkTransformer->transform($dto->getCurrency())) ->setTransformationRuleSet($fkTransformer->transform($dto->getTransformationRuleSet())) @@ -501,11 +487,9 @@ public function updateFromDto( ->setShowInvoices($dto->getShowInvoices()) ->setInvoicing($invoicing) ->setLanguage($fkTransformer->transform($dto->getLanguage())) - ->setMediaRelaySets($fkTransformer->transform($dto->getMediaRelaySets())) ->setDefaultTimezone($fkTransformer->transform($dto->getDefaultTimezone())) ->setBrand($fkTransformer->transform($brand)) ->setDomain($fkTransformer->transform($dto->getDomain())) - ->setApplicationServer($fkTransformer->transform($dto->getApplicationServer())) ->setCountry($fkTransformer->transform($country)) ->setCurrency($fkTransformer->transform($dto->getCurrency())) ->setTransformationRuleSet($fkTransformer->transform($dto->getTransformationRuleSet())) @@ -555,11 +539,9 @@ public function toDto(int $depth = 0): CompanyDto ->setInvoicingProvince(self::getInvoicing()->getProvince()) ->setInvoicingCountryName(self::getInvoicing()->getCountryName()) ->setLanguage(Language::entityToDto(self::getLanguage(), $depth)) - ->setMediaRelaySets(MediaRelaySet::entityToDto(self::getMediaRelaySets(), $depth)) ->setDefaultTimezone(Timezone::entityToDto(self::getDefaultTimezone(), $depth)) ->setBrand(Brand::entityToDto(self::getBrand(), $depth)) ->setDomain(Domain::entityToDto(self::getDomain(), $depth)) - ->setApplicationServer(ApplicationServer::entityToDto(self::getApplicationServer(), $depth)) ->setCountry(Country::entityToDto(self::getCountry(), $depth)) ->setCurrency(Currency::entityToDto(self::getCurrency(), $depth)) ->setTransformationRuleSet(TransformationRuleSet::entityToDto(self::getTransformationRuleSet(), $depth)) @@ -607,11 +589,9 @@ protected function __toArray(): array 'invoicingProvince' => self::getInvoicing()->getProvince(), 'invoicingCountryName' => self::getInvoicing()->getCountryName(), 'languageId' => self::getLanguage()?->getId(), - 'mediaRelaySetsId' => self::getMediaRelaySets()?->getId(), 'defaultTimezoneId' => self::getDefaultTimezone()?->getId(), 'brandId' => self::getBrand()->getId(), 'domainId' => self::getDomain()?->getId(), - 'applicationServerId' => self::getApplicationServer()?->getId(), 'countryId' => self::getCountry()->getId(), 'currencyId' => self::getCurrency()?->getId(), 'transformationRuleSetId' => self::getTransformationRuleSet()?->getId(), @@ -942,18 +922,6 @@ public function getLanguage(): ?LanguageInterface return $this->language; } - protected function setMediaRelaySets(?MediaRelaySetInterface $mediaRelaySets = null): static - { - $this->mediaRelaySets = $mediaRelaySets; - - return $this; - } - - public function getMediaRelaySets(): ?MediaRelaySetInterface - { - return $this->mediaRelaySets; - } - protected function setDefaultTimezone(?TimezoneInterface $defaultTimezone = null): static { $this->defaultTimezone = $defaultTimezone; @@ -990,18 +958,6 @@ public function getDomain(): ?DomainInterface return $this->domain; } - protected function setApplicationServer(?ApplicationServerInterface $applicationServer = null): static - { - $this->applicationServer = $applicationServer; - - return $this; - } - - public function getApplicationServer(): ?ApplicationServerInterface - { - return $this->applicationServer; - } - protected function setCountry(CountryInterface $country): static { $this->country = $country; diff --git a/library/Ivoz/Provider/Domain/Model/Company/CompanyDtoAbstract.php b/library/Ivoz/Provider/Domain/Model/Company/CompanyDtoAbstract.php index c1bc3cd937..370d322084 100644 --- a/library/Ivoz/Provider/Domain/Model/Company/CompanyDtoAbstract.php +++ b/library/Ivoz/Provider/Domain/Model/Company/CompanyDtoAbstract.php @@ -5,11 +5,9 @@ use Ivoz\Core\Domain\DataTransferObjectInterface; use Ivoz\Core\Domain\Model\DtoNormalizer; use Ivoz\Provider\Domain\Model\Language\LanguageDto; -use Ivoz\Provider\Domain\Model\MediaRelaySet\MediaRelaySetDto; use Ivoz\Provider\Domain\Model\Timezone\TimezoneDto; use Ivoz\Provider\Domain\Model\Brand\BrandDto; use Ivoz\Provider\Domain\Model\Domain\DomainDto; -use Ivoz\Provider\Domain\Model\ApplicationServer\ApplicationServerDto; use Ivoz\Provider\Domain\Model\Country\CountryDto; use Ivoz\Provider\Domain\Model\Currency\CurrencyDto; use Ivoz\Provider\Domain\Model\TransformationRuleSet\TransformationRuleSetDto; @@ -18,6 +16,7 @@ use Ivoz\Provider\Domain\Model\NotificationTemplate\NotificationTemplateDto; use Ivoz\Provider\Domain\Model\Corporation\CorporationDto; use Ivoz\Provider\Domain\Model\ApplicationServerSet\ApplicationServerSetDto; +use Ivoz\Provider\Domain\Model\MediaRelaySet\MediaRelaySetDto; use Ivoz\Provider\Domain\Model\Extension\ExtensionDto; use Ivoz\Provider\Domain\Model\Friend\FriendDto; use Ivoz\Provider\Domain\Model\Contact\ContactDto; @@ -170,11 +169,6 @@ abstract class CompanyDtoAbstract implements DataTransferObjectInterface */ private $language = null; - /** - * @var MediaRelaySetDto | null - */ - private $mediaRelaySets = null; - /** * @var TimezoneDto | null */ @@ -190,11 +184,6 @@ abstract class CompanyDtoAbstract implements DataTransferObjectInterface */ private $domain = null; - /** - * @var ApplicationServerDto | null - */ - private $applicationServer = null; - /** * @var CountryDto | null */ @@ -378,11 +367,9 @@ public static function getPropertyMap(string $context = '', string $role = null) 'countryName', ], 'languageId' => 'language', - 'mediaRelaySetsId' => 'mediaRelaySets', 'defaultTimezoneId' => 'defaultTimezone', 'brandId' => 'brand', 'domainId' => 'domain', - 'applicationServerId' => 'applicationServer', 'countryId' => 'country', 'currencyId' => 'currency', 'transformationRuleSetId' => 'transformationRuleSet', @@ -434,11 +421,9 @@ public function toArray(bool $hideSensitiveData = false): array 'countryName' => $this->getInvoicingCountryName(), ], 'language' => $this->getLanguage(), - 'mediaRelaySets' => $this->getMediaRelaySets(), 'defaultTimezone' => $this->getDefaultTimezone(), 'brand' => $this->getBrand(), 'domain' => $this->getDomain(), - 'applicationServer' => $this->getApplicationServer(), 'country' => $this->getCountry(), 'currency' => $this->getCurrency(), 'transformationRuleSet' => $this->getTransformationRuleSet(), @@ -816,36 +801,6 @@ public function getLanguageId(): ?int return null; } - public function setMediaRelaySets(?MediaRelaySetDto $mediaRelaySets): static - { - $this->mediaRelaySets = $mediaRelaySets; - - return $this; - } - - public function getMediaRelaySets(): ?MediaRelaySetDto - { - return $this->mediaRelaySets; - } - - public function setMediaRelaySetsId(?int $id): static - { - $value = !is_null($id) - ? new MediaRelaySetDto($id) - : null; - - return $this->setMediaRelaySets($value); - } - - public function getMediaRelaySetsId(): ?int - { - if ($dto = $this->getMediaRelaySets()) { - return $dto->getId(); - } - - return null; - } - public function setDefaultTimezone(?TimezoneDto $defaultTimezone): static { $this->defaultTimezone = $defaultTimezone; @@ -936,36 +891,6 @@ public function getDomainId(): ?int return null; } - public function setApplicationServer(?ApplicationServerDto $applicationServer): static - { - $this->applicationServer = $applicationServer; - - return $this; - } - - public function getApplicationServer(): ?ApplicationServerDto - { - return $this->applicationServer; - } - - public function setApplicationServerId(?int $id): static - { - $value = !is_null($id) - ? new ApplicationServerDto($id) - : null; - - return $this->setApplicationServer($value); - } - - public function getApplicationServerId(): ?int - { - if ($dto = $this->getApplicationServer()) { - return $dto->getId(); - } - - return null; - } - public function setCountry(?CountryDto $country): static { $this->country = $country; diff --git a/library/Ivoz/Provider/Domain/Model/Company/CompanyInterface.php b/library/Ivoz/Provider/Domain/Model/Company/CompanyInterface.php index d50e84927e..4e2d9891f1 100644 --- a/library/Ivoz/Provider/Domain/Model/Company/CompanyInterface.php +++ b/library/Ivoz/Provider/Domain/Model/Company/CompanyInterface.php @@ -8,11 +8,9 @@ use Ivoz\Core\Domain\Model\EntityInterface; use Ivoz\Core\Domain\DataTransferObjectInterface; use Ivoz\Core\Domain\ForeignKeyTransformerInterface; -use Ivoz\Provider\Domain\Model\MediaRelaySet\MediaRelaySetInterface; use Ivoz\Provider\Domain\Model\Timezone\TimezoneInterface; use Ivoz\Provider\Domain\Model\Brand\BrandInterface; use Ivoz\Provider\Domain\Model\Domain\DomainInterface; -use Ivoz\Provider\Domain\Model\ApplicationServer\ApplicationServerInterface; use Ivoz\Provider\Domain\Model\Country\CountryInterface; use Ivoz\Provider\Domain\Model\Currency\CurrencyInterface; use Ivoz\Provider\Domain\Model\TransformationRuleSet\TransformationRuleSetInterface; @@ -21,6 +19,7 @@ use Ivoz\Provider\Domain\Model\NotificationTemplate\NotificationTemplateInterface; use Ivoz\Provider\Domain\Model\Corporation\CorporationInterface; use Ivoz\Provider\Domain\Model\ApplicationServerSet\ApplicationServerSetInterface; +use Ivoz\Provider\Domain\Model\MediaRelaySet\MediaRelaySetInterface; use Ivoz\Provider\Domain\Model\Extension\ExtensionInterface; use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Criteria; @@ -264,8 +263,6 @@ public function getShowInvoices(): ?bool; public function getInvoicing(): Invoicing; - public function getMediaRelaySets(): ?MediaRelaySetInterface; - public function getDefaultTimezone(): ?TimezoneInterface; public function setBrand(BrandInterface $brand): static; @@ -274,8 +271,6 @@ public function getBrand(): BrandInterface; public function getDomain(): ?DomainInterface; - public function getApplicationServer(): ?ApplicationServerInterface; - public function getCountry(): CountryInterface; public function getCurrency(): ?CurrencyInterface; diff --git a/library/Ivoz/Provider/Domain/Model/DdiProvider/DdiProviderAbstract.php b/library/Ivoz/Provider/Domain/Model/DdiProvider/DdiProviderAbstract.php index b879b94138..54f9380245 100644 --- a/library/Ivoz/Provider/Domain/Model/DdiProvider/DdiProviderAbstract.php +++ b/library/Ivoz/Provider/Domain/Model/DdiProvider/DdiProviderAbstract.php @@ -51,11 +51,6 @@ abstract class DdiProviderAbstract */ protected $proxyTrunk = null; - /** - * @var ?MediaRelaySetInterface - */ - protected $mediaRelaySets = null; - /** * @var MediaRelaySetInterface */ @@ -151,7 +146,6 @@ public static function fromDto( ->setBrand($fkTransformer->transform($brand)) ->setTransformationRuleSet($fkTransformer->transform($dto->getTransformationRuleSet())) ->setProxyTrunk($fkTransformer->transform($dto->getProxyTrunk())) - ->setMediaRelaySets($fkTransformer->transform($dto->getMediaRelaySets())) ->setMediaRelaySet($fkTransformer->transform($mediaRelaySet)); $self->initChangelog(); @@ -184,7 +178,6 @@ public function updateFromDto( ->setBrand($fkTransformer->transform($brand)) ->setTransformationRuleSet($fkTransformer->transform($dto->getTransformationRuleSet())) ->setProxyTrunk($fkTransformer->transform($dto->getProxyTrunk())) - ->setMediaRelaySets($fkTransformer->transform($dto->getMediaRelaySets())) ->setMediaRelaySet($fkTransformer->transform($mediaRelaySet)); return $this; @@ -201,7 +194,6 @@ public function toDto(int $depth = 0): DdiProviderDto ->setBrand(Brand::entityToDto(self::getBrand(), $depth)) ->setTransformationRuleSet(TransformationRuleSet::entityToDto(self::getTransformationRuleSet(), $depth)) ->setProxyTrunk(ProxyTrunk::entityToDto(self::getProxyTrunk(), $depth)) - ->setMediaRelaySets(MediaRelaySet::entityToDto(self::getMediaRelaySets(), $depth)) ->setMediaRelaySet(MediaRelaySet::entityToDto(self::getMediaRelaySet(), $depth)); } @@ -216,7 +208,6 @@ protected function __toArray(): array 'brandId' => self::getBrand()->getId(), 'transformationRuleSetId' => self::getTransformationRuleSet()?->getId(), 'proxyTrunkId' => self::getProxyTrunk()?->getId(), - 'mediaRelaySetsId' => self::getMediaRelaySets()?->getId(), 'mediaRelaySetId' => self::getMediaRelaySet()->getId() ]; } @@ -285,18 +276,6 @@ public function getProxyTrunk(): ?ProxyTrunkInterface return $this->proxyTrunk; } - protected function setMediaRelaySets(?MediaRelaySetInterface $mediaRelaySets = null): static - { - $this->mediaRelaySets = $mediaRelaySets; - - return $this; - } - - public function getMediaRelaySets(): ?MediaRelaySetInterface - { - return $this->mediaRelaySets; - } - protected function setMediaRelaySet(MediaRelaySetInterface $mediaRelaySet): static { $this->mediaRelaySet = $mediaRelaySet; diff --git a/library/Ivoz/Provider/Domain/Model/DdiProvider/DdiProviderDtoAbstract.php b/library/Ivoz/Provider/Domain/Model/DdiProvider/DdiProviderDtoAbstract.php index 7b05e18296..adcb086565 100644 --- a/library/Ivoz/Provider/Domain/Model/DdiProvider/DdiProviderDtoAbstract.php +++ b/library/Ivoz/Provider/Domain/Model/DdiProvider/DdiProviderDtoAbstract.php @@ -49,11 +49,6 @@ abstract class DdiProviderDtoAbstract implements DataTransferObjectInterface */ private $proxyTrunk = null; - /** - * @var MediaRelaySetDto | null - */ - private $mediaRelaySets = null; - /** * @var MediaRelaySetDto | null */ @@ -90,7 +85,6 @@ public static function getPropertyMap(string $context = '', string $role = null) 'brandId' => 'brand', 'transformationRuleSetId' => 'transformationRuleSet', 'proxyTrunkId' => 'proxyTrunk', - 'mediaRelaySetsId' => 'mediaRelaySets', 'mediaRelaySetId' => 'mediaRelaySet' ]; } @@ -107,7 +101,6 @@ public function toArray(bool $hideSensitiveData = false): array 'brand' => $this->getBrand(), 'transformationRuleSet' => $this->getTransformationRuleSet(), 'proxyTrunk' => $this->getProxyTrunk(), - 'mediaRelaySets' => $this->getMediaRelaySets(), 'mediaRelaySet' => $this->getMediaRelaySet(), 'ddiProviderRegistrations' => $this->getDdiProviderRegistrations(), 'ddiProviderAddresses' => $this->getDdiProviderAddresses() @@ -256,36 +249,6 @@ public function getProxyTrunkId(): ?int return null; } - public function setMediaRelaySets(?MediaRelaySetDto $mediaRelaySets): static - { - $this->mediaRelaySets = $mediaRelaySets; - - return $this; - } - - public function getMediaRelaySets(): ?MediaRelaySetDto - { - return $this->mediaRelaySets; - } - - public function setMediaRelaySetsId(?int $id): static - { - $value = !is_null($id) - ? new MediaRelaySetDto($id) - : null; - - return $this->setMediaRelaySets($value); - } - - public function getMediaRelaySetsId(): ?int - { - if ($dto = $this->getMediaRelaySets()) { - return $dto->getId(); - } - - return null; - } - public function setMediaRelaySet(?MediaRelaySetDto $mediaRelaySet): static { $this->mediaRelaySet = $mediaRelaySet; diff --git a/library/Ivoz/Provider/Domain/Model/DdiProvider/DdiProviderInterface.php b/library/Ivoz/Provider/Domain/Model/DdiProvider/DdiProviderInterface.php index 17bf2dbc8e..409bff8184 100644 --- a/library/Ivoz/Provider/Domain/Model/DdiProvider/DdiProviderInterface.php +++ b/library/Ivoz/Provider/Domain/Model/DdiProvider/DdiProviderInterface.php @@ -66,8 +66,6 @@ public function getTransformationRuleSet(): ?TransformationRuleSetInterface; public function getProxyTrunk(): ?ProxyTrunkInterface; - public function getMediaRelaySets(): ?MediaRelaySetInterface; - public function getMediaRelaySet(): MediaRelaySetInterface; public function addDdiProviderRegistration(DdiProviderRegistrationInterface $ddiProviderRegistration): DdiProviderInterface; diff --git a/library/Ivoz/Provider/Domain/Service/Company/CompanyLifecycleServiceCollection.php b/library/Ivoz/Provider/Domain/Service/Company/CompanyLifecycleServiceCollection.php index 997a4ec950..919910d193 100755 --- a/library/Ivoz/Provider/Domain/Service/Company/CompanyLifecycleServiceCollection.php +++ b/library/Ivoz/Provider/Domain/Service/Company/CompanyLifecycleServiceCollection.php @@ -19,7 +19,6 @@ class CompanyLifecycleServiceCollection implements LifecycleServiceCollectionInt public static $bindedBaseServices = [ "pre_persist" => [ - \Ivoz\Provider\Domain\Service\Company\SanitizeEmptyValues::class => 10, \Ivoz\Provider\Domain\Service\Company\SanitizeBillingMethod::class => 200, ], "post_persist" => From 307f0d8d7991f51c97eac5056fef402f647f1786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Mon, 28 Oct 2024 16:11:49 +0100 Subject: [PATCH 03/10] core: removed obsolete fields --- ...erverSetRelApplicationServerRepository.php | 4 ++ .../Model/Company/CompanyRepository.php | 5 -- ...cationServerLifecycleServiceCollection.php | 4 -- .../ApplicationServer/DeleteProtection.php | 50 ------------------- .../Service/Company/SanitizeEmptyValues.php | 41 --------------- ...RelApplicationServerDoctrineRepository.php | 10 ++++ .../Doctrine/CompanyDoctrineRepository.php | 12 ----- 7 files changed, 14 insertions(+), 112 deletions(-) delete mode 100644 library/Ivoz/Provider/Domain/Service/ApplicationServer/DeleteProtection.php delete mode 100755 library/Ivoz/Provider/Domain/Service/Company/SanitizeEmptyValues.php diff --git a/library/Ivoz/Provider/Domain/Model/ApplicationServerSetRelApplicationServer/ApplicationServerSetRelApplicationServerRepository.php b/library/Ivoz/Provider/Domain/Model/ApplicationServerSetRelApplicationServer/ApplicationServerSetRelApplicationServerRepository.php index 75e89ff0a2..24e75b7be8 100644 --- a/library/Ivoz/Provider/Domain/Model/ApplicationServerSetRelApplicationServer/ApplicationServerSetRelApplicationServerRepository.php +++ b/library/Ivoz/Provider/Domain/Model/ApplicationServerSetRelApplicationServer/ApplicationServerSetRelApplicationServerRepository.php @@ -9,4 +9,8 @@ */ interface ApplicationServerSetRelApplicationServerRepository extends RepositoryInterface { + /** + * @return ApplicationServerSetRelApplicationServerInterface[] + */ + public function findByApplicationServerId(int $applicationServerId): array; } diff --git a/library/Ivoz/Provider/Domain/Model/Company/CompanyRepository.php b/library/Ivoz/Provider/Domain/Model/Company/CompanyRepository.php index d220988bb0..f2e6012b52 100644 --- a/library/Ivoz/Provider/Domain/Model/Company/CompanyRepository.php +++ b/library/Ivoz/Provider/Domain/Model/Company/CompanyRepository.php @@ -85,11 +85,6 @@ public function countByBrand(int $brandId): int; */ public function getLatestByBrandId(int $brandId, int $intemNum = 5): array; - /** - * @return CompanyInterface[] - */ - public function findByApplicationServerId(int $applicationServerId): array; - /** * @return CompanyInterface[] */ diff --git a/library/Ivoz/Provider/Domain/Service/ApplicationServer/ApplicationServerLifecycleServiceCollection.php b/library/Ivoz/Provider/Domain/Service/ApplicationServer/ApplicationServerLifecycleServiceCollection.php index a1895f4596..91bc47f4d2 100755 --- a/library/Ivoz/Provider/Domain/Service/ApplicationServer/ApplicationServerLifecycleServiceCollection.php +++ b/library/Ivoz/Provider/Domain/Service/ApplicationServer/ApplicationServerLifecycleServiceCollection.php @@ -21,10 +21,6 @@ class ApplicationServerLifecycleServiceCollection implements LifecycleServiceCol [ \Ivoz\Kam\Domain\Service\Dispatcher\UpdateByApplicationServer::class => 10, ], - "pre_remove" => - [ - \Ivoz\Provider\Domain\Service\ApplicationServer\DeleteProtection::class => 200, - ], "on_commit" => [ \Ivoz\Provider\Domain\Service\ApplicationServer\SendUsersDispatcherReloadRequest::class => 100, diff --git a/library/Ivoz/Provider/Domain/Service/ApplicationServer/DeleteProtection.php b/library/Ivoz/Provider/Domain/Service/ApplicationServer/DeleteProtection.php deleted file mode 100644 index fa7117d9ac..0000000000 --- a/library/Ivoz/Provider/Domain/Service/ApplicationServer/DeleteProtection.php +++ /dev/null @@ -1,50 +0,0 @@ - - */ - public static function getSubscribedEvents() - { - return [ - self::EVENT_PRE_REMOVE => self::PRE_REMOVE_PRIORITY - ]; - } - - /** - * @return void - */ - public function execute(ApplicationServerInterface $applicationServer) - { - $applicationServerId = $applicationServer->getId(); - - if ($applicationServerId === null) { - return; - } - - $companies = $this - ->companyRepository - ->findByApplicationServerId($applicationServerId); - - if (!empty($companies)) { - throw new \DomainException( - 'Cannot delete application server because it is in use in at least one company' - ); - } - } -} diff --git a/library/Ivoz/Provider/Domain/Service/Company/SanitizeEmptyValues.php b/library/Ivoz/Provider/Domain/Service/Company/SanitizeEmptyValues.php deleted file mode 100755 index 9aad4a9e03..0000000000 --- a/library/Ivoz/Provider/Domain/Service/Company/SanitizeEmptyValues.php +++ /dev/null @@ -1,41 +0,0 @@ - 10 - ]; - } - - public function execute(CompanyInterface $company): void - { - $isNew = $company->isNew(); - if (!$isNew) { - return; - } - - /** - * @var CompanyDto $dto - */ - $dto = $this->entityTools->entityToDto($company); - if (!$dto->getMediaRelaySetsId()) { - $dto->setMediaRelaySetsId(0); - $this - ->entityTools - ->updateEntityByDto($company, $dto); - } - } -} diff --git a/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/ApplicationServerSetRelApplicationServerDoctrineRepository.php b/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/ApplicationServerSetRelApplicationServerDoctrineRepository.php index 4c42a6fc8b..096ece6761 100644 --- a/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/ApplicationServerSetRelApplicationServerDoctrineRepository.php +++ b/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/ApplicationServerSetRelApplicationServerDoctrineRepository.php @@ -30,4 +30,14 @@ public function __construct( $entityPersisterInterface ); } + + /** + * @return ApplicationServerSetRelApplicationServerInterface[] + */ + public function findByApplicationServerId(int $applicationServerId): array + { + return $this->findBy([ + 'applicationServer' => $applicationServerId + ]); + } } diff --git a/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/CompanyDoctrineRepository.php b/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/CompanyDoctrineRepository.php index 1ce0aa464a..49154681fa 100755 --- a/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/CompanyDoctrineRepository.php +++ b/library/Ivoz/Provider/Infrastructure/Persistence/Doctrine/CompanyDoctrineRepository.php @@ -358,18 +358,6 @@ public function getLatestByBrandId(int $brandId, int $intemNum = 5): array ->getResult(); } - /** - * @return CompanyInterface[] - */ - public function findByApplicationServerId(int $applicationServerId): array - { - return $this->findBy( - [ - 'applicationServer' => $applicationServerId - ] - ); - } - /** * @return CompanyInterface[] */ From 623c92ecf572ae96e700f530096fe8f1477a6d34 Mon Sep 17 00:00:00 2001 From: Dani Garcia Date: Wed, 30 Oct 2024 08:55:48 +0100 Subject: [PATCH 04/10] tests: updated baselines --- library/phpstan-baseline.neon | 5 ----- library/psalm-baseline.xml | 14 +++----------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/library/phpstan-baseline.neon b/library/phpstan-baseline.neon index 238aaf4a69..08fd0d687d 100644 --- a/library/phpstan-baseline.neon +++ b/library/phpstan-baseline.neon @@ -3975,11 +3975,6 @@ parameters: count: 1 path: Ivoz/Provider/Domain/Service/Company/CompanyBalanceServiceInterface.php - - - message: "#^Method Ivoz\\\\Provider\\\\Domain\\\\Service\\\\Company\\\\SanitizeEmptyValues\\:\\:getSubscribedEvents\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: Ivoz/Provider/Domain/Service/Company/SanitizeEmptyValues.php - - message: "#^Method Ivoz\\\\Provider\\\\Domain\\\\Service\\\\Company\\\\SearchBrokenThresholds\\:\\:getSubscribedEvents\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 diff --git a/library/psalm-baseline.xml b/library/psalm-baseline.xml index 714aafa001..c028dd4679 100644 --- a/library/psalm-baseline.xml +++ b/library/psalm-baseline.xml @@ -1812,13 +1812,11 @@ - + $fkTransformer->transform($brand) $fkTransformer->transform($brand) $fkTransformer->transform($dto->getCurrency()) $fkTransformer->transform($dto->getCurrency()) - $fkTransformer->transform($dto->getMediaRelaySets()) - $fkTransformer->transform($dto->getMediaRelaySets()) $fkTransformer->transform($dto->getProxyTrunk()) $fkTransformer->transform($dto->getProxyTrunk()) $fkTransformer->transform($dto->getTransformationRuleSet()) @@ -1900,7 +1898,7 @@ - + $fkTransformer->transform($applicationServerSet) $fkTransformer->transform($applicationServerSet) $fkTransformer->transform($brand) @@ -1909,8 +1907,6 @@ $fkTransformer->transform($country) $fkTransformer->transform($dto->getAccessCredentialNotificationTemplate()) $fkTransformer->transform($dto->getAccessCredentialNotificationTemplate()) - $fkTransformer->transform($dto->getApplicationServer()) - $fkTransformer->transform($dto->getApplicationServer()) $fkTransformer->transform($dto->getCallCsvNotificationTemplate()) $fkTransformer->transform($dto->getCallCsvNotificationTemplate()) $fkTransformer->transform($dto->getCorporation()) @@ -1929,8 +1925,6 @@ $fkTransformer->transform($dto->getLanguage()) $fkTransformer->transform($dto->getMaxDailyUsageNotificationTemplate()) $fkTransformer->transform($dto->getMaxDailyUsageNotificationTemplate()) - $fkTransformer->transform($dto->getMediaRelaySets()) - $fkTransformer->transform($dto->getMediaRelaySets()) $fkTransformer->transform($dto->getOutgoingDdi()) $fkTransformer->transform($dto->getOutgoingDdi()) $fkTransformer->transform($dto->getOutgoingDdiRule()) @@ -2379,11 +2373,9 @@ - + $fkTransformer->transform($brand) $fkTransformer->transform($brand) - $fkTransformer->transform($dto->getMediaRelaySets()) - $fkTransformer->transform($dto->getMediaRelaySets()) $fkTransformer->transform($dto->getProxyTrunk()) $fkTransformer->transform($dto->getProxyTrunk()) $fkTransformer->transform($dto->getTransformationRuleSet()) From e14a00d8a15550f38ef09db99c7a88a85c041b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Mon, 28 Oct 2024 15:28:21 +0100 Subject: [PATCH 05/10] tests: updated orm tests --- ...licationServerSetRelApplicationServers.php | 1 + library/DataFixtures/ORM/ProviderCompany.php | 7 --- .../ApplicationServerLifeCycleTest.php | 30 ++++++++++-- .../Provider/Company/CompanyLifeCycleTest.php | 47 ------------------- 4 files changed, 28 insertions(+), 57 deletions(-) diff --git a/library/DataFixtures/ORM/ProviderApplicationServerSetRelApplicationServers.php b/library/DataFixtures/ORM/ProviderApplicationServerSetRelApplicationServers.php index 06b7c88d61..bd7c25f71d 100644 --- a/library/DataFixtures/ORM/ProviderApplicationServerSetRelApplicationServers.php +++ b/library/DataFixtures/ORM/ProviderApplicationServerSetRelApplicationServers.php @@ -23,6 +23,7 @@ public function load(ObjectManager $manager) $manager->getConnection()->exec( 'INSERT INTO ApplicationServerSetRelApplicationServers(applicationServerId, applicationServerSetId ) SELECT id, 0 FROM ApplicationServers WHERE id != 3' ); + $item1 = $this->createEntityInstance(ApplicationServerSetRelApplicationServer::class); (function () use ($fixture) { $this->setApplicationServer($fixture->getReference('_reference_ProviderApplicationServer1')); diff --git a/library/DataFixtures/ORM/ProviderCompany.php b/library/DataFixtures/ORM/ProviderCompany.php index c872e33db7..e62e7ceabf 100644 --- a/library/DataFixtures/ORM/ProviderCompany.php +++ b/library/DataFixtures/ORM/ProviderCompany.php @@ -55,7 +55,6 @@ public function load(ObjectManager $manager) ); $this->invoicing = $invoicing; $this->setLanguage($fixture->getReference('_reference_ProviderLanguage1')); - $this->setMediaRelaySets($fixture->getReference('_reference_ProviderMediaRelaySet0')); $this->setDefaultTimezone($fixture->getReference('_reference_ProviderTimezone145')); $this->setBrand($fixture->getReference('_reference_ProviderBrand1')); $this->setDomain($fixture->getReference('_reference_ProviderDomain3')); @@ -94,7 +93,6 @@ public function load(ObjectManager $manager) $this->setOnDemandRecordCode(""); $this->invoicing = $invoicing; $this->setLanguage($fixture->getReference('_reference_ProviderLanguage1')); - $this->setMediaRelaySets($fixture->getReference('_reference_ProviderMediaRelaySet0')); $this->setDefaultTimezone($fixture->getReference('_reference_ProviderTimezone145')); $this->setBrand($fixture->getReference('_reference_ProviderBrand1')); $this->setDomain($fixture->getReference('_reference_ProviderDomain5')); @@ -127,7 +125,6 @@ public function load(ObjectManager $manager) $this->setShowInvoices(true); $this->invoicing = $invoicing; $this->setLanguage($fixture->getReference('_reference_ProviderLanguage1')); - $this->setMediaRelaySets($fixture->getReference('_reference_ProviderMediaRelaySet0')); $this->setDefaultTimezone($fixture->getReference('_reference_ProviderTimezone145')); $this->setBrand($fixture->getReference('_reference_ProviderBrand1')); $this->setCountry($fixture->getReference('_reference_ProviderCountry70')); @@ -157,9 +154,7 @@ public function load(ObjectManager $manager) $this->setOnDemandRecord(0); $this->setOnDemandRecordCode(""); $this->invoicing = $invoicing; - $this->setApplicationServer($fixture->getReference('_reference_ProviderApplicationServer1')); $this->setLanguage($fixture->getReference('_reference_ProviderLanguage1')); - $this->setMediaRelaySets($fixture->getReference('_reference_ProviderMediaRelaySet0')); $this->setDefaultTimezone($fixture->getReference('_reference_ProviderTimezone145')); $this->setBrand($fixture->getReference('_reference_ProviderBrand1')); $this->setCountry($fixture->getReference('_reference_ProviderCountry70')); @@ -189,7 +184,6 @@ public function load(ObjectManager $manager) $this->setOnDemandRecordCode(""); $this->invoicing = $invoicing; $this->setLanguage($fixture->getReference('_reference_ProviderLanguage1')); - $this->setMediaRelaySets($fixture->getReference('_reference_ProviderMediaRelaySet0')); $this->setDefaultTimezone($fixture->getReference('_reference_ProviderTimezone145')); $this->setBrand($fixture->getReference('_reference_ProviderBrand1')); $this->setCountry($fixture->getReference('_reference_ProviderCountry70')); @@ -221,7 +215,6 @@ public function load(ObjectManager $manager) $this->setOnDemandRecordCode(""); $this->invoicing = $invoicing; $this->setLanguage($fixture->getReference('_reference_ProviderLanguage1')); - $this->setMediaRelaySets($fixture->getReference('_reference_ProviderMediaRelaySet0')); $this->setDefaultTimezone($fixture->getReference('_reference_ProviderTimezone18')); $this->setBrand($fixture->getReference('_reference_ProviderBrand2')); $this->setCountry($fixture->getReference('_reference_ProviderCountry10')); diff --git a/schema/tests/Provider/ApplicationServer/ApplicationServerLifeCycleTest.php b/schema/tests/Provider/ApplicationServer/ApplicationServerLifeCycleTest.php index 2ab54c8a80..e5d0dbfec2 100644 --- a/schema/tests/Provider/ApplicationServer/ApplicationServerLifeCycleTest.php +++ b/schema/tests/Provider/ApplicationServer/ApplicationServerLifeCycleTest.php @@ -69,11 +69,33 @@ protected function updateApplicationServer() } protected function removeApplicationServer() + { + $this->addApplicationServer(); + + $applicationServerRepository = $this->em + ->getRepository(ApplicationServer::class); + + $applicationServer = $applicationServerRepository->find(4); + + $this + ->entityTools + ->remove($applicationServer); + } + + protected function removeUsedApplicationServer() { $applicationServerRepository = $this->em ->getRepository(ApplicationServer::class); - $applicationServer = $applicationServerRepository->find(3); + $applicationServer = $applicationServerRepository->find(1); + + $this->expectException( + \DomainException::class, + ); + + $this->expectExceptionMessage( + 'Cannot delete application server because it is in use in at least one application server set' + ); $this ->entityTools @@ -149,7 +171,8 @@ public function it_triggers_remove_lifecycle_services() { $this->removeApplicationServer(); $this->assetChangedEntities([ - ApplicationServer::class + ApplicationServer::class, + Dispatcher::class, ]); } @@ -261,6 +284,7 @@ public function updating_applicationServer_fires_dispatcherReloadRequest() */ public function deleting_applicationServer_fires_dispatcherReloadRequest() { + $this->addApplicationServer(); $this->mockInfraestructureServices( 'provider.lifecycle.application_server.service_collection', ['on_commit' => [ @@ -271,7 +295,7 @@ public function deleting_applicationServer_fires_dispatcherReloadRequest() ); $applicationServerRepository = $this->em->getRepository(ApplicationServer::class); - $as = $applicationServerRepository->find(3); + $as = $applicationServerRepository->find(4); $this->entityTools->remove($as); } } diff --git a/schema/tests/Provider/Company/CompanyLifeCycleTest.php b/schema/tests/Provider/Company/CompanyLifeCycleTest.php index 083f20f56e..b0df8e0a2d 100644 --- a/schema/tests/Provider/Company/CompanyLifeCycleTest.php +++ b/schema/tests/Provider/Company/CompanyLifeCycleTest.php @@ -220,51 +220,6 @@ public function it_triggers_trusted_reload_on_wholesale_companies_delete() ); } - ////////////////////////////////////////////////// - /// - ////////////////////////////////////////////////// - - /** - * @test - * @deprecated - */ - public function added_company_has_default_mediaRelaySetsId() - { - $companyDto = new CompanyDto(); - $companyDto - ->setName('ACompany') - ->setDomainUsers('127.3.0.1') - ->setInvoicingNif('12345678B') - ->setMaxCalls(0) - ->setInvoicingPostalAddress('An address') - ->setInvoicingPostalCode('54321') - ->setInvoicingTown('') - ->setInvoicingProvince('') - ->setInvoicingCountryName('') - ->setIpfilter(false) - ->setOnDemandRecord(0) - ->setOnDemandRecordCode('') - ->setExternallyextraopts('') - ->setRecordingsLimitEmail('') - ->setLanguageId(1) - ->setMediaRelaySetsId(null) - ->setDefaultTimezoneId(1) - ->setBrandId(1) - ->setDomainId(1) - ->setCountryId(1) - ->setApplicationServerSetId(1) - ->setMediaRelaySetId(1); - - /** @var Company $company */ - $company = $this->entityTools - ->persistDto($companyDto, null, true); - - $this->assertEquals( - 0, - $company->getMediaRelaySets()->getId() - ); - } - /** * @test * @deprecated @@ -340,7 +295,6 @@ public function added_company_has_default_applicationServerSetId() ->setExternallyextraopts('') ->setRecordingsLimitEmail('') ->setLanguageId(1) - ->setMediaRelaySetsId(null) ->setDefaultTimezoneId(1) ->setBrandId(1) ->setDomainId(1) @@ -377,7 +331,6 @@ protected function createDto() ->setExternallyextraopts('') ->setRecordingsLimitEmail('') ->setLanguageId(1) - ->setMediaRelaySetsId(0) ->setDefaultTimezoneId(1) ->setBrandId(1) ->setDomainId(1) From 667aa58ca416187a8c8618209ce0694c22fd474e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Mon, 28 Oct 2024 17:06:40 +0100 Subject: [PATCH 06/10] tests: updated unit tests --- .../Company/SanitizeEmptyValuesSpec.php | 110 ------------------ 1 file changed, 110 deletions(-) delete mode 100644 library/spec/Ivoz/Provider/Domain/Service/Company/SanitizeEmptyValuesSpec.php diff --git a/library/spec/Ivoz/Provider/Domain/Service/Company/SanitizeEmptyValuesSpec.php b/library/spec/Ivoz/Provider/Domain/Service/Company/SanitizeEmptyValuesSpec.php deleted file mode 100644 index cbef3ea94b..0000000000 --- a/library/spec/Ivoz/Provider/Domain/Service/Company/SanitizeEmptyValuesSpec.php +++ /dev/null @@ -1,110 +0,0 @@ -company = $entity; - $this->entityTools = $entityTools; - $this->beConstructedWith($entityTools); - - $this->dto = new CompanyDto(); - } - - protected function prepareDto() - { - $this - ->company - ->isNew() - ->willReturn(true) - ->shouldBeCalled(); - - $this - ->entityTools - ->entityToDto($this->company) - ->willReturn($this->dto) - ->shouldBeCalled(); - - $this - ->dto - ->setInvoicingNif('12345678-Z') - ->setInvoicingPostalAddress('Postal address') - ->setInvoicingPostalCode('PC') - ->setInvoicingTown('Town') - ->setInvoicingCountryName('Country') - ->setInvoicingProvince('Province') - ->setDefaultTimezoneId(1) - ->setCountryId(70) - ->setLanguageId(1) - ->setMediaRelaySetsId(0) - ->setIpFilter(0) - ->setOnDemandRecord(0) - ->setOnDemandRecordCode(1); - } - - function it_is_initializable() - { - $this->shouldHaveType(SanitizeEmptyValues::class); - } - - function it_checks_whether_the_entity_is_new() - { - $this - ->company - ->isNew() - ->willReturn(false); - - $this - ->entityTools - ->entityToDto(Argument::any()) - ->shouldNotBeCalled(); - - $this->execute($this->company, false); - } - - function it_sets_media_relay_sets_when_empty() - { - $this->prepareDto(); - $this - ->dto - ->setMediaRelaySetsId(null); - - $this - ->entityTools - ->updateEntityByDto($this->company, $this->dto) - ->shouldBeCalled(); - - $this->execute($this->company, true); - - if ($this->dto->getMediaRelaySetsId() !== 0) { - throw new FailureException( - 'Unexpected media relay sets id value found' - ); - } - } -} From 608759e74f6a46d59846574032ad4bd4d0b7101f Mon Sep 17 00:00:00 2001 From: Dani Garcia Date: Mon, 28 Oct 2024 17:21:48 +0100 Subject: [PATCH 07/10] rest/brand: updated api tests --- .../ProviderApplicationServerSetRelApplicationServers.php | 8 -------- .../brand/features/provider/carrier/postCarrier.feature | 1 - .../brand/features/provider/carrier/putCarrier.feature | 1 - .../features/provider/ddiProvider/postDdiProvider.feature | 1 - .../features/provider/ddiProvider/putDdiProvider.feature | 1 - 5 files changed, 12 deletions(-) diff --git a/library/DataFixtures/ORM/ProviderApplicationServerSetRelApplicationServers.php b/library/DataFixtures/ORM/ProviderApplicationServerSetRelApplicationServers.php index bd7c25f71d..6c86cb819b 100644 --- a/library/DataFixtures/ORM/ProviderApplicationServerSetRelApplicationServers.php +++ b/library/DataFixtures/ORM/ProviderApplicationServerSetRelApplicationServers.php @@ -49,14 +49,6 @@ public function load(ObjectManager $manager) $this->addReference('_reference_ApplicationServerSetRelApplicationServer3', $item3); $this->sanitizeEntityValues($item3); - $item4 = $this->createEntityInstance(ApplicationServerSetRelApplicationServer::class); - (function () use ($fixture) { - $this->setApplicationServer($fixture->getReference('_reference_ProviderApplicationServer3')); - $this->setApplicationServerSet($fixture->getReference('_reference_ProviderApplicationServerSet2')); - })->call($item4); - $this->addReference('_reference_ApplicationServerSetRelApplicationServer4', $item4); - $this->sanitizeEntityValues($item4); - $manager->flush(); } } diff --git a/web/rest/brand/features/provider/carrier/postCarrier.feature b/web/rest/brand/features/provider/carrier/postCarrier.feature index 776de2e609..9511d91dc4 100644 --- a/web/rest/brand/features/provider/carrier/postCarrier.feature +++ b/web/rest/brand/features/provider/carrier/postCarrier.feature @@ -32,7 +32,6 @@ Feature: Create carriers "transformationRuleSet": 1, "currency": null, "proxyTrunk": 1, - "mediaRelaySets": null, "mediaRelaySet": 0 } """ diff --git a/web/rest/brand/features/provider/carrier/putCarrier.feature b/web/rest/brand/features/provider/carrier/putCarrier.feature index 884ce568b0..5bb4737a34 100644 --- a/web/rest/brand/features/provider/carrier/putCarrier.feature +++ b/web/rest/brand/features/provider/carrier/putCarrier.feature @@ -30,7 +30,6 @@ Feature: Update carriers "transformationRuleSet": 1, "currency": null, "proxyTrunk": 1, - "mediaRelaySets": null, "mediaRelaySet": 0 } """ diff --git a/web/rest/brand/features/provider/ddiProvider/postDdiProvider.feature b/web/rest/brand/features/provider/ddiProvider/postDdiProvider.feature index 34ca5dd6cc..ca7fc6395b 100644 --- a/web/rest/brand/features/provider/ddiProvider/postDdiProvider.feature +++ b/web/rest/brand/features/provider/ddiProvider/postDdiProvider.feature @@ -28,7 +28,6 @@ Feature: Create ddi providers "id": 2, "transformationRuleSet": 1, "proxyTrunk": 1, - "mediaRelaySets": null, "mediaRelaySet": 0 } """ diff --git a/web/rest/brand/features/provider/ddiProvider/putDdiProvider.feature b/web/rest/brand/features/provider/ddiProvider/putDdiProvider.feature index ed1fcd92cb..f4999689a7 100644 --- a/web/rest/brand/features/provider/ddiProvider/putDdiProvider.feature +++ b/web/rest/brand/features/provider/ddiProvider/putDdiProvider.feature @@ -28,7 +28,6 @@ Feature: Update ddi providers "id": 1, "transformationRuleSet": 1, "proxyTrunk": 1, - "mediaRelaySets": null, "mediaRelaySet": 0 } """ From daf8a2e41cbdbc5740538db04b98091cd5d99aae Mon Sep 17 00:00:00 2001 From: Dani Garcia Date: Tue, 26 Nov 2024 11:58:26 +0100 Subject: [PATCH 08/10] rest/platform: updated api tests --- .../provider/applicationServer/removeApplicationServer.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/rest/platform/features/provider/applicationServer/removeApplicationServer.feature b/web/rest/platform/features/provider/applicationServer/removeApplicationServer.feature index 1deccfb06c..01acbc27ea 100644 --- a/web/rest/platform/features/provider/applicationServer/removeApplicationServer.feature +++ b/web/rest/platform/features/provider/applicationServer/removeApplicationServer.feature @@ -23,6 +23,6 @@ Feature: Remove application servers And the JSON should be like: """ { - "detail":"Cannot delete application server because it is in use in at least one company" + "detail":"Unable delete this element, due to is being used by unknown" } """ From f0134620f11e2085919349a580c7923652b7ff68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Thu, 31 Oct 2024 11:31:46 +0100 Subject: [PATCH 09/10] portal/platform: updated apiSpec --- .../platform/cypress/fixtures/apiSpec.json | 134 +++--------------- 1 file changed, 23 insertions(+), 111 deletions(-) diff --git a/web/portal/platform/cypress/fixtures/apiSpec.json b/web/portal/platform/cypress/fixtures/apiSpec.json index 251ff4f2f6..f158e22613 100644 --- a/web/portal/platform/cypress/fixtures/apiSpec.json +++ b/web/portal/platform/cypress/fixtures/apiSpec.json @@ -4567,24 +4567,6 @@ "required": false, "type": "string" }, - { - "name": "mediaRelaySets", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "mediaRelaySets[]", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "mediaRelaySets[exists]", - "in": "query", - "required": false, - "type": "boolean" - }, { "name": "name", "in": "query", @@ -4745,12 +4727,6 @@ "required": false, "type": "boolean" }, - { - "name": "applicationServer", - "in": "query", - "required": false, - "type": "string" - }, { "name": "applicationServerSet", "in": "query", @@ -4764,25 +4740,19 @@ "type": "string" }, { - "name": "applicationServer[]", + "name": "billingMethod", "in": "query", "required": false, "type": "string" }, { - "name": "applicationServer[exists]", - "in": "query", - "required": false, - "type": "boolean" - }, - { - "name": "billingMethod", + "name": "billingMethod[exact]", "in": "query", "required": false, "type": "string" }, { - "name": "billingMethod[exact]", + "name": "billingMethod[end]", "in": "query", "required": false, "type": "string" @@ -4805,12 +4775,6 @@ "required": false, "type": "string" }, - { - "name": "billingMethod[end]", - "in": "query", - "required": false, - "type": "string" - }, { "name": "brand", "in": "query", @@ -5010,25 +4974,25 @@ "type": "string" }, { - "name": "invoicing.countryName[start]", + "name": "invoicing.countryName[neq]", "in": "query", "required": false, "type": "string" }, { - "name": "invoicing.countryName[partial]", + "name": "invoicing.countryName[start]", "in": "query", "required": false, "type": "string" }, { - "name": "invoicing.countryName[end]", + "name": "invoicing.countryName[partial]", "in": "query", "required": false, "type": "string" }, { - "name": "invoicing.countryName[neq]", + "name": "invoicing.countryName[end]", "in": "query", "required": false, "type": "string" @@ -5082,25 +5046,25 @@ "type": "string" }, { - "name": "invoicing.postalAddress[neq]", + "name": "invoicing.postalAddress[start]", "in": "query", "required": false, "type": "string" }, { - "name": "invoicing.postalAddress[start]", + "name": "invoicing.postalAddress[partial]", "in": "query", "required": false, "type": "string" }, { - "name": "invoicing.postalAddress[partial]", + "name": "invoicing.postalAddress[end]", "in": "query", "required": false, "type": "string" }, { - "name": "invoicing.postalAddress[end]", + "name": "invoicing.postalAddress[neq]", "in": "query", "required": false, "type": "string" @@ -5154,25 +5118,25 @@ "type": "string" }, { - "name": "invoicing.province[partial]", + "name": "invoicing.province[neq]", "in": "query", "required": false, "type": "string" }, { - "name": "invoicing.province[end]", + "name": "invoicing.province[start]", "in": "query", "required": false, "type": "string" }, { - "name": "invoicing.province[neq]", + "name": "invoicing.province[partial]", "in": "query", "required": false, "type": "string" }, { - "name": "invoicing.province[start]", + "name": "invoicing.province[end]", "in": "query", "required": false, "type": "string" @@ -5190,25 +5154,25 @@ "type": "string" }, { - "name": "invoicing.town[start]", + "name": "invoicing.town[neq]", "in": "query", "required": false, "type": "string" }, { - "name": "invoicing.town[partial]", + "name": "invoicing.town[start]", "in": "query", "required": false, "type": "string" }, { - "name": "invoicing.town[end]", + "name": "invoicing.town[partial]", "in": "query", "required": false, "type": "string" }, { - "name": "invoicing.town[neq]", + "name": "invoicing.town[end]", "in": "query", "required": false, "type": "string" @@ -5303,24 +5267,6 @@ "required": false, "type": "string" }, - { - "name": "mediaRelaySets", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "mediaRelaySets[]", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "mediaRelaySets[exists]", - "in": "query", - "required": false, - "type": "boolean" - }, { "name": "name", "in": "query", @@ -6587,24 +6533,6 @@ "required": false, "type": "string" }, - { - "name": "mediaRelaySets", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "mediaRelaySets[]", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "mediaRelaySets[exists]", - "in": "query", - "required": false, - "type": "boolean" - }, { "name": "name", "in": "query", @@ -6618,25 +6546,25 @@ "type": "string" }, { - "name": "name[neq]", + "name": "name[start]", "in": "query", "required": false, "type": "string" }, { - "name": "name[start]", + "name": "name[end]", "in": "query", "required": false, "type": "string" }, { - "name": "name[partial]", + "name": "name[neq]", "in": "query", "required": false, "type": "string" }, { - "name": "name[end]", + "name": "name[partial]", "in": "query", "required": false, "type": "string" @@ -16043,10 +15971,6 @@ "description": "", "type": "integer" }, - "mediaRelaySets": { - "description": "", - "type": "integer" - }, "mediaRelaySet": { "description": "", "type": "integer" @@ -16223,10 +16147,6 @@ "description": "", "type": "integer" }, - "mediaRelaySets": { - "description": "", - "type": "integer" - }, "defaultTimezone": { "description": "", "type": "integer" @@ -16235,10 +16155,6 @@ "description": "", "type": "integer" }, - "applicationServer": { - "description": "", - "type": "integer" - }, "country": { "description": "", "type": "integer" @@ -16844,10 +16760,6 @@ "description": "", "type": "integer" }, - "mediaRelaySets": { - "description": "", - "type": "integer" - }, "mediaRelaySet": { "description": "", "type": "integer" From 782793f71c04c09ee323d31fb8c4661942152ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Thu, 31 Oct 2024 12:26:08 +0100 Subject: [PATCH 10/10] portal/brand: updated apispec --- .../brand/cypress/fixtures/apiSpec.json | 72 +++---------------- 1 file changed, 11 insertions(+), 61 deletions(-) diff --git a/web/portal/brand/cypress/fixtures/apiSpec.json b/web/portal/brand/cypress/fixtures/apiSpec.json index bb80bd06d6..bd69f44a73 100644 --- a/web/portal/brand/cypress/fixtures/apiSpec.json +++ b/web/portal/brand/cypress/fixtures/apiSpec.json @@ -7162,24 +7162,6 @@ "required": false, "type": "string" }, - { - "name": "mediaRelaySets", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "mediaRelaySets[]", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "mediaRelaySets[exists]", - "in": "query", - "required": false, - "type": "boolean" - }, { "name": "name", "in": "query", @@ -7193,25 +7175,25 @@ "type": "string" }, { - "name": "name[end]", + "name": "name[neq]", "in": "query", "required": false, "type": "string" }, { - "name": "name[neq]", + "name": "name[start]", "in": "query", "required": false, "type": "string" }, { - "name": "name[start]", + "name": "name[partial]", "in": "query", "required": false, "type": "string" }, { - "name": "name[partial]", + "name": "name[end]", "in": "query", "required": false, "type": "string" @@ -11254,25 +11236,25 @@ "type": "string" }, { - "name": "description[start]", + "name": "description[neq]", "in": "query", "required": false, "type": "string" }, { - "name": "description[partial]", + "name": "description[start]", "in": "query", "required": false, "type": "string" }, { - "name": "description[end]", + "name": "description[partial]", "in": "query", "required": false, "type": "string" }, { - "name": "description[neq]", + "name": "description[end]", "in": "query", "required": false, "type": "string" @@ -11313,24 +11295,6 @@ "required": false, "type": "string" }, - { - "name": "mediaRelaySets", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "mediaRelaySets[]", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "mediaRelaySets[exists]", - "in": "query", - "required": false, - "type": "boolean" - }, { "name": "name", "in": "query", @@ -11350,19 +11314,19 @@ "type": "string" }, { - "name": "name[end]", + "name": "name[partial]", "in": "query", "required": false, "type": "string" }, { - "name": "name[neq]", + "name": "name[end]", "in": "query", "required": false, "type": "string" }, { - "name": "name[partial]", + "name": "name[neq]", "in": "query", "required": false, "type": "string" @@ -37820,10 +37784,6 @@ "description": "", "type": "integer" }, - "mediaRelaySets": { - "description": "", - "type": "integer" - }, "mediaRelaySet": { "description": "", "type": "integer" @@ -37929,9 +37889,6 @@ "proxyTrunk": { "$ref": "#/definitions/ProxyTrunk" }, - "mediaRelaySets": { - "$ref": "#/definitions/MediaRelaySet" - }, "mediaRelaySet": { "$ref": "#/definitions/MediaRelaySet" } @@ -39585,10 +39542,6 @@ "description": "", "type": "integer" }, - "mediaRelaySets": { - "description": "", - "type": "integer" - }, "mediaRelaySet": { "description": "", "type": "integer" @@ -39662,9 +39615,6 @@ "proxyTrunk": { "$ref": "#/definitions/ProxyTrunk" }, - "mediaRelaySets": { - "$ref": "#/definitions/MediaRelaySet" - }, "mediaRelaySet": { "$ref": "#/definitions/MediaRelaySet" }