Files
Hamza-AyedandClaude Opus 5 0aab85c732 refactor: إعادة تسمية التطبيقات الأربعة siro_* → intaleq_*
المجلدات وأسماء حزم dart واستيراداتها:
  siro_rider → intaleq_rider    siro_driver  → intaleq_driver
  siro_admin → intaleq_admin    siro_service → intaleq_service

شمل ذلك `name:` في كل pubspec وكل `package:siro_*` في الاستيرادات
(115 ملفاً في rider وحده)، وإشارات أسماء المجلدات في docs/ وتعليق في
backend/Admin/notifications/broadcast.php. لم تبقَ إشارة واحدة (تحقّقت).

+ ضُمّت حزم get و get_storage داخل intaleq_driver/packages/ وحُوّلت
مساراتها الثلاثة من `../../Intaleq/packages/*` إلى `./packages/*`. كانت
تُحل عرضاً إلى مجلد App/Intaleq القديم المجاور — تبعية خارج المستودع
تنكسر بأول نقل. لم يبقَ في أي تطبيق تبعية مسار خارج الشجرة.

⚠️ لم تُمسّ بعد: هويات المتاجر (applicationId · PRODUCT_BUNDLE_IDENTIFIER ·
shorebird app_id) ولا الألوان ولا النصوص المرئية ولا النطاقات — كل منها
كوميت منفصل، والهويات تحتاج قرار المالك.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 16:10:58 +03:00

82 lines
2.7 KiB
Dart

// transit_driver_models.dart — نماذج بيانات مواصلاتي (جهة سائق الباص)
class TransitStopInfo {
final int id;
final int sequence;
final String nameAr;
final double latitude;
final double longitude;
final double geofenceRadius; // متر
final int? etaOffsetMin;
TransitStopInfo({
required this.id,
required this.sequence,
required this.nameAr,
required this.latitude,
required this.longitude,
this.geofenceRadius = 150,
this.etaOffsetMin,
});
factory TransitStopInfo.fromJson(Map<String, dynamic> j) => TransitStopInfo(
id: int.tryParse(j['id']?.toString() ?? '0') ?? 0,
sequence: int.tryParse(j['sequence'].toString()) ?? 0,
nameAr: j['name_ar']?.toString() ?? '',
latitude: double.tryParse(j['latitude']?.toString() ?? '0') ?? 0,
longitude: double.tryParse(j['longitude']?.toString() ?? '0') ?? 0,
geofenceRadius: double.tryParse(j['geofence_radius']?.toString() ?? '150') ?? 150,
etaOffsetMin: j['eta_offset_min'] == null
? null
: int.tryParse(j['eta_offset_min'].toString()),
);
}
// alias للتوافق مع كود الجيوفينس
typedef TransitStop = TransitStopInfo;
class TransitDriverTrip {
final int id;
final int routeId;
final String status; // scheduled | started | completed | cancelled | no_show
final int delayMinutes;
final int? currentStopSeq;
final String routeName;
final String? departureTime;
final String? vehiclePlate;
final int? capacity;
final List<TransitStopInfo> stops;
TransitDriverTrip({
required this.id,
required this.routeId,
required this.status,
required this.delayMinutes,
required this.routeName,
this.currentStopSeq,
this.departureTime,
this.vehiclePlate,
this.capacity,
this.stops = const [],
});
factory TransitDriverTrip.fromJson(Map<String, dynamic> j) => TransitDriverTrip(
id: int.tryParse(j['id'].toString()) ?? 0,
routeId: int.tryParse(j['route_id']?.toString() ?? '0') ?? 0,
status: j['status']?.toString() ?? '',
delayMinutes: int.tryParse(j['delay_minutes']?.toString() ?? '0') ?? 0,
currentStopSeq: j['current_stop_seq'] == null
? null
: int.tryParse(j['current_stop_seq'].toString()),
routeName: j['route_name']?.toString() ?? '',
departureTime: j['departure_time']?.toString(),
vehiclePlate: j['vehicle_plate']?.toString(),
capacity: j['capacity'] == null ? null : int.tryParse(j['capacity'].toString()),
stops: (j['stops'] is List)
? (j['stops'] as List)
.map((s) => TransitStopInfo.fromJson(Map<String, dynamic>.from(s)))
.toList()
: const [],
);
}