Add hub selector filtering for available riders, refactor inventory filter to... #1731

Merged
arcticzero merged 42 commits from 800-automatically-reject-jo-if-no-riders-or-inventory into master 2024-07-18 08:34:03 +00:00
2 changed files with 22 additions and 1 deletions
Showing only changes of commit be0e69db89 - Show all commits

View file

@ -29,4 +29,8 @@ class JORejectionReason extends NameValue
'no_credit_card' => 'NO CREDIT CARD PAYMENT / NO TERMINAL',
'discount' => 'DISCOUNT',
];
const BLACKLIST = [
self::ADMINISTRATIVE => true,
];
}

View file

@ -4,9 +4,21 @@ namespace App\Ramcar;
class NameValue
{
const BLACKLIST = [];
static public function getCollection()
{
return static::COLLECTION;
$result = [];
$blacklist = static::getBlacklist();
// filter from blacklist
foreach(static::COLLECTION as $key => $row) {
if (!isset($blacklist[$key])) {
$result[] = $row;
}
}
return $result;
}
static public function validate($value)
@ -24,4 +36,9 @@ class NameValue
return 'Unknown';
}
static public function getBlacklist()
{
return static::BLACKLIST ?? [];
}
}