feat(inventory): add InventorySubject enum and integrate into catalog item management

This commit is contained in:
2026-08-12 14:42:30 -03:00
parent 5b089e71b2
commit 8e94cf7856
13 changed files with 280 additions and 6 deletions

View File

@@ -0,0 +1,31 @@
<?php
use App\Domains\Catalog\Enums\InventorySubject;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('catalog_items', function (Blueprint $table): void {
$table->enum('inventory_subject', InventorySubject::values())
->default(InventorySubject::Product->value)
->after('inventory_policy');
});
DB::table('catalog_items')
->where('tenant_code', 'desfile_pura_tendencia')
->where('slug', 'entrada')
->update(['inventory_subject' => InventorySubject::Seat->value]);
}
public function down(): void
{
Schema::table('catalog_items', function (Blueprint $table): void {
$table->dropColumn('inventory_subject');
});
}
};