feat(storefront): configure checkout summary type
This commit is contained in:
@@ -7,13 +7,21 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
#[Fillable(['codigo', 'nombre', 'header_type'])]
|
||||
#[Fillable(['codigo', 'nombre', 'header_type', 'checkout_summary_type'])]
|
||||
class StorefrontWebsiteType extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public const CHECKOUT_SUMMARY_DEFAULT = 'default';
|
||||
|
||||
public const CHECKOUT_SUMMARY_EVENT = 'event';
|
||||
|
||||
protected $table = 'storefront_website_types';
|
||||
|
||||
protected $attributes = [
|
||||
'checkout_summary_type' => self::CHECKOUT_SUMMARY_DEFAULT,
|
||||
];
|
||||
|
||||
/** @return HasMany<StorefrontWebsiteTypeExtra, $this> */
|
||||
public function extras(): HasMany
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Domains\Core\Tenant\Resources;
|
||||
|
||||
use App\Domains\Commerce\Catalog\Models\Category;
|
||||
use App\Domains\Core\Menu\Models\Menu;
|
||||
use App\Domains\Core\Tenant\Models\StorefrontWebsiteType;
|
||||
use App\Domains\Core\Tenant\Models\Tenant;
|
||||
use App\Domains\Ticketing\Event\Models\Event;
|
||||
use App\Domains\Ticketing\Event\Models\EventDate;
|
||||
@@ -50,6 +51,8 @@ class TenantResource extends JsonResource
|
||||
'admin_website_type_code' => $this->admin_website_type_code,
|
||||
'storefront_website_type_code' => $this->storefront_website_type_code,
|
||||
'header_type' => $this->storefrontWebsiteType?->header_type ?? 'standard',
|
||||
'checkout_summary_type' => $this->storefrontWebsiteType?->checkout_summary_type
|
||||
?? StorefrontWebsiteType::CHECKOUT_SUMMARY_DEFAULT,
|
||||
'active_event_id' => $this->active_event_id,
|
||||
'event' => $this->whenLoaded('activeEvent', fn () => $this->activeEvent === null
|
||||
? null : $this->formatEvent($this->activeEvent, $eventDateChanges)),
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Domains\Core\Tenant\Services;
|
||||
|
||||
use App\Shared\Attachable\Models\Attachment;
|
||||
use App\Domains\Core\Tenant\Models\Tenant;
|
||||
use App\Domains\Core\Tenant\Models\WebsiteExtra;
|
||||
use App\Shared\Attachable\Models\Attachment;
|
||||
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
@@ -16,6 +16,7 @@ class TenantInformationService
|
||||
'favicon',
|
||||
'headerBackgroundImage',
|
||||
'footerBackgroundImage',
|
||||
'storefrontWebsiteType',
|
||||
'socialMedia',
|
||||
'websiteExtras.websiteTypeExtra',
|
||||
'activeEvent.dates',
|
||||
|
||||
Reference in New Issue
Block a user