-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace SimpleSquid\Vend\ZeroNine\Requests\RegisterSales; | ||
|
||
use Saloon\Enums\Method; | ||
use Saloon\Http\Request; | ||
|
||
class GetRegisterSale extends Request | ||
{ | ||
protected Method $method = Method::GET; | ||
|
||
public function resolveEndpoint(): string | ||
{ | ||
return "/register_sales/{$this->registerSaleId}"; | ||
} | ||
|
||
public function __construct( | ||
protected string $registerSaleId, | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace SimpleSquid\Vend\ZeroNine\Requests\RegisterSales; | ||
|
||
use Saloon\Enums\Method; | ||
use Saloon\Http\Request; | ||
use Saloon\PaginationPlugin\Contracts\Paginatable; | ||
|
||
class ListRegisterSales extends Request implements Paginatable | ||
{ | ||
protected Method $method = Method::GET; | ||
|
||
public function resolveEndpoint(): string | ||
{ | ||
return '/register_sales'; | ||
} | ||
|
||
/** | ||
* @param null|string[] $status | ||
*/ | ||
public function __construct( | ||
protected ?string $since = null, | ||
protected ?string $outletId = null, | ||
protected ?array $status = null, | ||
protected ?int $page = null, | ||
protected ?int $pageSize = null, | ||
) { | ||
} | ||
|
||
public function defaultQuery(): array | ||
{ | ||
return array_filter([ | ||
'since' => $this->since, | ||
'outlet_id' => $this->outletId, | ||
'status' => $this->status, | ||
'page' => $this->page, | ||
'page_size' => $this->pageSize, | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters