|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Koba\ToolboxClien\Directories\Boekenverkoop\StoreStandaardBoekhandalArtikelbestandBatch; |
| 4 | + |
| 5 | +use DateTimeInterface; |
| 6 | +use Koba\ToolboxClient\Call\AbstractCall; |
| 7 | +use Koba\ToolboxClient\Directories\Boekenverkoop\BoekenverkoopDirectory; |
| 8 | +use Koba\ToolboxClient\Request\HttpMethod; |
| 9 | +use Psr\Http\Message\ResponseInterface; |
| 10 | + |
| 11 | +/** |
| 12 | + * @phpstan-type Artikel array{ |
| 13 | + * isbn: string, |
| 14 | + * prijs_incl_btw: string, |
| 15 | + * uitgevercode: string, |
| 16 | + * uitgevernaam: string, |
| 17 | + * isbn_oud: string, |
| 18 | + * titel: string, |
| 19 | + * auteur: string, |
| 20 | + * btwpercentage: string, |
| 21 | + * meldingscode: string, |
| 22 | + * melding: string, |
| 23 | + * vermoedelijkeverschijningsdatum: ?DateTimeInterface, |
| 24 | + * genrecode: string, |
| 25 | + * genre: string, |
| 26 | + * laatsteUpdate: DateTimeInterface |
| 27 | + * } |
| 28 | + */ |
| 29 | +class StoreStandaardBoekhandalArtikelbestandBatchCall extends AbstractCall |
| 30 | +{ |
| 31 | + /** |
| 32 | + * @var Artikel[] $artikels |
| 33 | + */ |
| 34 | + protected array $artikels = []; |
| 35 | + |
| 36 | + /** |
| 37 | + * @param Artikel[] $artikels |
| 38 | + */ |
| 39 | + public static function make( |
| 40 | + BoekenverkoopDirectory $directory, |
| 41 | + array $artikels |
| 42 | + ): self { |
| 43 | + return (new self($directory))->setArtikels($artikels); |
| 44 | + } |
| 45 | + |
| 46 | + /** |
| 47 | + * Stel de artikels in die in toolbox geplaatst dienen te worden. |
| 48 | + * |
| 49 | + * @param Artikel[] $artikels |
| 50 | + */ |
| 51 | + public function setArtikels(array $artikels = []): self |
| 52 | + { |
| 53 | + $this->artikels = $artikels; |
| 54 | + return $this; |
| 55 | + } |
| 56 | + |
| 57 | + protected function getMethod(): HttpMethod |
| 58 | + { |
| 59 | + return HttpMethod::POST; |
| 60 | + } |
| 61 | + |
| 62 | + protected function getEndpoint(): string |
| 63 | + { |
| 64 | + return 'boekenverkoop/standaard_boekhandel/artikelbestand/batch'; |
| 65 | + } |
| 66 | + |
| 67 | + /** |
| 68 | + * @return array<array-key,mixed> |
| 69 | + */ |
| 70 | + protected function getBody(): array |
| 71 | + { |
| 72 | + return $this->artikels; |
| 73 | + } |
| 74 | + |
| 75 | + public function send(): ResponseInterface |
| 76 | + { |
| 77 | + return $this->performRequest(); |
| 78 | + } |
| 79 | +} |
0 commit comments