geschenkgutscheine implementiert ("Paket verschenken"). Neuer Upload-Provider: Sparkbooth.

This commit is contained in:
Codex Agent
2025-12-07 16:54:58 +01:00
parent 3f3c0f1d35
commit 046e2fe3ec
50 changed files with 2422 additions and 130 deletions

View File

@@ -0,0 +1,53 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('gift_vouchers', function (Blueprint $table) {
$table->id();
$table->string('code', 64)->unique();
$table->decimal('amount', 10, 2);
$table->char('currency', 3)->default('EUR');
$table->string('status', 32)->default('issued');
$table->string('purchaser_email')->nullable();
$table->string('recipient_email')->nullable();
$table->string('recipient_name')->nullable();
$table->string('message', 500)->nullable();
$table->string('paddle_transaction_id')->nullable()->unique();
$table->string('paddle_checkout_id')->nullable()->unique();
$table->string('paddle_price_id')->nullable();
$table->foreignIdFor(\App\Models\Coupon::class)->nullable()->constrained()->nullOnDelete();
$table->timestamp('expires_at')->nullable();
$table->timestamp('redeemed_at')->nullable();
$table->timestamp('refunded_at')->nullable();
$table->json('metadata')->nullable();
$table->timestamps();
$table->softDeletes();
$table->index(['status', 'expires_at']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('gift_vouchers');
}
};

View File

@@ -0,0 +1,59 @@
<?php
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('events', function (Blueprint $table) {
$table->string('photobooth_mode', 16)
->default('ftp')
->after('photobooth_enabled');
$table->string('sparkbooth_username', 32)
->nullable()
->after('photobooth_path');
$table->text('sparkbooth_password_encrypted')
->nullable()
->after('sparkbooth_username');
$table->timestamp('sparkbooth_expires_at')
->nullable()
->after('sparkbooth_password_encrypted');
$table->string('sparkbooth_status', 32)
->default('inactive')
->after('sparkbooth_expires_at');
$table->timestamp('sparkbooth_last_upload_at')
->nullable()
->after('sparkbooth_status');
$table->unsignedInteger('sparkbooth_uploads_last_24h')
->default(0)
->after('sparkbooth_last_upload_at');
$table->unsignedBigInteger('sparkbooth_uploads_total')
->default(0)
->after('sparkbooth_uploads_last_24h');
$table->unique('sparkbooth_username');
});
}
public function down(): void
{
Schema::table('events', function (Blueprint $table) {
$table->dropUnique(['sparkbooth_username']);
$table->dropColumn([
'photobooth_mode',
'sparkbooth_username',
'sparkbooth_password_encrypted',
'sparkbooth_expires_at',
'sparkbooth_status',
'sparkbooth_last_upload_at',
'sparkbooth_uploads_last_24h',
'sparkbooth_uploads_total',
]);
});
}
};