feat(tenant): implement website extras functionality and validation in tenant creation

This commit is contained in:
2026-07-29 15:16:33 -03:00
parent 9e3163b74f
commit 27d4f9fac6
7 changed files with 520 additions and 8 deletions

View File

@@ -30,6 +30,21 @@ class TenantResource extends JsonResource
'success_color' => $this->success_color,
'header_bg_color' => $this->header_bg_color,
'footer_bg_color' => $this->footer_bg_color,
'website_type_code' => $this->website_type_code,
'website_type' => $this->whenLoaded(
'websiteType',
fn () => $this->websiteType ? [
'codigo' => $this->websiteType->codigo,
'nombre' => $this->websiteType->nombre,
] : null
),
'extras' => $this->whenLoaded(
'websiteExtras',
fn () => $this->websiteExtras
->mapWithKeys(fn ($extra) => [
$extra->websiteTypeExtra->nombre => $extra->config,
])
),
// 1 day
'header_logo' => $this->headerLogo?->getTemporaryUrl(1440),
'footer_logo' => $this->footerLogo?->getTemporaryUrl(1440),