coupon code system eingeführt. coupons werden vom super admin gemanaged. coupons werden mit paddle synchronisiert und dort validiert. plus: einige mobil-optimierungen im tenant admin pwa.

This commit is contained in:
Codex Agent
2025-11-09 20:26:50 +01:00
parent f3c44be76d
commit 082b78cd43
80 changed files with 4855 additions and 435 deletions

View File

@@ -58,10 +58,13 @@ class CheckoutSession extends Model
'package_snapshot' => 'array',
'status_history' => 'array',
'provider_metadata' => 'array',
'coupon_snapshot' => 'array',
'discount_breakdown' => 'array',
'expires_at' => 'datetime',
'completed_at' => 'datetime',
'amount_subtotal' => 'decimal:2',
'amount_total' => 'decimal:2',
'amount_discount' => 'decimal:2',
];
/**
@@ -71,6 +74,8 @@ class CheckoutSession extends Model
'status_history' => '[]',
'package_snapshot' => '[]',
'provider_metadata' => '[]',
'coupon_snapshot' => '[]',
'discount_breakdown' => '[]',
];
public function user(): BelongsTo
@@ -88,6 +93,11 @@ class CheckoutSession extends Model
return $this->belongsTo(Package::class)->withTrashed();
}
public function coupon(): BelongsTo
{
return $this->belongsTo(Coupon::class);
}
public function scopeActive($query)
{
return $query->whereNotIn('status', [