feat: استيراد كود سيرو إلى تريبز (سيرو @ecfe7568) — بلا تعديل
قرار المالك 2026-07-27: باك إند سيرو PHP هو المعتمد، وتطبيقاته المجرّبة ميدانياً تحل محل إعادة البناء المؤرشفة. سيرو نفسه لم يُمسّ. الخريطة: backend · payment_server · loction_server · ride_server · passenger_server · docker · dashboard · stress_test → الجذر siro_rider → apps/rider siro_driver → apps/driver siro_admin → dashboards/admin siro_service → dashboards/service android_bot → apps/android_bot socialBot → apps/socialBot نُسخ المتعقَّب في git سيرو فقط عبر `git archive` (3,198 ملفاً / ~169 م.ب) لا `cp -r` — فاستُثنيت مخلفات البناء تلقائياً. بلا أي تعديل محتوى عمداً: كل ما يلي يصير فرقاً مقروءاً مقابل المصدر. لم يُستورد وسببه: siromove.com (الموقع التسويقي يبقى marketing/ في تريبز، سيرو فيه 8 ملفات) · docs و planning (تريبز له docs/ الخاص) · deploy.sh (ليس نشراً على سيرفر بل `git add . && git push origin --all` — فخّ في مستودع آخر) · transit_dashboard (بانتظار قرار مصير backend-transit و dashboards/transit-web). ⚠️ لا يبني بعد — ثلاثة نواقص متوقعة ومقصودة: 1. `.env` و `lib/env/env.g.dart` غير متعقَّبين في سيرو (أسرار لكل مستأجر): كل تطبيق فلاتر يحتاج .env خاصاً ثم توليد env.g.dart بـ build_runner. 2. إعدادات Firebase (9 ملفات google-services.json و GoogleService-Info.plist) يستبعدها .gitignore تريبز — ولكل مستأجر مشروع Firebase خاص أصلاً. 3. apps/driver في سيرو يشير إلى `../../Intaleq/packages/get` خارج المستودع → يجب ضمّ الحزم داخله أسوة بـ apps/rider. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
9909d9b4c1
commit
4d8414c96b
@@ -0,0 +1,112 @@
|
||||
// في ملف: constant/country_polygons.dart
|
||||
|
||||
import 'package:intaleq_maps/intaleq_maps.dart';
|
||||
|
||||
class CountryPolygons {
|
||||
// ==========================================================
|
||||
// 1. الأردن: عمان، الزرقاء، إربد، السلط ومساحة كبيرة داخل الأردن
|
||||
// ==========================================================
|
||||
static final List<LatLng> jordanBoundary = [
|
||||
const LatLng(32.70, 35.80), // شمال إربد
|
||||
const LatLng(32.35, 36.30), // المفرق
|
||||
const LatLng(32.10, 36.30), // الزرقاء
|
||||
const LatLng(31.85, 36.20), // شرق عمان
|
||||
const LatLng(31.50, 36.00), // مادبا
|
||||
const LatLng(30.80, 35.80), // الكرك / الطفيلة
|
||||
const LatLng(30.20, 35.60), // معان
|
||||
const LatLng(29.50, 35.00), // العقبة
|
||||
const LatLng(29.50, 34.90), // الحدود الغربية للعقبة
|
||||
const LatLng(30.50, 35.20), // وادي عربة
|
||||
const LatLng(31.50, 35.50), // البحر الميت
|
||||
const LatLng(32.05, 35.60), // السلط
|
||||
const LatLng(32.70, 35.60), // غرب إربد
|
||||
];
|
||||
|
||||
// ==========================================================
|
||||
// 2. سوريا: دمشق، ريف دمشق، حمص، حلب، اللاذقية (استثناء الصحراء)
|
||||
// ==========================================================
|
||||
static final List<LatLng> syriaBoundary = [
|
||||
const LatLng(32.60, 36.00), // درعا
|
||||
const LatLng(32.70, 36.60), // السويداء
|
||||
const LatLng(33.50, 36.50), // ريف دمشق الشرقي
|
||||
const LatLng(34.10, 36.80), // النبك
|
||||
const LatLng(34.70, 36.80), // حمص
|
||||
const LatLng(35.10, 36.80), // حماة
|
||||
const LatLng(36.20, 37.30), // حلب الشرقية
|
||||
const LatLng(36.60, 37.00), // شمال حلب
|
||||
const LatLng(36.00, 36.00), // إدلب / الجبال
|
||||
const LatLng(35.70, 35.80), // اللاذقية
|
||||
const LatLng(34.80, 35.80), // طرطوس
|
||||
const LatLng(34.50, 36.20), // تلكلخ
|
||||
const LatLng(33.50, 36.00), // دمشق الغربية
|
||||
];
|
||||
|
||||
// ==========================================================
|
||||
// 3. مصر: القاهرة كاملة، الإسكندرية، ومراكز المحافظات
|
||||
// ==========================================================
|
||||
static final List<LatLng> egyptBoundary = [
|
||||
const LatLng(29.50, 30.80), // جنوب الفيوم
|
||||
const LatLng(29.80, 31.40), // شرق القاهرة الكبرى
|
||||
const LatLng(30.10, 31.80), // العاشر من رمضان
|
||||
const LatLng(30.60, 32.30), // الإسماعيلية
|
||||
const LatLng(31.30, 31.80), // بورسعيد
|
||||
const LatLng(31.50, 31.25), // دمياط
|
||||
const LatLng(31.30, 29.80), // الإسكندرية
|
||||
const LatLng(30.80, 29.80), // وادي النطرون
|
||||
const LatLng(30.00, 30.80), // 6 أكتوبر / غرب القاهرة
|
||||
];
|
||||
|
||||
/// دالة للتحقق مما إذا كان الموقع ضمن نطاق الخدمة المدعوم
|
||||
static bool isServiceSupported(LatLng? point) {
|
||||
if (point == null) return false;
|
||||
if (_isPointInPolygon(point, jordanBoundary)) return true;
|
||||
if (_isPointInPolygon(point, syriaBoundary)) return true;
|
||||
if (_isPointInPolygon(point, egyptBoundary)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// دالة تُرجع رابط API بناءً على اسم الدولة
|
||||
static String getRoutingApiUrl(String countryName) {
|
||||
switch (countryName) {
|
||||
case 'Jordan':
|
||||
return 'https://routec.intaleq.xyz/route-jo';
|
||||
case 'Syria':
|
||||
return 'https://routec.intaleq.xyz/route';
|
||||
case 'Egypt':
|
||||
return 'https://routec.intaleq.xyz/route-eg';
|
||||
default:
|
||||
// الافتراضي في حالة لم يقع الموقع ضمن أي من المضلعات
|
||||
return 'https://routec.intaleq.xyz/route';
|
||||
}
|
||||
}
|
||||
|
||||
/// دالة تحدد اسم الدولة (باللغة الإنجليزية للـ API) بناءً على الإحداثيات
|
||||
static String getCountryName(LatLng? point) {
|
||||
if (point == null) return "unsupported";
|
||||
|
||||
if (_isPointInPolygon(point, jordanBoundary)) return "Jordan";
|
||||
if (_isPointInPolygon(point, syriaBoundary)) return "Syria";
|
||||
if (_isPointInPolygon(point, egyptBoundary)) return "Egypt";
|
||||
|
||||
return "unsupported";
|
||||
}
|
||||
|
||||
/// خوارزمية Ray Casting للتحقق من وقوع نقطة داخل مضلع
|
||||
static bool _isPointInPolygon(LatLng p, List<LatLng> polygon) {
|
||||
bool isInside = false;
|
||||
int j = polygon.length - 1;
|
||||
for (int i = 0; i < polygon.length; i++) {
|
||||
if (((polygon[i].latitude > p.latitude) !=
|
||||
(polygon[j].latitude > p.latitude)) &&
|
||||
(p.longitude <
|
||||
(polygon[j].longitude - polygon[i].longitude) *
|
||||
(p.latitude - polygon[i].latitude) /
|
||||
(polygon[j].latitude - polygon[i].latitude) +
|
||||
polygon[i].longitude)) {
|
||||
isInside = !isInside;
|
||||
}
|
||||
j = i;
|
||||
}
|
||||
return isInside;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user