feat: Introduce source type for featured groups; add category association and implement FeaturedGroupService for item sourcing

This commit is contained in:
2026-08-04 13:17:00 -03:00
parent 8aa3a26ee7
commit 84e45bb964
13 changed files with 260 additions and 136 deletions

View File

@@ -0,0 +1,31 @@
<?php
use App\Domains\Catalog\Enums\FeaturedGroupSource;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('featured_groups', function (Blueprint $table): void {
$table->enum('source_type', FeaturedGroupSource::values())
->default(FeaturedGroupSource::Manual->value)
->after('tenant_code');
$table->foreignId('category_id')
->nullable()
->after('source_type')
->constrained('categorias')
->nullOnDelete();
});
}
public function down(): void
{
Schema::table('featured_groups', function (Blueprint $table): void {
$table->dropConstrainedForeignId('category_id');
$table->dropColumn('source_type');
});
}
};