Fuehre Regeln fuer freie Artikel und Fuer dich im Mitgliederbereich ein
CI Feature / test (push) Successful in 5m24s
Deploy Test / test (push) Successful in 5m56s
Deploy Test / deploy (push) Successful in 32s

- Regel je Angebot auf Abruf: alle Mitglieder, nur freigeschaltete Konten, wer einen Artikel besitzt
- Freigaben je Angebot und Konto (offer_releases), nie geloescht, nur entzogen; Pflege im Angebot
- Pruefung serverseitig in GrantIssuer::claim; Angebote bei Registrierung bleiben regelfrei
- Mitgliederseite Angebote: Neu fuer dich (neue Staende besessener Artikel), Zum Uebernehmen, Shop
- Migration 2026_12_01_110000, ADR-56, DEPLOYMENT.md

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-26 08:22:43 +01:00
1 parent 61c65595e1
commit 95a888d1ca
14 files changed
+1045 -33

No files matched your search

@@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Regeln für freie Artikel (ADR-56), rein ergänzend: Wer ein Angebot „auf Abruf“ übernehmen darf (alle Mitglieder,
* freigeschaltete Konten oder wer einen bestimmten Artikel besitzt) und die Freigaben je Konto. Freigaben werden nie
* gelöscht, nur entzogen; ein Angebot oder Konto mit Freigaben lässt sich nicht löschen (restrict).
*/
return new class extends Migration
{
public function up(): void
{
Schema::table('offers', function (Blueprint $table): void {
$table->string('claim_access', 20)->default('alle');
$table->foreignId('claim_requires_article_id')->nullable()->constrained('license_articles')->restrictOnDelete();
});
Schema::create('offer_releases', function (Blueprint $table): void {
$table->id();
$table->foreignId('offer_id')->constrained('offers')->restrictOnDelete();
$table->foreignId('user_id')->constrained('users')->restrictOnDelete();
$table->foreignId('granted_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamp('granted_at');
$table->timestamp('valid_until')->nullable();
$table->foreignId('revoked_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamp('revoked_at')->nullable();
$table->text('reason')->nullable();
$table->timestamps();
$table->index(['offer_id', 'user_id']);
});
}
public function down(): void
{
Schema::dropIfExists('offer_releases');
Schema::table('offers', function (Blueprint $table): void {
$table->dropConstrainedForeignId('claim_requires_article_id');
$table->dropColumn('claim_access');
});
}
};