Merge branch 'fix/correcciones_secundarias' into dev

This commit is contained in:
2026-08-05 10:28:59 -03:00
7 changed files with 75 additions and 25 deletions

View File

@@ -95,25 +95,7 @@ class Variant extends Model
public function getName(): string
{
$name = $this->catalogItem->nombre;
$this->loadMissing(['definitions.itemAttribute.attribute', 'eventDate']);
$definitions = $this->definitions
->map(function (VariantDefinition $definition): ?string {
$attributeName = $definition->itemAttribute?->attribute?->nombre;
return $attributeName
? "{$attributeName}: {$definition->value}"
: $definition->value;
})
->filter();
if ($this->eventDate !== null) {
$definitions->push('Fecha: '.$this->eventDate->date->format('Y-m-d'));
}
$description = $definitions->implode(', ');
return $description === '' ? $name : "{$name} ({$description})";
return $this->catalogItem->nombre;
}
public function getMinimumUseDate(): ?CarbonInterface