Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| SeniorGetPreOrderService | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
20 | |
0.00% |
0 / 1 |
| getPreOrders | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
20 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Domain\Shared\Services; |
| 4 | |
| 5 | use Domain\Shared\Integrations\Senior\Exceptions\IntegrationSoapSeniorException; |
| 6 | use Domain\Shared\Integrations\Senior\SeniorPreOrder; |
| 7 | use Domain\StockIO\DTOs\SeniorPreOrderDTO; |
| 8 | |
| 9 | class SeniorGetPreOrderService |
| 10 | { |
| 11 | /** |
| 12 | * @throws IntegrationSoapSeniorException |
| 13 | */ |
| 14 | public function getPreOrders(SeniorPreOrderDTO $seniorPreOrderDTO): array |
| 15 | { |
| 16 | $preOrderDetails = (new SeniorPreOrder())->execute($seniorPreOrderDTO); |
| 17 | |
| 18 | // Remove a chave "Endereço Entrega:" |
| 19 | if (!empty($preOrderDetails)) { |
| 20 | foreach ($preOrderDetails as &$item) { |
| 21 | if (isset($item['Endereço Entrega:'])) { |
| 22 | unset($item['Endereço Entrega:']); |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | return $preOrderDetails; |
| 28 | } |
| 29 | } |