Merge branch 'feature/reserved_invitations' into dev
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use App\Domains\Desfile\Services\InvitationPurchaseProvisioner;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
app(InvitationPurchaseProvisioner::class)->provision();
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
// Intentionally irreversible: issued invitation tickets may already be used.
|
||||
}
|
||||
};
|
||||
@@ -12,6 +12,7 @@ use App\Domains\Catalog\Models\CatalogItem;
|
||||
use App\Domains\Catalog\Models\FeaturedGroup;
|
||||
use App\Domains\Catalog\Services\CatalogService;
|
||||
use App\Domains\Client\Models\Client;
|
||||
use App\Domains\Desfile\Services\InvitationPurchaseProvisioner;
|
||||
use App\Domains\Tenant\Models\Tenant;
|
||||
use App\Domains\Tenant\Services\TenantService;
|
||||
use Illuminate\Database\Seeder;
|
||||
@@ -28,6 +29,7 @@ class DesfilePuraTendenciaSeeder extends Seeder
|
||||
public function __construct(
|
||||
private readonly TenantService $tenantService,
|
||||
private readonly CatalogService $catalogService,
|
||||
private readonly InvitationPurchaseProvisioner $invitationPurchaseProvisioner,
|
||||
) {}
|
||||
|
||||
public function run(): void
|
||||
@@ -41,15 +43,15 @@ class DesfilePuraTendenciaSeeder extends Seeder
|
||||
|
||||
if ($tenant) {
|
||||
$tenant->update(['client_id' => $client->id]);
|
||||
|
||||
return;
|
||||
} else {
|
||||
DB::transaction(function () use ($client): void {
|
||||
$this->createTenant($client);
|
||||
$this->createEventDate();
|
||||
$this->createEntryCatalog();
|
||||
});
|
||||
}
|
||||
|
||||
DB::transaction(function () use ($client): void {
|
||||
$this->createTenant($client);
|
||||
$this->createEventDate();
|
||||
$this->createEntryCatalog();
|
||||
});
|
||||
$this->invitationPurchaseProvisioner->provision();
|
||||
}
|
||||
|
||||
private function createTenant(Client $client): void
|
||||
|
||||
Reference in New Issue
Block a user