feat(catalog): add event_id to catalog items and backfill existing records
This commit is contained in:
@@ -51,6 +51,15 @@ class DesfilePuraTendenciaSeeder extends Seeder
|
||||
});
|
||||
}
|
||||
|
||||
$activeEventId = DB::table('tenants')
|
||||
->where('codigo', self::TENANT_CODE)
|
||||
->value('active_event_id');
|
||||
if ($activeEventId !== null) {
|
||||
DB::table('catalog_items')
|
||||
->where('tenant_code', self::TENANT_CODE)
|
||||
->update(['event_id' => $activeEventId]);
|
||||
}
|
||||
|
||||
$this->invitationPurchaseProvisioner->provision();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ use App\Domains\Core\Tenant\Models\Tenant;
|
||||
use App\Domains\Ticketing\Ticket\Enums\ValidityTimeType;
|
||||
use App\Domains\Ticketing\Ticket\Models\ValidityTime;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use RuntimeException;
|
||||
|
||||
class FiestaFutbolInfantilProductSeeder extends Seeder
|
||||
@@ -173,6 +174,12 @@ class FiestaFutbolInfantilProductSeeder extends Seeder
|
||||
'group_name' => 'Productos',
|
||||
'group_order' => 0,
|
||||
]);
|
||||
|
||||
if ($tenant->active_event_id !== null) {
|
||||
DB::table('catalog_items')
|
||||
->where('tenant_code', $tenant->codigo)
|
||||
->update(['event_id' => $tenant->active_event_id]);
|
||||
}
|
||||
}
|
||||
|
||||
private function deleteExistingCatalog(Tenant $tenant): void
|
||||
|
||||
Reference in New Issue
Block a user