feat: voucher purchase flow
This commit is contained in:
1 parent
a628e96d06
commit
f3dd122678
70 files changed
+3672
-122
No files matched your search
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\BusProNet\Model;
|
||||
|
||||
/**
|
||||
* The GUTSCHEINVORLAGEN response: the designs on sale plus BusPro's amount bounds.
|
||||
*
|
||||
* The bounds (gutscheinminbetrag/gutscheinmaxbetrag) are not in the vendor documentation,
|
||||
* they were measured on the test system (10 and 5,000 €, both inclusive).
|
||||
*/
|
||||
final readonly class VoucherTemplates
|
||||
{
|
||||
/**
|
||||
* @param list<VoucherTemplate> $templates
|
||||
*/
|
||||
public function __construct(
|
||||
public int $minAmount,
|
||||
public int $maxAmount,
|
||||
public array $templates,
|
||||
) {
|
||||
}
|
||||
|
||||
public function find(int $id): ?VoucherTemplate
|
||||
{
|
||||
foreach ($this->templates as $template) {
|
||||
if ($id === $template->id) {
|
||||
return $template;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user