User-Panel-Restarbeiten: PM-Guard, Profil-Rework, USt-ID-Prüfung, Buchungspflicht-Adresse
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
036a53499f
commit
afcca34f91
25 changed files with 905 additions and 140 deletions
|
|
@ -14,6 +14,9 @@ class BillingAddress extends Model
|
|||
'user_id',
|
||||
'salutation_key',
|
||||
'title',
|
||||
'company',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'name',
|
||||
'address1',
|
||||
'address2',
|
||||
|
|
@ -27,4 +30,17 @@ class BillingAddress extends Model
|
|||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ist die Adresse vollständig genug für eine Rechnung bzw. Buchung?
|
||||
* Maßgeblich: Empfänger (Name), Straße, PLZ, Ort und Land.
|
||||
*/
|
||||
public function isComplete(): bool
|
||||
{
|
||||
return filled($this->name)
|
||||
&& filled($this->address1)
|
||||
&& filled($this->postal_code)
|
||||
&& filled($this->city)
|
||||
&& filled($this->country_code);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ class InvoiceBillingAddress extends Model
|
|||
protected $fillable = [
|
||||
'salutation_key',
|
||||
'title',
|
||||
'company',
|
||||
'name',
|
||||
'address1',
|
||||
'address2',
|
||||
|
|
|
|||
|
|
@ -105,6 +105,15 @@ class User extends Authenticatable
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Buchungs-Voraussetzung (Entscheidung 12.06.2026): Tarif- und
|
||||
* Einzel-PM-Checkouts erfordern eine vollständige Rechnungsadresse.
|
||||
*/
|
||||
public function hasCompleteBillingAddress(): bool
|
||||
{
|
||||
return (bool) $this->billingAddress?->isComplete();
|
||||
}
|
||||
|
||||
/**
|
||||
* Der Tarif des aktiven Stripe-Abos, aufgelöst über die in `plans`
|
||||
* gepflegten Stripe-Preis-IDs. Null ohne (gültiges) Abo.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue