feat: implement tenant update request validation and add feature tests for domain bootstrapping

This commit is contained in:
2026-06-26 16:23:14 -03:00
parent 54aa696145
commit 8708cea122
3 changed files with 36 additions and 4 deletions

View File

@@ -27,6 +27,11 @@ class Tenant extends Model
use HasAttachments;
use HasFactory;
public function getRouteKeyName(): string
{
return 'codigo';
}
/**
* @return BelongsTo<Attachment, $this>
*/

View File

@@ -88,12 +88,12 @@ class UpdateTenantRequest extends FormRequest
return [
'codigo' => [
'required',
'sometimes',
'string',
'max:255',
Rule::unique('tenants', 'codigo')->ignore($tenant?->id),
],
'nombre' => ['required', 'string', 'max:255'],
'nombre' => ['sometimes', 'string', 'max:255'],
'dominio' => [
'bail',
function (string $attribute, mixed $value, Closure $fail): void {