Warenwirtschaft: AP-24 Chargen-Nr.-Praefix auf Produktebene

- products.batch_prefix (z. B. TP1) mit Eingabefeld in der Warenwirtschaft-Card
- Product::suggestedBatchNumber(): Praefix + Produktionsdatum ttmmjj
  (TP1 + 15.06.26 => TP1150626), Vorbelegung in der Produktion folgt mit AP-28
- Repository trimmt, leeres Praefix => null

Tests: BatchPrefixTest (6 gruen), volle Suite 184 gruen, 657 Assertions

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-07-06 12:09:41 +00:00
parent 97d420c98a
commit 209ea467eb
6 changed files with 136 additions and 4 deletions

View file

@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* AP-24: Chargen-Nr.-Präfix auf Produktebene (Kategorie-Kürzel + Produkt-Nr.,
* z. B. „TP1"). Die Produktion schlägt daraus Präfix + Produktionsdatum
* (ttmmjj) als Chargen-Nr. vor, z. B. TP1150626.
*/
public function up(): void
{
Schema::table('products', function (Blueprint $table) {
$table->string('batch_prefix', 20)->nullable()->after('show_in_product_stock');
});
}
public function down(): void
{
Schema::table('products', function (Blueprint $table) {
$table->dropColumn('batch_prefix');
});
}
};