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:
parent
6e17fb82a0
commit
c10c306a5a
5 changed files with 42 additions and 0 deletions
26
migrations/Version20260520030000.php
Normal file
26
migrations/Version20260520030000.php
Normal 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');
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue