Commit 75ccaa9a authored by Mahmoud Aglan's avatar Mahmoud Aglan

feat(facilities): seed swimming pool lane pricing (25m/50m)

Adds lane rental pricing for the Olympic pool per the official pricing table:
- 25m lane: 500-1400 EGP (max 8 players) by entity type
- 50m lane: 800-1700 EGP (max 12 players) by entity type
Entity types: schools/gov, clubs/federations, other entities, foreign entities
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 37d6c445
<?php
declare(strict_types=1);
use App\Core\Database;
return function (Database $db): void {
$now = date('Y-m-d H:i:s');
$effectiveFrom = '2025-09-01';
$facilityNameAr = 'حمام السباحة الأوليمبي';
// Lane pricing data from official pricing table
// Format: [entity_type, time_period, price_25m, max_25m, price_50m, max_50m]
$lanes = [
['schools_gov', 'morning', 500, 8, 800, 12],
['schools_gov', 'evening', 500, 8, 800, 12],
['clubs_federations','morning', 800, 8, 1000, 12],
['clubs_federations','evening', 800, 8, 1000, 12],
['other_entities', 'morning', 1000, 8, 1200, 12],
['other_entities', 'evening', 1000, 8, 1200, 12],
['foreign_entities', 'morning', 1400, 8, 1700, 12],
['foreign_entities', 'evening', 1400, 8, 1700, 12],
];
foreach ($lanes as $row) {
[$entityType, $timePeriod, $price25, $max25, $price50, $max50] = $row;
// 25m lane
$existing = $db->selectOne(
"SELECT id FROM sa_rental_entity_pricing
WHERE facility_type = 'pool_lane_25m' AND entity_type = ? AND time_period = ?",
[$entityType, $timePeriod]
);
if (!$existing) {
$db->insert('sa_rental_entity_pricing', [
'facility_type' => 'pool_lane_25m',
'facility_name_ar'=> $facilityNameAr . ' — حارة 25 متر',
'entity_type' => $entityType,
'usage_type' => 'practice',
'time_period' => $timePeriod,
'duration_minutes'=> 60,
'price_amount' => $price25,
'max_players' => $max25,
'notes_ar' => 'أقصى عدد ' . $max25 . ' لاعبين',
'is_active' => 1,
'effective_from' => $effectiveFrom,
'created_at' => $now,
'updated_at' => $now,
]);
}
// 50m lane
$existing = $db->selectOne(
"SELECT id FROM sa_rental_entity_pricing
WHERE facility_type = 'pool_lane_50m' AND entity_type = ? AND time_period = ?",
[$entityType, $timePeriod]
);
if (!$existing) {
$db->insert('sa_rental_entity_pricing', [
'facility_type' => 'pool_lane_50m',
'facility_name_ar'=> $facilityNameAr . ' — حارة 50 متر',
'entity_type' => $entityType,
'usage_type' => 'practice',
'time_period' => $timePeriod,
'duration_minutes'=> 60,
'price_amount' => $price50,
'max_players' => $max50,
'notes_ar' => 'أقصى عدد ' . $max50 . ' لاعبين',
'is_active' => 1,
'effective_from' => $effectiveFrom,
'created_at' => $now,
'updated_at' => $now,
]);
}
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment