implemented event package addons with filament resource, event-admin purchase path and notifications, showing up in purchase history
This commit is contained in:
@@ -77,7 +77,7 @@ class PackageLimitEvaluator
|
||||
];
|
||||
}
|
||||
|
||||
$maxPhotos = $eventPackage->package->max_photos;
|
||||
$maxPhotos = $eventPackage->effectivePhotoLimit();
|
||||
|
||||
if ($maxPhotos === null) {
|
||||
return null;
|
||||
@@ -115,17 +115,17 @@ class PackageLimitEvaluator
|
||||
|
||||
public function summarizeEventPackage(EventPackage $eventPackage): array
|
||||
{
|
||||
$package = $eventPackage->package;
|
||||
$limits = $eventPackage->effectiveLimits();
|
||||
|
||||
$photoSummary = $this->buildUsageSummary(
|
||||
(int) $eventPackage->used_photos,
|
||||
$package?->max_photos,
|
||||
$limits['max_photos'],
|
||||
config('package-limits.photo_thresholds', [])
|
||||
);
|
||||
|
||||
$guestSummary = $this->buildUsageSummary(
|
||||
(int) $eventPackage->used_guests,
|
||||
$package?->max_guests,
|
||||
$limits['max_guests'],
|
||||
config('package-limits.guest_thresholds', [])
|
||||
);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class PackageUsageTracker
|
||||
|
||||
public function recordPhotoUsage(EventPackage $eventPackage, int $previousUsed, int $delta = 1): void
|
||||
{
|
||||
$limit = $eventPackage->package?->max_photos;
|
||||
$limit = $eventPackage->effectivePhotoLimit();
|
||||
|
||||
if ($limit === null || $limit <= 0) {
|
||||
return;
|
||||
@@ -51,7 +51,7 @@ class PackageUsageTracker
|
||||
|
||||
public function recordGuestUsage(EventPackage $eventPackage, int $previousUsed, int $delta = 1): void
|
||||
{
|
||||
$limit = $eventPackage->package?->max_guests;
|
||||
$limit = $eventPackage->effectiveGuestLimit();
|
||||
|
||||
if ($limit === null || $limit <= 0) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user