Fix pricing scope and venue_type filter in reservation pricing lookup
فشلت بعض الفحوصات
Deploy Backend / deploy (push) Has been cancelled

هذا الالتزام موجود في:
Abdul Kareem
2026-02-20 17:29:26 +03:00
الأصل 966956727e
التزام cc11f2e063

عرض الملف

@@ -396,7 +396,10 @@ class ReservationController extends Controller
private function getPricingRule(?Venue $venue): ?PricingRule private function getPricingRule(?Venue $venue): ?PricingRule
{ {
if (! $venue) { if (! $venue) {
return PricingRule::where('scope', 'global_type')->where('is_active', true)->latest('id')->first(); return PricingRule::where('scope', 'global_type')
->where('is_active', true)
->latest('id')
->first();
} }
$venueRule = PricingRule::where('scope', 'venue') $venueRule = PricingRule::where('scope', 'venue')
@@ -410,7 +413,7 @@ class ReservationController extends Controller
} }
$typeRule = PricingRule::where('scope', 'global_type') $typeRule = PricingRule::where('scope', 'global_type')
->where('venue_type', $venue->type) ->where('venue_type', (string) $venue->type)
->where('is_active', true) ->where('is_active', true)
->latest('id') ->latest('id')
->first(); ->first();
@@ -419,7 +422,10 @@ class ReservationController extends Controller
return $typeRule; return $typeRule;
} }
return PricingRule::where('scope', 'global_type')->where('is_active', true)->latest('id')->first(); return PricingRule::where('scope', 'global_type')
->where('is_active', true)
->latest('id')
->first();
} }
private function findAvailableTable(Reservation $reservation, bool $includePending, bool $lockRows = false): ?VenueTable private function findAvailableTable(Reservation $reservation, bool $includePending, bool $lockRows = false): ?VenueTable