mivita/app/Models/UserAboCardChange.php
Kevin 671022a28d Abo: Kreditkarte aktualisieren (CRM, Portal, Berater-Link) + Admin-Abo-Löschung
- Karten-Update ohne Abbuchung via PAYONE creditcardcheck/pseudocardpan
  (AboPaymentMethodService, CardUpdateResult/CreditCardCheckData-DTOs)
- Eingabe nur durch Abo-Inhaber: CRM- und Portal-Formular + zeitlich
  begrenzter Berater→Kunde-Link (AboCardUpdateLink + Mail)
- Änderungshistorie in user_abo_card_changes, Anzeige im Admin-Abo-Detail
- Admin: Abo löschen (destroy) inkl. Test
- Portal-Fix: myOrderCreate wirft 404 statt TypeError bei ungültiger ID
- VIP-Sichtbarkeitstests für Einmalartikel-Fenster ergänzt
- Enthält bereits die Freeze-Guards für den Stripe-Notbetrieb (Folge-Commit)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 15:56:19 +00:00

38 lines
878 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Carbon;
/**
* Audit entry for a credit-card token change on an Abo: when it was changed,
* the masked card, and from which context (portal/crm/link). Holds no PAN/CVC.
*
* @property int $user_abo_id
* @property string|null $masked_card
* @property string|null $source
* @property Carbon|null $created_at
*/
class UserAboCardChange extends Model
{
public const UPDATED_AT = null;
protected $table = 'user_abo_card_changes';
protected $fillable = [
'user_abo_id',
'masked_card',
'source',
];
protected $casts = [
'created_at' => 'datetime',
];
public function user_abo(): BelongsTo
{
return $this->belongsTo(UserAbo::class, 'user_abo_id');
}
}