Öffne Katalog, Bibliothek und Testkauf für den MVP.
Deploy Test / test (push) Successful in 12s
Deploy Test / deploy (push) Successful in 21s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-11-15 09:04:08 +01:00
1 parent 463851d402
commit fd6860efda
51 files changed
+2331 -31

No files matched your search

@@ -0,0 +1,71 @@
<?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::create('manual_grants', function (Blueprint $table) {
$table->id();
$table->foreignId('actor_id')->constrained('users')->restrictOnDelete();
$table->foreignId('party_id')->constrained()->restrictOnDelete();
$table->foreignId('offer_id')->constrained()->restrictOnDelete();
$table->text('reason');
$table->timestamps();
});
Schema::create('orders', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->restrictOnDelete();
$table->foreignId('party_id')->constrained()->restrictOnDelete();
$table->string('status');
$table->string('holder_kind');
$table->timestamps();
});
Schema::create('order_lines', function (Blueprint $table) {
$table->id();
$table->foreignId('order_id')->constrained()->cascadeOnDelete();
$table->foreignId('offer_version_id')->constrained()->restrictOnDelete();
$table->unsignedInteger('price_cents');
$table->string('term_rule');
$table->string('update_promise');
$table->string('holder_kind');
$table->timestamps();
$table->unique(['order_id', 'offer_version_id']);
});
Schema::create('order_scope_items', function (Blueprint $table) {
$table->id();
$table->foreignId('order_line_id')->constrained()->cascadeOnDelete();
$table->foreignId('license_article_id')->constrained()->restrictOnDelete();
$table->foreignId('rights_profile_version_id')->constrained()->restrictOnDelete();
$table->json('rights_snapshot');
$table->timestamps();
$table->unique(['order_line_id', 'license_article_id', 'rights_profile_version_id'], 'order_scope_unique');
});
Schema::create('payments', function (Blueprint $table) {
$table->id();
$table->foreignId('order_id')->constrained()->cascadeOnDelete();
$table->string('provider');
$table->string('status');
$table->string('provider_reference')->unique();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('payments');
Schema::dropIfExists('order_scope_items');
Schema::dropIfExists('order_lines');
Schema::dropIfExists('orders');
Schema::dropIfExists('manual_grants');
}
};