feat(tenant): separate admin and storefront website types

This commit is contained in:
2026-09-17 14:25:46 -03:00
parent b9b5f8ec9c
commit 6bc784519f
31 changed files with 325 additions and 143 deletions

View File

@@ -148,6 +148,18 @@ class UpdateTenantRequest extends FormRequest
'min:0',
'max:99.99',
],
'admin_website_type_code' => ['sometimes', 'nullable', 'string', Rule::exists('admin_website_types', 'codigo')],
'storefront_website_type_code' => [
'sometimes',
'nullable',
'string',
Rule::exists('storefront_website_types', 'codigo'),
function (string $attribute, mixed $value, Closure $fail) use ($tenant): void {
if ($tenant && $value !== $tenant->storefront_website_type_code && $tenant->websiteExtras()->exists()) {
$fail('The storefront website type cannot be changed while the tenant has extras.');
}
},
],
];
}
}