chore: أرشفة تطبيقات ولوحات تريبز التي سيحلّ محلها كود سيرو

استكمال قرار 2026-07-27 (كوميت fff76c9 أرشف الباك إند):
  apps/rider          → apps/rider-archive-cubit
  apps/driver         → apps/driver-archive-cubit
  dashboards/admin-web    → dashboards/admin-web-archive
  dashboards/service-web  → dashboards/service-web-archive

إعادة تسمية بلا تعديل محتوى. rider/driver كانا إعادة بناء Cubit مبنية على
عقد NestJS المؤرشف. admin-web و service-web نموذجان بملف HTML واحد (164 و
128 سطراً) — يحلّ محلهما siro_admin و siro_service المكتملان.

يُحمل من المؤرشف ولا يُعاد اكتشافه: عقد map-saas المثبَّت بالتجربة في
apps/rider-archive-cubit/lib/core/api/ (x-api-key ترويسة، reverse مصفوفة،
route في points) ودرس مسار FCM.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Hamza-Ayed
2026-07-27 05:12:04 +03:00
co-authored by Claude Opus 5
parent fff76c949f
commit 9909d9b4c1
809 changed files with 0 additions and 0 deletions
@@ -0,0 +1,51 @@
class DialPlan {
final String callingCode;
final int nationalLength;
const DialPlan({required this.callingCode, required this.nationalLength});
}
/// أداة تطبيع رقم الهاتف لصيغة دولية موحدة (مطابقة للباك إند PhoneService).
class PhoneNormalizer {
static const Map<String, DialPlan> dialPlans = {
'JO': DialPlan(callingCode: '962', nationalLength: 9),
'SY': DialPlan(callingCode: '963', nationalLength: 9),
'EG': DialPlan(callingCode: '20', nationalLength: 10),
'SA': DialPlan(callingCode: '966', nationalLength: 9),
'AE': DialPlan(callingCode: '971', nationalLength: 9),
'IQ': DialPlan(callingCode: '964', nationalLength: 10),
};
/// يرجع الرقم في صيغة موحّدة (مثل 962791234567 أو +962791234567 حسب الحاجة).
static String normalize(String rawNumber, {String isoCode = 'JO', bool withPlus = true}) {
final countryKey = isoCode.toUpperCase();
final plan = dialPlans[countryKey] ?? const DialPlan(callingCode: '962', nationalLength: 9);
// إزالة كل الرموز باستثناء الأرقام
var digits = rawNumber.replaceAll(RegExp(r'\D'), '');
if (digits.isEmpty) return rawNumber;
// إزالة البادئة الدولية "00" إن وجدت
if (digits.startsWith('00')) {
digits = digits.substring(2);
}
String resultDigits = digits;
// 1) الرقم مكتوب بالفعل بمفتاح الدولة كلياً
if (digits.startsWith(plan.callingCode) &&
digits.length == plan.callingCode.length + plan.nationalLength) {
resultDigits = digits;
}
// 2) رقم محلي يبدأ بصفر (مثل 0791234567)
else if (digits.startsWith('0') && digits.length == plan.nationalLength + 1) {
resultDigits = plan.callingCode + digits.substring(1);
}
// 3) رقم محلي محذوف منه الصفر البادئ (مثل 791234567)
else if (digits.length == plan.nationalLength) {
resultDigits = plan.callingCode + digits;
}
return withPlus ? '+$resultDigits' : resultDigits;
}
}