feat(seeder): add FiestaTradicionArrufoSeeder to tenant provisioning and update OnTicketTenantSeeder for image validation
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Domains\Commerce\Catalog\Enums\InventoryPolicy;
|
||||
use App\Domains\Commerce\Catalog\Models\CatalogItem;
|
||||
use App\Domains\Commerce\Catalog\Models\Attribute;
|
||||
use App\Domains\Commerce\Catalog\Models\CatalogItem;
|
||||
use App\Domains\Commerce\Catalog\Services\CatalogService;
|
||||
use App\Domains\Core\Tenant\Models\Tenant;
|
||||
use App\Domains\Ticketing\Event\Models\Event;
|
||||
@@ -13,6 +13,7 @@ use App\Shared\Enums\FieldType;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use RuntimeException;
|
||||
|
||||
class FiestaTradicionArrufoSeeder extends Seeder
|
||||
@@ -51,7 +52,8 @@ class FiestaTradicionArrufoSeeder extends Seeder
|
||||
'location' => 'Predio de Doma del Club Unión Deportiva Arrufó',
|
||||
]);
|
||||
|
||||
if ($event->attachment_id === null) {
|
||||
$eventImage = $event->attachment;
|
||||
if ($eventImage === null || ! Storage::disk('s3')->exists($eventImage->path)) {
|
||||
$event->update(['attachment_id' => $this->attachments->store($this->image(), 'events')->id]);
|
||||
}
|
||||
|
||||
@@ -85,6 +87,7 @@ class FiestaTradicionArrufoSeeder extends Seeder
|
||||
$existing = CatalogItem::query()->where('tenant_code', $tenant->codigo)->where('slug', $data['slug'])->first();
|
||||
if ($existing !== null) {
|
||||
$existing->update(['sales_end_at' => $data['sales_end_at'] ?? null]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user