feat: add optional modelName field to Article

Adds model_name VARCHAR(255) column to app.articles, exposes it in the
admin CRUD form (optional, hidden on index), and adds translations for
both EN and DE.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Simon Kuehn 2026-05-18 10:06:36 +00:00
parent 6e17fb82a0
commit c10c306a5a
5 changed files with 42 additions and 0 deletions

View file

@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260520030000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add model_name column to app.articles';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE app.articles ADD COLUMN model_name VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE app.articles DROP COLUMN model_name');
}
}

View file

@ -51,6 +51,9 @@ class Article
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $modelNumber = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $modelName = null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $ebayListingId = null;
@ -242,6 +245,16 @@ class Article
$this->modelNumber = $modelNumber;
}
public function getModelName(): ?string
{
return $this->modelName;
}
public function setModelName(?string $modelName): void
{
$this->modelName = $modelName;
}
public function setEbayListingId(?string $id): void
{
$this->ebayListingId = $id;

View file

@ -115,6 +115,7 @@ final class ArticleCrudController extends AbstractCrudController
)->hideOnIndex();
yield TextField::new('manufacturer', new TranslatableMessage('field.manufacturer', [], 'admin'))->setRequired(false)->hideOnIndex();
yield TextField::new('modelNumber', new TranslatableMessage('field.model_number', [], 'admin'))->setRequired(false)->hideOnIndex();
yield TextField::new('modelName', new TranslatableMessage('field.model_name', [], 'admin'))->setRequired(false)->hideOnIndex();
yield TextField::new('sku')->hideOnForm()->hideOnIndex();
yield TextField::new('serialNumber', new TranslatableMessage('field.serial_number', [], 'admin'))->setRequired(false)->hideOnIndex();
yield TextField::new('conditionNotes', new TranslatableMessage('field.condition_notes', [], 'admin'))->setRequired(false)->hideOnIndex();

View file

@ -61,6 +61,7 @@ field.price: Preis
field.condition: Zustand
field.manufacturer: Hersteller
field.model_number: 'Modellnr.'
field.model_name: 'Modellname'
field.serial_number: 'Seriennr.'
field.condition_notes: Zustandshinweise
field.description: Beschreibung

View file

@ -61,6 +61,7 @@ field.price: Price
field.condition: Condition
field.manufacturer: Manufacturer
field.model_number: 'Model #'
field.model_name: 'Model Name'
field.serial_number: 'Serial #'
field.condition_notes: 'Condition Notes'
field.description: Description