feat: add checkout editing policy to tenants and update related logic across services and resources

This commit is contained in:
2026-08-20 12:38:22 -03:00
parent c8ce3b0da3
commit 9c46eff880
17 changed files with 306 additions and 8 deletions

View File

@@ -27,6 +27,8 @@ use Illuminate\Support\Facades\Schema;
'dominio',
'base_path',
'site_title',
'address',
'phone',
'primary_color',
'secondary_color',
'danger_color',

View File

@@ -82,6 +82,8 @@ class StoreTenantRequest extends FormRequest
->where('dominio', $this->input('dominio')),
],
'site_title' => ['sometimes', 'nullable', 'string', 'max:255'],
'address' => ['sometimes', 'nullable', 'string', 'max:255'],
'phone' => ['sometimes', 'nullable', 'string', 'max:255'],
'primary_color' => ['required', 'string', 'regex:/^#([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/'],
'secondary_color' => ['required', 'string', 'regex:/^#([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/'],
'danger_color' => ['required', 'string', 'regex:/^#([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/'],

View File

@@ -103,6 +103,8 @@ class UpdateTenantRequest extends FormRequest
->ignore($tenant?->id),
],
'site_title' => ['sometimes', 'nullable', 'string', 'max:255'],
'address' => ['sometimes', 'nullable', 'string', 'max:255'],
'phone' => ['sometimes', 'nullable', 'string', 'max:255'],
'primary_color' => ['nullable', 'string', 'regex:/^#([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/'],
'secondary_color' => ['nullable', 'string', 'regex:/^#([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/'],
'danger_color' => ['nullable', 'string', 'regex:/^#([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/'],

View File

@@ -32,6 +32,8 @@ class TenantResource extends JsonResource
'site_title' => $this->site_title
?? $this->websiteType?->site_title
?? 'ShopitFront',
'address' => $this->address,
'phone' => $this->phone,
'favicon' => ($this->favicon ?? $this->websiteType?->favicon)
?->getTemporaryUrl(1440),
'primary_color' => $this->primary_color,