Files
Hamza-AyedandClaude Opus 5 4d8414c96b 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>
2026-07-27 05:14:13 +03:00

165 lines
4.6 KiB
Dart

// transit_models.dart — نماذج بيانات مواصلاتي (جهة الراكب)
class TransitOrg {
final int id;
final String type;
final String nameAr;
final String nameEn;
final String? logoUrl;
final String city;
TransitOrg({
required this.id,
required this.type,
required this.nameAr,
required this.nameEn,
required this.city,
this.logoUrl,
});
factory TransitOrg.fromJson(Map<String, dynamic> j) => TransitOrg(
id: int.tryParse(j['id'].toString()) ?? 0,
type: j['type']?.toString() ?? '',
nameAr: j['name_ar']?.toString() ?? '',
nameEn: j['name_en']?.toString() ?? '',
city: j['city']?.toString() ?? '',
logoUrl: j['logo_url']?.toString(),
);
}
class TransitEnrollment {
final int id;
final int orgId;
final String orgName;
final String status; // pending | active | suspended | expired
final String verifyMethod;
TransitEnrollment({
required this.id,
required this.orgId,
required this.orgName,
required this.status,
required this.verifyMethod,
});
factory TransitEnrollment.fromActivateResponse(
Map<String, dynamic> j, int orgId) =>
TransitEnrollment(
id: int.tryParse(j['enrollment_id'].toString()) ?? 0,
orgId: orgId,
orgName: j['org_name']?.toString() ?? '',
status: j['status']?.toString() ?? 'pending',
verifyMethod: j['verify_method']?.toString() ?? '',
);
}
class TransitStop {
final int id;
final int sequence;
final String nameAr;
final double lat;
final double lng;
final int etaOffsetMin;
final bool isMajor;
TransitStop({
required this.id,
required this.sequence,
required this.nameAr,
required this.lat,
required this.lng,
required this.etaOffsetMin,
required this.isMajor,
});
factory TransitStop.fromJson(Map<String, dynamic> j) => TransitStop(
id: int.tryParse(j['id'].toString()) ?? 0,
sequence: int.tryParse(j['sequence'].toString()) ?? 0,
nameAr: j['name_ar']?.toString() ?? '',
lat: double.tryParse(j['latitude']?.toString() ?? '0') ?? 0,
lng: double.tryParse(j['longitude']?.toString() ?? '0') ?? 0,
etaOffsetMin: int.tryParse(j['eta_offset_min']?.toString() ?? '0') ?? 0,
isMajor: (j['is_major']?.toString() ?? '0') == '1',
);
}
class TransitRouteSummary {
final int id;
final String nameAr;
final String status;
final int stopCount;
TransitRouteSummary({
required this.id,
required this.nameAr,
required this.status,
required this.stopCount,
});
factory TransitRouteSummary.fromJson(Map<String, dynamic> j) =>
TransitRouteSummary(
id: int.tryParse(j['id'].toString()) ?? 0,
nameAr: j['name_ar']?.toString() ?? '',
status: j['status']?.toString() ?? '',
stopCount: int.tryParse(j['stop_count']?.toString() ?? '0') ?? 0,
);
}
class TransitLiveTrip {
final int id;
final String status;
final int delayMinutes;
final int? currentStopSeq;
final String routeName;
final String? departureTime;
final String? driverName;
TransitLiveTrip({
required this.id,
required this.status,
required this.delayMinutes,
required this.routeName,
this.currentStopSeq,
this.departureTime,
this.driverName,
});
factory TransitLiveTrip.fromJson(Map<String, dynamic> j) => TransitLiveTrip(
id: int.tryParse(j['id'].toString()) ?? 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(),
driverName: j['driver_name']?.toString(),
);
}
class BusPosition {
final double lat;
final double lng;
final double heading;
final double speed;
final int? currentStopSeq;
BusPosition({
required this.lat,
required this.lng,
this.heading = 0,
this.speed = 0,
this.currentStopSeq,
});
factory BusPosition.fromJson(Map<dynamic, dynamic> j) => BusPosition(
lat: double.tryParse(j['lat']?.toString() ?? '0') ?? 0,
lng: double.tryParse(j['lng']?.toString() ?? '0') ?? 0,
heading: double.tryParse(j['heading']?.toString() ?? '0') ?? 0,
speed: double.tryParse(j['speed']?.toString() ?? '0') ?? 0,
currentStopSeq: j['current_stop_seq'] == null
? null
: int.tryParse(j['current_stop_seq'].toString()),
);
}