T1neu: Unternehmer-Pflicht-Checkbox im Checkout, protokolliert mit AGB-Version
B2B-Gate (AGB v0.6 par. 1 Abs. 4): Das Buchungs-Modal verlangt vor jedem Stripe-Checkout die Bestaetigung 'Ich bestelle in Ausuebung meiner gewerblichen oder selbstaendigen beruflichen Taetigkeit (par. 14 BGB)'. - booking_confirmations: user, Buchungstyp/-ref, AGB-Version, IP, confirmed_at (Nachweis laut Datenschutz Abschnitt 7) - Checkout-Link erscheint erst nach der Checkbox; CheckoutController verlangt zusaetzlich serverseitig eine zeitnahe Bestaetigung (30 Min.) fuer Abo/Einzel-PM/Credit-Topup — Direktaufrufe laufen ins Leere - config/legal.php als zentrale AGB-Versionsquelle (Seite + Protokoll, Uebergangsloesung bis zum legal_documents-System E3) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
6438444a80
commit
6f9a68b63d
9 changed files with 311 additions and 7 deletions
51
app/Models/BookingConfirmation.php
Normal file
51
app/Models/BookingConfirmation.php
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* Protokollierte Unternehmer-Bestätigung vor einem Stripe-Checkout
|
||||
* (T1neu, AGB v0.6 § 1 Abs. 4): Nachweis, dass der Kunde bei der Buchung
|
||||
* bestätigt hat, als Unternehmer zu handeln — samt akzeptierter AGB-Version.
|
||||
*/
|
||||
class BookingConfirmation extends Model
|
||||
{
|
||||
/**
|
||||
* Gültigkeitsfenster: Der Checkout muss zeitnah nach der Bestätigung
|
||||
* starten, sonst wird sie erneut verlangt (Direktaufrufe der
|
||||
* Checkout-Routen ohne Modal-Bestätigung laufen so ins Leere).
|
||||
*/
|
||||
public const VALID_MINUTES = 30;
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'booking_type',
|
||||
'booking_ref',
|
||||
'interval',
|
||||
'agb_version',
|
||||
'ip',
|
||||
'confirmed_at',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'confirmed_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function scopeRecentFor(Builder $query, User $user): Builder
|
||||
{
|
||||
return $query
|
||||
->where('user_id', $user->id)
|
||||
->where('confirmed_at', '>=', now()->subMinutes(self::VALID_MINUTES));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue