Recht: Kuendigungsbutton nach Par. 312k BGB - Backend + Admin-Queue
Oeffentliche Bestaetigungsseite /de/kuendigung ohne Login: Art der Kuendigung (Grund nur bei ausserordentlich), Zuordnungsdaten, Beendigungszeitpunkt; Honeypot + Rate-Limit wie beim Widerruf. Sofortige automatische Zugangsbestaetigung per E-Mail (Par. 312k Abs. 4 BGB) + Betreiber-Mail. Kuendigungen laufen in der Recht-&-Compliance-Queue unter den Widerrufen auf (K-Vorgaenge, eigener Filter, Erledigt/Wieder-oeffnen, vierte KPI-Karte). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
239ec571bc
commit
1c3a52ae3c
12 changed files with 826 additions and 2 deletions
60
app/Models/TerminationRequest.php
Normal file
60
app/Models/TerminationRequest.php
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Database\Factories\TerminationRequestFactory;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Online-Kündigung über den gesetzlichen Kündigungsbutton (§ 312k BGB, ohne
|
||||
* Login). `kind` = ordentlich|ausserordentlich (Grund nur bei außerordentlich),
|
||||
* `terminate_at` NULL = zum nächstmöglichen Zeitpunkt.
|
||||
*/
|
||||
class TerminationRequest extends Model
|
||||
{
|
||||
/** @use HasFactory<TerminationRequestFactory> */
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'kind',
|
||||
'reason',
|
||||
'name',
|
||||
'email',
|
||||
'contract_reference',
|
||||
'terminate_at',
|
||||
'host',
|
||||
'requester_ip',
|
||||
'status',
|
||||
'resolved_at',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'terminate_at' => 'date',
|
||||
'resolved_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function scopeOpen(Builder $query): Builder
|
||||
{
|
||||
return $query->where('status', 'open');
|
||||
}
|
||||
|
||||
public function isExtraordinary(): bool
|
||||
{
|
||||
return $this->kind === 'ausserordentlich';
|
||||
}
|
||||
|
||||
public function kindLabel(): string
|
||||
{
|
||||
return $this->isExtraordinary() ? 'Außerordentliche Kündigung' : 'Ordentliche Kündigung';
|
||||
}
|
||||
|
||||
public function terminateAtLabel(): string
|
||||
{
|
||||
return $this->terminate_at?->format('d.m.Y') ?? 'zum nächstmöglichen Zeitpunkt';
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue