feat(scanner): add scanner category validation logic and related tests

This commit is contained in:
2026-08-13 11:26:13 -03:00
parent 329e0b1953
commit a2592987f5
12 changed files with 216 additions and 17 deletions

View File

@@ -38,6 +38,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
'display_categories',
'display_seach_bar',
'display_cart',
'scanner_category_validation_enabled',
'event_title',
'event_location',
'event_date_text',
@@ -53,6 +54,7 @@ class Tenant extends Model
'display_categories' => true,
'display_seach_bar' => true,
'display_cart' => true,
'scanner_category_validation_enabled' => true,
];
public function getRouteKeyName(): string
@@ -60,6 +62,11 @@ class Tenant extends Model
return 'codigo';
}
public function requiresScannerCategoryValidation(): bool
{
return $this->scanner_category_validation_enabled;
}
/**
* Get the attributes that should be cast.
*
@@ -74,6 +81,7 @@ class Tenant extends Model
'display_categories' => 'boolean',
'display_seach_bar' => 'boolean',
'display_cart' => 'boolean',
'scanner_category_validation_enabled' => 'boolean',
];
}