Compare commits
20 Commits
8d5a12f212
...
tenant/sme
| Author | SHA1 | Date | |
|---|---|---|---|
| a40a2065a9 | |||
| 57677f55e6 | |||
| a8afd92f46 | |||
| 1df0d2e2ef | |||
| d3cac7a590 | |||
| df13a636ba | |||
| d85841742e | |||
| 0e3fdc5460 | |||
| 0dc2675dae | |||
| 28d1de072c | |||
| b09e8a4b96 | |||
| 7f754037bb | |||
| f29c5692b9 | |||
| 57d278336d | |||
| b309738222 | |||
| b3eb59983a | |||
| cf3f0ceb1b | |||
| 41c0902b83 | |||
| a2439bf43b | |||
| bd77727f58 |
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Domains\Commerce\Catalog\Services;
|
namespace App\Domains\Commerce\Catalog\Services;
|
||||||
|
|
||||||
use App\Shared\Attachable\Models\Attachment;
|
|
||||||
use App\Shared\Attachable\Services\AttachmentService;
|
|
||||||
use App\Domains\Commerce\Catalog\Enums\CatalogItemType;
|
use App\Domains\Commerce\Catalog\Enums\CatalogItemType;
|
||||||
use App\Domains\Commerce\Catalog\Models\Attribute;
|
use App\Domains\Commerce\Catalog\Models\Attribute;
|
||||||
use App\Domains\Commerce\Catalog\Models\CatalogItem;
|
use App\Domains\Commerce\Catalog\Models\CatalogItem;
|
||||||
@@ -11,8 +9,10 @@ use App\Domains\Commerce\Catalog\Models\Category;
|
|||||||
use App\Domains\Commerce\Catalog\Models\Inventory;
|
use App\Domains\Commerce\Catalog\Models\Inventory;
|
||||||
use App\Domains\Commerce\Catalog\Models\ItemAttribute;
|
use App\Domains\Commerce\Catalog\Models\ItemAttribute;
|
||||||
use App\Domains\Commerce\Catalog\Models\Variant;
|
use App\Domains\Commerce\Catalog\Models\Variant;
|
||||||
use App\Domains\Ticketing\Event\Models\EventDate;
|
|
||||||
use App\Domains\Core\Tenant\Models\Tenant;
|
use App\Domains\Core\Tenant\Models\Tenant;
|
||||||
|
use App\Domains\Ticketing\Event\Models\EventDate;
|
||||||
|
use App\Shared\Attachable\Models\Attachment;
|
||||||
|
use App\Shared\Attachable\Services\AttachmentService;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Pagination\LengthAwarePaginator;
|
use Illuminate\Pagination\LengthAwarePaginator;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
@@ -286,9 +286,11 @@ class CatalogService
|
|||||||
int $perPage,
|
int $perPage,
|
||||||
int $page,
|
int $page,
|
||||||
): LengthAwarePaginator {
|
): LengthAwarePaginator {
|
||||||
|
$categoryIds = $this->categoryAndDescendantIds($tenant, $category);
|
||||||
|
|
||||||
return CatalogItem::query()
|
return CatalogItem::query()
|
||||||
->forTenantCatalog($tenant)
|
->forTenantCatalog($tenant)
|
||||||
->where('category_id', $category->id)
|
->whereIn('category_id', $categoryIds)
|
||||||
->whereAvailable()
|
->whereAvailable()
|
||||||
->with([
|
->with([
|
||||||
'attachments',
|
'attachments',
|
||||||
@@ -306,6 +308,34 @@ class CatalogService
|
|||||||
->paginate(perPage: $perPage, pageName: 'page', page: $page);
|
->paginate(perPage: $perPage, pageName: 'page', page: $page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return array<int, int> */
|
||||||
|
private function categoryAndDescendantIds(Tenant $tenant, Category $category): array
|
||||||
|
{
|
||||||
|
$childrenByParent = Category::query()
|
||||||
|
->where('tenant_code', $tenant->codigo)
|
||||||
|
->get(['id', 'categoria_id'])
|
||||||
|
->groupBy('categoria_id');
|
||||||
|
|
||||||
|
$categoryIds = [];
|
||||||
|
$pendingIds = [$category->id];
|
||||||
|
|
||||||
|
while ($pendingIds !== []) {
|
||||||
|
$categoryId = array_shift($pendingIds);
|
||||||
|
|
||||||
|
if (isset($categoryIds[$categoryId])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$categoryIds[$categoryId] = $categoryId;
|
||||||
|
|
||||||
|
foreach ($childrenByParent->get($categoryId, collect()) as $child) {
|
||||||
|
$pendingIds[] = $child->id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return array_values($categoryIds);
|
||||||
|
}
|
||||||
|
|
||||||
public function delete(CatalogItem $catalogItem): void
|
public function delete(CatalogItem $catalogItem): void
|
||||||
{
|
{
|
||||||
DB::transaction(function () use ($catalogItem): void {
|
DB::transaction(function () use ($catalogItem): void {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ use App\Domains\Commerce\Catalog\Models\Variant;
|
|||||||
use App\Domains\Commerce\Purchase\Models\PurchaseItem;
|
use App\Domains\Commerce\Purchase\Models\PurchaseItem;
|
||||||
use App\Domains\Core\Auth\Models\User;
|
use App\Domains\Core\Auth\Models\User;
|
||||||
use App\Domains\Core\Tenant\Models\Tenant;
|
use App\Domains\Core\Tenant\Models\Tenant;
|
||||||
|
use App\Domains\Ticketing\Desfile\Models\EntryReservation;
|
||||||
use App\Domains\Ticketing\Event\Models\Event;
|
use App\Domains\Ticketing\Event\Models\Event;
|
||||||
use App\Domains\Ticketing\Ticket\Services\ResolvedTicketValidity;
|
use App\Domains\Ticketing\Ticket\Services\ResolvedTicketValidity;
|
||||||
use App\Domains\Ticketing\Ticket\Services\ResolvedValidityGroup;
|
use App\Domains\Ticketing\Ticket\Services\ResolvedValidityGroup;
|
||||||
@@ -192,7 +193,9 @@ class Ticket extends Model
|
|||||||
|
|
||||||
public function can_refund(): bool
|
public function can_refund(): bool
|
||||||
{
|
{
|
||||||
return $this->is_active() && $this->allow_refund();
|
return $this->is_active()
|
||||||
|
&& $this->allow_refund()
|
||||||
|
&& ! $this->hasEntryReservation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function canRefund(): bool
|
public function canRefund(): bool
|
||||||
@@ -235,6 +238,12 @@ class Ticket extends Model
|
|||||||
return $this->hasOne(TicketRefund::class);
|
return $this->hasOne(TicketRefund::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return HasOne<EntryReservation, $this> */
|
||||||
|
public function entryReservation(): HasOne
|
||||||
|
{
|
||||||
|
return $this->hasOne(EntryReservation::class);
|
||||||
|
}
|
||||||
|
|
||||||
/** @return BelongsTo<CatalogItem, $this> */
|
/** @return BelongsTo<CatalogItem, $this> */
|
||||||
public function sourceCatalogItem(): BelongsTo
|
public function sourceCatalogItem(): BelongsTo
|
||||||
{
|
{
|
||||||
@@ -247,6 +256,15 @@ class Ticket extends Model
|
|||||||
return $this->belongsTo(Variant::class, 'source_variant_id')->withTrashed();
|
return $this->belongsTo(Variant::class, 'source_variant_id')->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function hasEntryReservation(): bool
|
||||||
|
{
|
||||||
|
if ($this->relationLoaded('entryReservation')) {
|
||||||
|
return $this->getRelation('entryReservation') instanceof EntryReservation;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->exists && $this->entryReservation()->exists();
|
||||||
|
}
|
||||||
|
|
||||||
public function isValid(): bool
|
public function isValid(): bool
|
||||||
{
|
{
|
||||||
if ($this->hasTerminalStatus() || $this->used_at !== null) {
|
if ($this->hasTerminalStatus() || $this->used_at !== null) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Domains\Ticketing\Ticket\Requests;
|
namespace App\Domains\Ticketing\Ticket\Requests;
|
||||||
|
|
||||||
use App\Domains\Ticketing\Ticket\Models\Ticket;
|
use App\Domains\Ticketing\Ticket\Models\Ticket;
|
||||||
|
use App\Domains\Ticketing\Ticket\Services\AdminAppTicketAttributeService;
|
||||||
use App\Domains\Ticketing\Ticket\Services\AdminAppTicketColumnService;
|
use App\Domains\Ticketing\Ticket\Services\AdminAppTicketColumnService;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
@@ -22,7 +23,7 @@ class AdminAppTicketIndexRequest extends FormRequest
|
|||||||
? []
|
? []
|
||||||
: app(AdminAppTicketColumnService::class)->sortableKeys($tenant);
|
: app(AdminAppTicketColumnService::class)->sortableKeys($tenant);
|
||||||
|
|
||||||
return [
|
$rules = [
|
||||||
'q' => ['sometimes', 'nullable', 'string', 'max:255'],
|
'q' => ['sometimes', 'nullable', 'string', 'max:255'],
|
||||||
'category' => ['sometimes', 'nullable', 'string', 'max:255'],
|
'category' => ['sometimes', 'nullable', 'string', 'max:255'],
|
||||||
'product' => ['sometimes', 'nullable', 'string', 'max:255'],
|
'product' => ['sometimes', 'nullable', 'string', 'max:255'],
|
||||||
@@ -39,5 +40,18 @@ class AdminAppTicketIndexRequest extends FormRequest
|
|||||||
'sort_by' => ['sometimes', 'nullable', 'string', Rule::in($sortableKeys)],
|
'sort_by' => ['sometimes', 'nullable', 'string', Rule::in($sortableKeys)],
|
||||||
'sort_direction' => ['sometimes', 'nullable', 'string', Rule::in(['asc', 'desc'])],
|
'sort_direction' => ['sometimes', 'nullable', 'string', Rule::in(['asc', 'desc'])],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if ($tenant !== null) {
|
||||||
|
foreach (app(AdminAppTicketAttributeService::class)->attributes($tenant) as $attribute) {
|
||||||
|
$rules[$attribute['code']] = [
|
||||||
|
'sometimes',
|
||||||
|
'nullable',
|
||||||
|
'string',
|
||||||
|
Rule::in(array_column($attribute['options'], 'value')),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $rules;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,92 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Domains\Ticketing\Ticket\Services;
|
||||||
|
|
||||||
|
use App\Domains\Commerce\Catalog\Models\CatalogItem;
|
||||||
|
use App\Domains\Core\Tenant\Models\Tenant;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
|
||||||
|
class AdminAppTicketAttributeService
|
||||||
|
{
|
||||||
|
private const DESFILE_PURA_TENDENCIA = 'desfile_pura_tendencia';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return list<array{
|
||||||
|
* code: string,
|
||||||
|
* label: string,
|
||||||
|
* options: list<array{value: string, label: string}>
|
||||||
|
* }>
|
||||||
|
*/
|
||||||
|
public function attributes(Tenant $tenant): array
|
||||||
|
{
|
||||||
|
if ($tenant->codigo !== self::DESFILE_PURA_TENDENCIA) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$items = CatalogItem::withTrashed()
|
||||||
|
->where('tenant_code', $tenant->codigo)
|
||||||
|
->where(function (Builder $query): void {
|
||||||
|
$query
|
||||||
|
->where(function (Builder $activeQuery): void {
|
||||||
|
$activeQuery
|
||||||
|
->whereNull('catalog_items.deleted_at')
|
||||||
|
->where('has_tickets', true);
|
||||||
|
})
|
||||||
|
->orWhereHas('sourceTickets');
|
||||||
|
})
|
||||||
|
->with([
|
||||||
|
'itemAttributes' => fn ($query) => $query->orderBy('sort_order')->orderBy('id'),
|
||||||
|
'itemAttributes.attribute.options',
|
||||||
|
'variants' => fn ($query) => $query
|
||||||
|
->withTrashed()
|
||||||
|
->where(fn (Builder $variantQuery): Builder => $variantQuery
|
||||||
|
->whereNull('variantes.deleted_at')
|
||||||
|
->orWhereHas('sourceTickets'))
|
||||||
|
->orderBy('id'),
|
||||||
|
'variants.definitions.itemAttribute.attribute.options',
|
||||||
|
])
|
||||||
|
->get();
|
||||||
|
|
||||||
|
$attributes = [];
|
||||||
|
|
||||||
|
foreach ($items as $item) {
|
||||||
|
foreach ($item->itemAttributes as $itemAttribute) {
|
||||||
|
$attribute = $itemAttribute->attribute;
|
||||||
|
if ($attribute === null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$code = $attribute->codigo;
|
||||||
|
$attributes[$code] ??= [
|
||||||
|
'code' => $code,
|
||||||
|
'label' => $itemAttribute->ticket_label ?: $attribute->nombre,
|
||||||
|
'sort_order' => $itemAttribute->sort_order,
|
||||||
|
'options' => [],
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($item->variants as $variant) {
|
||||||
|
$definition = $variant->definitions->firstWhere('item_attribute_id', $itemAttribute->id);
|
||||||
|
if ($definition === null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$value = (string) $definition->value;
|
||||||
|
$option = $attribute->options->firstWhere('value', $value);
|
||||||
|
$attributes[$code]['options'][$value] = [
|
||||||
|
'value' => $value,
|
||||||
|
'label' => (string) ($option?->label ?: $value),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uasort($attributes, fn (array $left, array $right): int => $left['sort_order'] <=> $right['sort_order']
|
||||||
|
?: $left['label'] <=> $right['label']);
|
||||||
|
|
||||||
|
return array_values(array_map(fn (array $attribute): array => [
|
||||||
|
'code' => $attribute['code'],
|
||||||
|
'label' => $attribute['label'],
|
||||||
|
'options' => array_values($attribute['options']),
|
||||||
|
], $attributes));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,9 +8,17 @@ class AdminAppTicketColumnService
|
|||||||
{
|
{
|
||||||
private const FIESTA_FUTBOL_INFANTIL = 'fiesta_futbol_infantil';
|
private const FIESTA_FUTBOL_INFANTIL = 'fiesta_futbol_infantil';
|
||||||
|
|
||||||
|
private const DESFILE_PURA_TENDENCIA = 'desfile_pura_tendencia';
|
||||||
|
|
||||||
|
public function __construct(private readonly AdminAppTicketAttributeService $attributeService) {}
|
||||||
|
|
||||||
/** @return list<array{key: string, label: string, type: string, sortable: bool, sort_param: string, width: string, excel_width: int}> */
|
/** @return list<array{key: string, label: string, type: string, sortable: bool, sort_param: string, width: string, excel_width: int}> */
|
||||||
public function columns(Tenant $tenant): array
|
public function columns(Tenant $tenant): array
|
||||||
{
|
{
|
||||||
|
if ($tenant->codigo === self::DESFILE_PURA_TENDENCIA) {
|
||||||
|
return $this->desfileColumns($tenant);
|
||||||
|
}
|
||||||
|
|
||||||
$keys = $tenant->codigo === self::FIESTA_FUTBOL_INFANTIL
|
$keys = $tenant->codigo === self::FIESTA_FUTBOL_INFANTIL
|
||||||
? ['order_number', 'category', 'product', 'type', 'date', 'size', 'amount', 'client', 'id', 'status', 'scanned_by']
|
? ['order_number', 'category', 'product', 'type', 'date', 'size', 'amount', 'client', 'id', 'status', 'scanned_by']
|
||||||
: ['order_number', 'product', 'amount', 'client', 'id', 'status', 'scanned_by'];
|
: ['order_number', 'product', 'amount', 'client', 'id', 'status', 'scanned_by'];
|
||||||
@@ -45,6 +53,31 @@ class AdminAppTicketColumnService
|
|||||||
return $columns;
|
return $columns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return list<array{key: string, label: string, type: string, sortable: bool, sort_param: string, width: string, excel_width: int}> */
|
||||||
|
private function desfileColumns(Tenant $tenant): array
|
||||||
|
{
|
||||||
|
$attributeColumns = array_map(fn (array $attribute): array => [
|
||||||
|
'key' => $attribute['code'],
|
||||||
|
'label' => $attribute['label'],
|
||||||
|
'type' => 'text',
|
||||||
|
'sortable' => false,
|
||||||
|
'sort_param' => $attribute['code'],
|
||||||
|
'width' => '8%',
|
||||||
|
'excel_width' => 15,
|
||||||
|
], $this->attributeService->attributes($tenant));
|
||||||
|
|
||||||
|
return [
|
||||||
|
$this->definitions()['order_number'],
|
||||||
|
$this->definitions()['product'],
|
||||||
|
...$attributeColumns,
|
||||||
|
$this->definitions()['amount'],
|
||||||
|
$this->definitions()['client'],
|
||||||
|
$this->definitions()['id'],
|
||||||
|
$this->definitions()['status'],
|
||||||
|
$this->definitions()['scanned_by'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
/** @return list<array{key: string, label: string, type: string, sortable: bool, sort_param: string, width: string}> */
|
/** @return list<array{key: string, label: string, type: string, sortable: bool, sort_param: string, width: string}> */
|
||||||
public function publicColumns(Tenant $tenant): array
|
public function publicColumns(Tenant $tenant): array
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ class AdminAppTicketRowService
|
|||||||
{
|
{
|
||||||
private const FIESTA_FUTBOL_INFANTIL = 'fiesta_futbol_infantil';
|
private const FIESTA_FUTBOL_INFANTIL = 'fiesta_futbol_infantil';
|
||||||
|
|
||||||
|
private const DESFILE_PURA_TENDENCIA = 'desfile_pura_tendencia';
|
||||||
|
|
||||||
private const CATEGORY_PRESENTATIONS = [
|
private const CATEGORY_PRESENTATIONS = [
|
||||||
'alojamientos' => ['category' => 'Camping', 'product' => 'tipo_alojamiento', 'type' => null, 'size' => null],
|
'alojamientos' => ['category' => 'Camping', 'product' => 'tipo_alojamiento', 'type' => null, 'size' => null],
|
||||||
'camping' => ['category' => null, 'product' => 'tipo_alojamiento', 'type' => null, 'size' => null],
|
'camping' => ['category' => null, 'product' => 'tipo_alojamiento', 'type' => null, 'size' => null],
|
||||||
@@ -25,31 +27,65 @@ class AdminAppTicketRowService
|
|||||||
{
|
{
|
||||||
$purchaseItem = $ticket->sourcePurchaseItem;
|
$purchaseItem = $ticket->sourcePurchaseItem;
|
||||||
$refund = $ticket->refund;
|
$refund = $ticket->refund;
|
||||||
|
$variantProperties = $this->variantProperties($ticket);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'source_purchase_item_id' => $ticket->source_purchase_item_id,
|
'source_purchase_item_id' => $ticket->source_purchase_item_id,
|
||||||
'order_number' => $purchaseItem?->compra_id,
|
'order_number' => $purchaseItem?->compra_id,
|
||||||
'product' => $purchaseItem?->item_nombre
|
'product' => $this->productName($ticket, $purchaseItem?->item_nombre, $variantProperties),
|
||||||
?? $ticket->sourceCatalogItem?->nombre
|
'amount' => $purchaseItem?->precio_unitario ?? $ticket->entryReservation?->importe,
|
||||||
?? $ticket->name,
|
|
||||||
'amount' => $purchaseItem?->precio_unitario,
|
|
||||||
'refund_type' => $refund?->type,
|
'refund_type' => $refund?->type,
|
||||||
'refund_type_label' => $refund?->typeLabel(),
|
'refund_type_label' => $refund?->typeLabel(),
|
||||||
'client' => $purchaseItem?->purchase?->nombre_apellido ?? $ticket->user?->nombre_apellido,
|
'client' => $purchaseItem?->purchase?->nombre_apellido ?? $ticket->user?->nombre_apellido,
|
||||||
'status' => $ticket->status,
|
'status' => $ticket->status,
|
||||||
'scanned_by' => $ticket->scannerUser?->nombre_apellido,
|
'scanned_by' => $ticket->scannerUser?->nombre_apellido,
|
||||||
'variant_properties' => $this->variantProperties($ticket),
|
'variant_properties' => $variantProperties,
|
||||||
'allow_refund' => $ticket->allow_refund(),
|
'allow_refund' => $ticket->allow_refund(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param list<array{code: string, label: string, values: list<array{value: string, label: string}>}> $properties
|
||||||
|
*/
|
||||||
|
private function productName(Ticket $ticket, ?string $snapshotName, array $properties): string
|
||||||
|
{
|
||||||
|
$baseName = $ticket->sourceCatalogItem?->nombre ?: $ticket->name;
|
||||||
|
|
||||||
|
if ($ticket->tenant_code !== self::DESFILE_PURA_TENDENCIA) {
|
||||||
|
return $snapshotName ?: $baseName;
|
||||||
|
}
|
||||||
|
|
||||||
|
$seatDescription = collect(['sector', 'fila', 'asiento'])
|
||||||
|
->map(function (string $code) use ($properties): ?string {
|
||||||
|
$property = collect($properties)->firstWhere('code', $code);
|
||||||
|
$values = collect($property['values'] ?? [])->pluck('label')->filter()->implode(', ');
|
||||||
|
|
||||||
|
return $property === null || $values === ''
|
||||||
|
? null
|
||||||
|
: $property['label'].' '.$values;
|
||||||
|
})
|
||||||
|
->filter()
|
||||||
|
->implode(', ');
|
||||||
|
|
||||||
|
return $seatDescription === '' ? ($snapshotName ?: $baseName) : "{$baseName} ({$seatDescription})";
|
||||||
|
}
|
||||||
|
|
||||||
/** @param array<string, mixed>|null $details */
|
/** @param array<string, mixed>|null $details */
|
||||||
public function values(Ticket $ticket, ?array $details = null): array
|
public function values(Ticket $ticket, ?array $details = null): array
|
||||||
{
|
{
|
||||||
$details ??= $this->details($ticket);
|
$details ??= $this->details($ticket);
|
||||||
$presentation = $this->presentation($ticket, $details);
|
$presentation = $this->presentation($ticket, $details);
|
||||||
|
$attributeValues = collect($details['variant_properties'] ?? [])
|
||||||
|
->mapWithKeys(fn (array $property): array => [
|
||||||
|
$property['code'] => collect($property['values'] ?? [])
|
||||||
|
->pluck('label')
|
||||||
|
->filter()
|
||||||
|
->implode(', ') ?: '-',
|
||||||
|
])
|
||||||
|
->all();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
...$attributeValues,
|
||||||
'order_number' => $details['order_number'],
|
'order_number' => $details['order_number'],
|
||||||
'category' => $presentation['category'],
|
'category' => $presentation['category'],
|
||||||
'product' => $presentation['product'],
|
'product' => $presentation['product'],
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
namespace App\Domains\Ticketing\Ticket\Services;
|
namespace App\Domains\Ticketing\Ticket\Services;
|
||||||
|
|
||||||
use App\Domains\Core\Auth\Models\User;
|
|
||||||
use App\Domains\Commerce\Catalog\Enums\InventoryPolicy;
|
use App\Domains\Commerce\Catalog\Enums\InventoryPolicy;
|
||||||
use App\Domains\Commerce\Catalog\Models\Inventory;
|
use App\Domains\Commerce\Catalog\Models\Inventory;
|
||||||
use App\Domains\Commerce\Catalog\Models\Variant;
|
use App\Domains\Commerce\Catalog\Models\Variant;
|
||||||
use App\Domains\Commerce\Purchase\Models\PurchaseItem;
|
use App\Domains\Commerce\Purchase\Models\PurchaseItem;
|
||||||
use App\Domains\Commerce\Purchase\Services\PurchaseRefundSummaryService;
|
use App\Domains\Commerce\Purchase\Services\PurchaseRefundSummaryService;
|
||||||
|
use App\Domains\Core\Auth\Models\User;
|
||||||
use App\Domains\Core\Tenant\Models\Tenant;
|
use App\Domains\Core\Tenant\Models\Tenant;
|
||||||
use App\Domains\Ticketing\Ticket\Models\Ticket;
|
use App\Domains\Ticketing\Ticket\Models\Ticket;
|
||||||
use App\Domains\Ticketing\Ticket\Models\TicketRefund;
|
use App\Domains\Ticketing\Ticket\Models\TicketRefund;
|
||||||
@@ -27,11 +27,13 @@ class AdminAppTicketService
|
|||||||
'scannerUser',
|
'scannerUser',
|
||||||
'sourceCatalogItem.category',
|
'sourceCatalogItem.category',
|
||||||
'sourcePurchaseItem.purchase',
|
'sourcePurchaseItem.purchase',
|
||||||
|
'entryReservation',
|
||||||
'refund.createdBy',
|
'refund.createdBy',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly AdminAppTicketColumnService $columnService,
|
private readonly AdminAppTicketColumnService $columnService,
|
||||||
|
private readonly AdminAppTicketAttributeService $attributeService,
|
||||||
private readonly AdminAppTicketRowService $rowService,
|
private readonly AdminAppTicketRowService $rowService,
|
||||||
private readonly PurchaseRefundSummaryService $refundSummaryService,
|
private readonly PurchaseRefundSummaryService $refundSummaryService,
|
||||||
) {}
|
) {}
|
||||||
@@ -347,6 +349,13 @@ class AdminAppTicketService
|
|||||||
|
|
||||||
$this->applyStatusFilter($query, $filters['status'] ?? null);
|
$this->applyStatusFilter($query, $filters['status'] ?? null);
|
||||||
|
|
||||||
|
foreach ($this->attributeService->attributes($tenant) as $attribute) {
|
||||||
|
$value = $filters[$attribute['code']] ?? null;
|
||||||
|
if ($value !== null && $value !== '') {
|
||||||
|
$this->whereVariantDefinition($query, $attribute['code'], (string) $value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,15 +4,19 @@ namespace App\Shared\Forms\Services;
|
|||||||
|
|
||||||
use App\Domains\Core\Tenant\Models\Tenant;
|
use App\Domains\Core\Tenant\Models\Tenant;
|
||||||
use App\Domains\Ticketing\Ticket\Models\Ticket;
|
use App\Domains\Ticketing\Ticket\Models\Ticket;
|
||||||
|
use App\Domains\Ticketing\Ticket\Services\AdminAppTicketAttributeService;
|
||||||
use App\Domains\Ticketing\Ticket\Services\AdminAppTicketColumnService;
|
use App\Domains\Ticketing\Ticket\Services\AdminAppTicketColumnService;
|
||||||
|
|
||||||
class TicketFilterFormService
|
class TicketFilterFormService
|
||||||
{
|
{
|
||||||
private const FIESTA_FUTBOL_INFANTIL = 'fiesta_futbol_infantil';
|
private const FIESTA_FUTBOL_INFANTIL = 'fiesta_futbol_infantil';
|
||||||
|
|
||||||
|
private const DESFILE_PURA_TENDENCIA = 'desfile_pura_tendencia';
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly TicketFormService $ticketFormService,
|
private readonly TicketFormService $ticketFormService,
|
||||||
private readonly AdminAppTicketColumnService $columnService,
|
private readonly AdminAppTicketColumnService $columnService,
|
||||||
|
private readonly AdminAppTicketAttributeService $attributeService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
/** @return array<string, mixed> */
|
/** @return array<string, mixed> */
|
||||||
@@ -27,6 +31,13 @@ class TicketFilterFormService
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($tenant->codigo === self::DESFILE_PURA_TENDENCIA) {
|
||||||
|
$fields = [
|
||||||
|
...$this->desfileFields($tenant),
|
||||||
|
...$this->commonFields(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'code' => 'tickets_filter',
|
'code' => 'tickets_filter',
|
||||||
'action' => '/api/v1/adminapp/tenant/tickets',
|
'action' => '/api/v1/adminapp/tenant/tickets',
|
||||||
@@ -36,6 +47,21 @@ class TicketFilterFormService
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return list<array<string, mixed>> */
|
||||||
|
private function desfileFields(Tenant $tenant): array
|
||||||
|
{
|
||||||
|
return array_map(fn (array $attribute): array => [
|
||||||
|
'name' => $attribute['code'],
|
||||||
|
'query_param' => $attribute['code'],
|
||||||
|
'label' => $attribute['label'],
|
||||||
|
'type' => 'select',
|
||||||
|
'required' => false,
|
||||||
|
'default' => null,
|
||||||
|
'placeholder' => $attribute['label'],
|
||||||
|
'options' => $attribute['options'],
|
||||||
|
], $this->attributeService->attributes($tenant));
|
||||||
|
}
|
||||||
|
|
||||||
/** @return list<array<string, mixed>> */
|
/** @return list<array<string, mixed>> */
|
||||||
private function fiestaFutbolInfantilFields(Tenant $tenant): array
|
private function fiestaFutbolInfantilFields(Tenant $tenant): array
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ return new class extends Migration
|
|||||||
|
|
||||||
private const MANIFEST = 'data/mutual_smep_catalog_v1.json';
|
private const MANIFEST = 'data/mutual_smep_catalog_v1.json';
|
||||||
|
|
||||||
private const STORAGE_PREFIX = 'tenants/mutual_smep/catalog-v1/';
|
private const STORAGE_PREFIX = 'tenants/mutual_smep/catalog-v2/';
|
||||||
|
|
||||||
|
private const LEGACY_STORAGE_PREFIX = 'tenants/mutual_smep/catalog-v1/';
|
||||||
|
|
||||||
private const BRAND_MARKER = 'Provisioned by Mutual SMEP catalog migration v1.';
|
private const BRAND_MARKER = 'Provisioned by Mutual SMEP catalog migration v1.';
|
||||||
|
|
||||||
@@ -27,6 +29,8 @@ return new class extends Migration
|
|||||||
|
|
||||||
private const HIGHLIGHTED_GROUP_CODE = 'productos-destacados-smep';
|
private const HIGHLIGHTED_GROUP_CODE = 'productos-destacados-smep';
|
||||||
|
|
||||||
|
private const CATEGORY_FEATURED_ITEM_LIMIT = 6;
|
||||||
|
|
||||||
/** @var list<string> */
|
/** @var list<string> */
|
||||||
private const HIGHLIGHTED_PRODUCT_SLUGS = [
|
private const HIGHLIGHTED_PRODUCT_SLUGS = [
|
||||||
'acolchado-kavanagh-simil-plumon-reversible',
|
'acolchado-kavanagh-simil-plumon-reversible',
|
||||||
@@ -178,7 +182,9 @@ return new class extends Migration
|
|||||||
->values();
|
->values();
|
||||||
$storedPaths = DB::table('attachments')
|
$storedPaths = DB::table('attachments')
|
||||||
->whereIn('id', $attachmentIds)
|
->whereIn('id', $attachmentIds)
|
||||||
->where('path', 'like', self::STORAGE_PREFIX.'%')
|
->where(fn ($query) => $query
|
||||||
|
->where('path', 'like', self::STORAGE_PREFIX.'%')
|
||||||
|
->orWhere('path', 'like', self::LEGACY_STORAGE_PREFIX.'%'))
|
||||||
->pluck('path')
|
->pluck('path')
|
||||||
->all();
|
->all();
|
||||||
|
|
||||||
@@ -360,6 +366,7 @@ return new class extends Migration
|
|||||||
->where('categorias.categoria_id', $categoryId)
|
->where('categorias.categoria_id', $categoryId)
|
||||||
->orderBy('catalog_items.group_order')
|
->orderBy('catalog_items.group_order')
|
||||||
->orderBy('catalog_items.id')
|
->orderBy('catalog_items.id')
|
||||||
|
->limit(self::CATEGORY_FEATURED_ITEM_LIMIT)
|
||||||
->pluck('catalog_items.id');
|
->pluck('catalog_items.id');
|
||||||
|
|
||||||
foreach ($catalogItemIds as $itemOrder => $catalogItemId) {
|
foreach ($catalogItemIds as $itemOrder => $catalogItemId) {
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
private const TENANT_CODE = 'mutual_smep';
|
||||||
|
|
||||||
|
private const ITEM_LIMIT = 6;
|
||||||
|
|
||||||
|
/** @var array<string, string> */
|
||||||
|
private const GROUPS = [
|
||||||
|
'smep-dormitorio-y-blanco' => 'Dormitorio y Blanco',
|
||||||
|
'smep-electrodomesticos' => 'Electrodomésticos',
|
||||||
|
'smep-climatizacion' => 'Climatización',
|
||||||
|
'smep-tecnologia' => 'Tecnología',
|
||||||
|
'smep-bicicletas-y-aire-libre' => 'Bicicletas y Aire Libre',
|
||||||
|
'smep-bazar' => 'Bazar',
|
||||||
|
];
|
||||||
|
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
foreach (array_keys(self::GROUPS) as $code) {
|
||||||
|
$groupId = DB::table('featured_groups')
|
||||||
|
->where('tenant_code', self::TENANT_CODE)
|
||||||
|
->where('code', $code)
|
||||||
|
->value('id');
|
||||||
|
|
||||||
|
if ($groupId === null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$keptItemIds = DB::table('featured_items')
|
||||||
|
->where('featured_group_id', $groupId)
|
||||||
|
->orderBy('order')
|
||||||
|
->orderBy('id')
|
||||||
|
->limit(self::ITEM_LIMIT)
|
||||||
|
->pluck('id');
|
||||||
|
|
||||||
|
DB::table('featured_items')
|
||||||
|
->where('featured_group_id', $groupId)
|
||||||
|
->when(
|
||||||
|
$keptItemIds->isNotEmpty(),
|
||||||
|
fn ($query) => $query->whereNotIn('id', $keptItemIds),
|
||||||
|
)
|
||||||
|
->delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
foreach (self::GROUPS as $code => $parentCategoryName) {
|
||||||
|
$groupId = DB::table('featured_groups')
|
||||||
|
->where('tenant_code', self::TENANT_CODE)
|
||||||
|
->where('code', $code)
|
||||||
|
->value('id');
|
||||||
|
$parentCategoryId = DB::table('categorias')
|
||||||
|
->where('tenant_code', self::TENANT_CODE)
|
||||||
|
->whereNull('categoria_id')
|
||||||
|
->where('nombre', $parentCategoryName)
|
||||||
|
->value('id');
|
||||||
|
|
||||||
|
if ($groupId === null || $parentCategoryId === null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$catalogItemIds = DB::table('catalog_items')
|
||||||
|
->join('categorias', 'categorias.id', '=', 'catalog_items.category_id')
|
||||||
|
->where('catalog_items.tenant_code', self::TENANT_CODE)
|
||||||
|
->where('categorias.tenant_code', self::TENANT_CODE)
|
||||||
|
->where('categorias.categoria_id', $parentCategoryId)
|
||||||
|
->orderBy('catalog_items.group_order')
|
||||||
|
->orderBy('catalog_items.id')
|
||||||
|
->pluck('catalog_items.id');
|
||||||
|
|
||||||
|
DB::table('featured_items')->where('featured_group_id', $groupId)->delete();
|
||||||
|
|
||||||
|
foreach ($catalogItemIds as $order => $catalogItemId) {
|
||||||
|
DB::table('featured_items')->insert([
|
||||||
|
'featured_group_id' => $groupId,
|
||||||
|
'catalog_item_id' => $catalogItemId,
|
||||||
|
'order' => $order + 1,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
private const TENANT_CODE = 'mutual_smep';
|
||||||
|
|
||||||
|
private const LEGACY_PREFIX = 'tenants/mutual_smep/catalog-v1/';
|
||||||
|
|
||||||
|
private const OPTIMIZED_PREFIX = 'tenants/mutual_smep/catalog-v2/';
|
||||||
|
|
||||||
|
private const LOCAL_PREFIX = 'images/tennants/mutual_smep/catalog/';
|
||||||
|
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
$attachments = $this->attachments(self::LEGACY_PREFIX);
|
||||||
|
$uploadedPaths = [];
|
||||||
|
|
||||||
|
try {
|
||||||
|
foreach ($attachments as $attachment) {
|
||||||
|
$relativePath = Str::after($attachment->path, self::LEGACY_PREFIX);
|
||||||
|
$localPath = public_path(self::LOCAL_PREFIX.$relativePath);
|
||||||
|
|
||||||
|
if (! is_file($localPath)) {
|
||||||
|
throw new RuntimeException("Optimized catalog image not found: {$localPath}");
|
||||||
|
}
|
||||||
|
|
||||||
|
$contents = file_get_contents($localPath);
|
||||||
|
if ($contents === false) {
|
||||||
|
throw new RuntimeException("Optimized catalog image could not be read: {$localPath}");
|
||||||
|
}
|
||||||
|
|
||||||
|
$optimizedPath = self::OPTIMIZED_PREFIX.$relativePath;
|
||||||
|
if (! Storage::disk('s3')->put($optimizedPath, $contents)) {
|
||||||
|
throw new RuntimeException("Optimized catalog image could not be stored: {$optimizedPath}");
|
||||||
|
}
|
||||||
|
|
||||||
|
$uploadedPaths[] = $optimizedPath;
|
||||||
|
$attachment->optimized_path = $optimizedPath;
|
||||||
|
$attachment->optimized_size = strlen($contents);
|
||||||
|
}
|
||||||
|
|
||||||
|
DB::transaction(function () use ($attachments): void {
|
||||||
|
foreach ($attachments as $attachment) {
|
||||||
|
DB::table('attachments')->where('id', $attachment->id)->update([
|
||||||
|
'path' => $attachment->optimized_path,
|
||||||
|
'size' => $attachment->optimized_size,
|
||||||
|
'updated_at' => now(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Throwable $throwable) {
|
||||||
|
Storage::disk('s3')->delete($uploadedPaths);
|
||||||
|
|
||||||
|
throw $throwable;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
$attachments = $this->attachments(self::OPTIMIZED_PREFIX)
|
||||||
|
->filter(function (object $attachment): bool {
|
||||||
|
$relativePath = Str::after($attachment->path, self::OPTIMIZED_PREFIX);
|
||||||
|
$legacyPath = self::LEGACY_PREFIX.$relativePath;
|
||||||
|
|
||||||
|
if (! Storage::disk('s3')->exists($legacyPath)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$attachment->legacy_path = $legacyPath;
|
||||||
|
$attachment->legacy_size = Storage::disk('s3')->size($legacyPath);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
->values();
|
||||||
|
|
||||||
|
DB::transaction(function () use ($attachments): void {
|
||||||
|
foreach ($attachments as $attachment) {
|
||||||
|
DB::table('attachments')->where('id', $attachment->id)->update([
|
||||||
|
'path' => $attachment->legacy_path,
|
||||||
|
'size' => $attachment->legacy_size,
|
||||||
|
'updated_at' => now(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Storage::disk('s3')->delete($attachments->pluck('path')->all());
|
||||||
|
}
|
||||||
|
|
||||||
|
private function attachments(string $prefix): Collection
|
||||||
|
{
|
||||||
|
return DB::table('attachments')
|
||||||
|
->join(
|
||||||
|
'catalog_items_attachments',
|
||||||
|
'catalog_items_attachments.attachment_id',
|
||||||
|
'=',
|
||||||
|
'attachments.id',
|
||||||
|
)
|
||||||
|
->join('catalog_items', 'catalog_items.id', '=', 'catalog_items_attachments.catalog_item_id')
|
||||||
|
->where('catalog_items.tenant_code', self::TENANT_CODE)
|
||||||
|
->where('attachments.path', 'like', $prefix.'%')
|
||||||
|
->select('attachments.id', 'attachments.path', 'attachments.size')
|
||||||
|
->distinct()
|
||||||
|
->orderBy('attachments.id')
|
||||||
|
->get();
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
private const MENU_CODE = 'adminapp.tickets';
|
||||||
|
|
||||||
|
private const TENANT_CODE = 'desfile_pura_tendencia';
|
||||||
|
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
! DB::table('menues')->where('code', self::MENU_CODE)->exists()
|
||||||
|
|| ! DB::table('tenants')->where('codigo', self::TENANT_CODE)->exists()
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$now = now();
|
||||||
|
|
||||||
|
DB::table('tenants_menues')->updateOrInsert(
|
||||||
|
[
|
||||||
|
'tenant_code' => self::TENANT_CODE,
|
||||||
|
'menu_code' => self::MENU_CODE,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'static_content' => null,
|
||||||
|
'created_at' => $now,
|
||||||
|
'updated_at' => $now,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
DB::table('tenants_menues')
|
||||||
|
->where('tenant_code', self::TENANT_CODE)
|
||||||
|
->where('menu_code', self::MENU_CODE)
|
||||||
|
->delete();
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
const CATALOG_IMAGE_MAX_DIMENSION = 960;
|
||||||
|
const CATALOG_IMAGE_WEBP_QUALITY = 76;
|
||||||
|
|
||||||
$sourceRoot = 'C:\\Users\\ncoronel\\Documents\\catalogo_smep_limpio';
|
$sourceRoot = 'C:\\Users\\ncoronel\\Documents\\catalogo_smep_limpio';
|
||||||
$projectRoot = dirname(__DIR__, 2);
|
$projectRoot = dirname(__DIR__, 2);
|
||||||
$assetRoot = $projectRoot.'/public/images/tennants/mutual_smep/catalog';
|
$assetRoot = $projectRoot.'/public/images/tennants/mutual_smep/catalog';
|
||||||
@@ -153,7 +156,7 @@ function compressCatalogImage(string $source, string $destination): void
|
|||||||
|
|
||||||
$width = imagesx($sourceImage);
|
$width = imagesx($sourceImage);
|
||||||
$height = imagesy($sourceImage);
|
$height = imagesy($sourceImage);
|
||||||
$scale = min(1, 1200 / max($width, $height));
|
$scale = min(1, CATALOG_IMAGE_MAX_DIMENSION / max($width, $height));
|
||||||
$targetWidth = max(1, (int) round($width * $scale));
|
$targetWidth = max(1, (int) round($width * $scale));
|
||||||
$targetHeight = max(1, (int) round($height * $scale));
|
$targetHeight = max(1, (int) round($height * $scale));
|
||||||
$targetImage = imagecreatetruecolor($targetWidth, $targetHeight);
|
$targetImage = imagecreatetruecolor($targetWidth, $targetHeight);
|
||||||
@@ -181,7 +184,7 @@ function compressCatalogImage(string $source, string $destination): void
|
|||||||
throw new RuntimeException("Unable to create directory: {$destinationDirectory}");
|
throw new RuntimeException("Unable to create directory: {$destinationDirectory}");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! imagewebp($targetImage, $destination, 82)) {
|
if (! imagewebp($targetImage, $destination, CATALOG_IMAGE_WEBP_QUALITY)) {
|
||||||
throw new RuntimeException("Unable to write WebP image: {$destination}");
|
throw new RuntimeException("Unable to write WebP image: {$destination}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -298,8 +298,10 @@ class MenuSeeder extends Seeder
|
|||||||
'fiesta_futbol_infantil',
|
'fiesta_futbol_infantil',
|
||||||
'mutual_smep',
|
'mutual_smep',
|
||||||
];
|
];
|
||||||
$fiestaCategoryMenuCodes = [
|
$ticketAdminMenuCodes = [
|
||||||
'adminapp.tickets',
|
'adminapp.tickets',
|
||||||
|
];
|
||||||
|
$fiestaCategoryMenuCodes = [
|
||||||
'adminapp.fiesta-futbol-infantil.entradas',
|
'adminapp.fiesta-futbol-infantil.entradas',
|
||||||
'adminapp.fiesta-futbol-infantil.alojamientos',
|
'adminapp.fiesta-futbol-infantil.alojamientos',
|
||||||
'adminapp.fiesta-futbol-infantil.merchandising',
|
'adminapp.fiesta-futbol-infantil.merchandising',
|
||||||
@@ -416,6 +418,10 @@ class MenuSeeder extends Seeder
|
|||||||
$menuCodes = array_diff($menuCodes, $helpMenuCodes);
|
$menuCodes = array_diff($menuCodes, $helpMenuCodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! in_array($tenant->codigo, ['fiesta_futbol_infantil', 'desfile_pura_tendencia'], true)) {
|
||||||
|
$menuCodes = array_diff($menuCodes, $ticketAdminMenuCodes);
|
||||||
|
}
|
||||||
|
|
||||||
if ($tenant->codigo !== 'fiesta_futbol_infantil') {
|
if ($tenant->codigo !== 'fiesta_futbol_infantil') {
|
||||||
$menuCodes = array_diff($menuCodes, $fiestaCategoryMenuCodes);
|
$menuCodes = array_diff($menuCodes, $fiestaCategoryMenuCodes);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ Para facilitar futuras incorporaciones, también quedaron preparadas opciones ha
|
|||||||
|
|
||||||
### Imágenes optimizadas
|
### Imágenes optimizadas
|
||||||
|
|
||||||
Se incorporaron **511 imágenes de productos**. Fueron optimizadas para reducir su peso aproximado de 30 MB a 14,3 MB, sin modificar el contenido de las fotografías. Esto ayuda a que la tienda cargue más rápido y consuma menos datos móviles.
|
Se incorporaron **511 imágenes de productos**. Fueron optimizadas para reducir su peso aproximado de 30 MB a 9,2 MB, sin modificar el contenido de las fotografías. Esto ayuda a que la tienda cargue más rápido y consuma menos datos móviles.
|
||||||
|
|
||||||
### Existencias iniciales
|
### Existencias iniciales
|
||||||
|
|
||||||
@@ -177,14 +177,14 @@ También se crearon seis filas adicionales, una por cada categoría principal:
|
|||||||
|
|
||||||
| Sección | Productos incluidos |
|
| Sección | Productos incluidos |
|
||||||
|---|---:|
|
|---|---:|
|
||||||
| Dormitorio y Blanco | 24 |
|
| Dormitorio y Blanco | 6 |
|
||||||
| Electrodomésticos | 53 |
|
| Electrodomésticos | 6 |
|
||||||
| Climatización | 16 |
|
| Climatización | 6 |
|
||||||
| Tecnología | 36 |
|
| Tecnología | 6 |
|
||||||
| Bicicletas y Aire Libre | 10 |
|
| Bicicletas y Aire Libre | 6 |
|
||||||
| Bazar | 3 |
|
| Bazar | 3 |
|
||||||
|
|
||||||
Los **142 productos** aparecen dentro de la sección que les corresponde. Algunos también se repiten en “Productos destacados” de manera intencional, porque esa primera fila funciona como vidriera y no como una categoría adicional.
|
Estas filas funcionan como una vidriera breve: muestran una selección de cada rubro sin sobrecargar la portada. Los **142 productos** continúan disponibles mediante las categorías, subcategorías y el buscador. Algunos artículos también se repiten en “Productos destacados” de manera intencional.
|
||||||
|
|
||||||
## 7. Principales mejoras para los clientes
|
## 7. Principales mejoras para los clientes
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 20 KiB |