removed all references to credits. now credits are completely replaced by addons.

This commit is contained in:
Codex Agent
2025-12-01 15:50:17 +01:00
parent b8e515a03c
commit 28539754a7
76 changed files with 97 additions and 2533 deletions

View File

@@ -8,7 +8,6 @@ use App\Jobs\Packages\SendEventPackageGuestLimitNotification;
use App\Jobs\Packages\SendEventPackageGuestThresholdWarning;
use App\Jobs\Packages\SendEventPackagePhotoLimitNotification;
use App\Jobs\Packages\SendEventPackagePhotoThresholdWarning;
use App\Jobs\Packages\SendTenantCreditsLowNotification;
use App\Jobs\Packages\SendTenantPackageEventLimitNotification;
use App\Jobs\Packages\SendTenantPackageEventThresholdWarning;
use App\Jobs\Packages\SendTenantPackageExpiredNotification;
@@ -16,7 +15,6 @@ use App\Jobs\Packages\SendTenantPackageExpiringNotification;
use App\Models\TenantNotificationLog;
use Illuminate\Console\Command;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Log;
class RetryTenantNotification extends Command
{
@@ -78,7 +76,6 @@ class RetryTenantNotification extends Command
'guest_limit' => $this->dispatchGuestLimit($context),
'gallery_warning' => $this->dispatchGalleryWarning($context),
'gallery_expired' => $this->dispatchGalleryExpired($context),
'credits_low' => $this->dispatchCreditsLow($log->tenant_id, $context),
'event_threshold' => $this->dispatchEventThreshold($context),
'event_limit' => $this->dispatchEventLimit($context),
'package_expiring' => $this->dispatchPackageExpiring($context),
@@ -174,23 +171,6 @@ class RetryTenantNotification extends Command
return true;
}
private function dispatchCreditsLow(int $tenantId, array $context): bool
{
$balance = Arr::get($context, 'balance');
$threshold = Arr::get($context, 'threshold');
if ($balance === null || $threshold === null) {
Log::warning('credits_low retry missing balance or threshold', compact('tenantId', 'context'));
}
$balance = $balance !== null ? (int) $balance : 0;
$threshold = $threshold !== null ? (int) $threshold : 0;
SendTenantCreditsLowNotification::dispatch($tenantId, $balance, $threshold);
return true;
}
private function dispatchEventThreshold(array $context): bool
{
$tenantPackageId = Arr::get($context, 'tenant_package_id');