feat: add UserResource with is_admin toggle and delete
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.3) (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled

User management resource with editable is_admin field, postcode support,
admin filter, and inline delete action. Includes list and edit pages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ovidiu U
2026-04-04 18:31:55 +01:00
parent fb4c413926
commit c2c16c928b
10 changed files with 2172 additions and 41 deletions

View File

@@ -8,23 +8,25 @@ class StationTaggingService
{
/** @var array<string, string> brand keyword → normalised brand name */
private const SUPERMARKET_BRANDS = [
'tesco' => 'Tesco',
'asda' => 'Asda',
'tesco' => 'Tesco',
'asda' => 'Asda',
'morrisons' => 'Morrisons',
'sainsbury' => 'Sainsbury\'s',
'aldi' => 'Aldi',
'lidl' => 'Lidl',
'costco' => 'Costco',
'aldi' => 'Aldi',
'lidl' => 'Lidl',
'costco' => 'Costco',
];
public function tag(Station $station): void
{
$name = strtolower($station->trading_name);
$tradingName = strtolower($station->trading_name);
$brandName = strtolower($station->brand_name ?? '');
foreach (self::SUPERMARKET_BRANDS as $keyword => $normalisedBrand) {
if (str_contains($name, $keyword)) {
if (str_contains($tradingName, $keyword) || str_contains($brandName, $keyword)) {
$station->is_supermarket = true;
$station->brand_name = $normalisedBrand;
$station->brand_name = $normalisedBrand;
return;
}
}