<?php
 namespace Modules\RemoteData\EntityManagementWs\Model\Entity\General; class GetCurrencyRates extends \Modules\RemoteData\EntityManagementWs\Model\Entity\GeneralAbstract { protected string $date; public function __construct(array $requestGet, \stdClass $request, \Modules\RemoteData\EntityManagementWs\Model\Response $response) { parent::__construct($requestGet, $request, $response); $this->date = $requestGet['date']?:TODAY_ISO; } protected function checkRequestData() :void { if (!validDate($this->date)) { throw new \Modules\RemoteData\EntityManagementWs\Model\RuntimeException('Invalid date set.', 'InvalidDateFormat'); } } protected function processRequest() :void { $currencyExch = \App\CurrencyExchange\Date::getInstance($this->date); $this->response->rates = $currencyExch->getRates(); $this->response->ratesDefineDate = $currencyExch->getLastDefinedDate(); $this->response->defaultCurrency = $currencyExch->getMarketCurrency(); } } 