feat(apps): الدراور وطبقتا الميزات والإشعارات — المرحلة 6
## طبقتا الميزات مُطبَّقتان معاً
AppDrawer يفحص: Features.wallet && context.tenantHas('wallet')
- Features.x ثابت const: يقرّر ما يُبنى في الـbinary. إطفاؤه يحذف الكود
فلا يُستخرج (docs/23 §5)
- tenantHas من GET /tenant/config/:slug: يقرّر ما يُعرض ممّا بُني حسب اشتراك
المستأجر (docs/38 §10)
هذا هو ربط lite/pro/max عملياً. TenantCubit يعرض النسخة المخزّنة فوراً ثم
يحدّثها: إقلاع بلا إنترنت يعرض الميزات المعروفة آخر مرة لا شاشة فارغة.
## الشاشات
الدراور · تعديل الحساب · سجلّ الرحلات · الإعدادات (مظهر + لغة) · المساعدة.
الرقم في تعديل الحساب معطّل مع سبب معروض لا مخفي: هو هوية الحساب على الخادم
وتغييره يعني حساباً آخر (docs/38 §1).
## الإشعارات
PushService معزول — الملف الوحيد الذي يعرف Firebase. التسجيل بعد إثبات
الجلسة عبر خطّاف في SessionCubit، ومع اشتراك onTokenRefresh: بدونه تتوقّف
الإشعارات بصمت بعد أسابيع. الإعداد الأصلي كان جاهزاً مسبقاً.
## تصحيحات بنيوية كشفها فحص آلي
docs/23 §1 يمنع أن تستورد ميزة من أخرى — وكانت خمس مخالفات:
1. features/history أُدمجت في features/trip — السجلّ جزء من ميزة الرحلة
2. AppDrawer صعد إلى core/ui — هيكل تطبيق لا ميزة
3. AuthFailure → core/api/api_failure.dart، ومترجمه → core/ui/failure_text.dart
4. AuthHeader → core/ui/form_header.dart
5. ProfileRepository مستقلّ عن AuthRepository: تعديل الملف ليس مصادقة
flutter analyze نظيف · الراكب 98 ملف/7,497 سطر · السائق 95 ملف/6,931 سطر.
فحوص آلية نظيفة: صفر استيراد بين ميزتين · core يستورد features من di و
router وحدهما · Firebase و intaleq_maps و geolocator و socket_io كلٌّ معزول.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
66e28acc58
commit
096acae74e
@@ -0,0 +1,19 @@
|
||||
import '../../../core/api/api_client.dart';
|
||||
|
||||
import 'models/trip.dart';
|
||||
|
||||
/// سجلّ الرحلات. لا يستورد ميزة الرحلة كمنطق — يعيد استعمال نموذجها فقط،
|
||||
/// وهو الشكل الذي يرجّعه الخادم نفسه لكلا النقطتين.
|
||||
class HistoryRepository {
|
||||
HistoryRepository(this._api);
|
||||
|
||||
final ApiClient _api;
|
||||
|
||||
Future<List<Trip>> trips() async {
|
||||
final res = await _api.get<List<dynamic>>('/trips/mine');
|
||||
return res
|
||||
.whereType<Map<String, dynamic>>()
|
||||
.map(Trip.fromJson)
|
||||
.toList(growable: false);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
import '../../../core/api/antlaq_api.dart';
|
||||
|
||||
import 'models/geo_point.dart';
|
||||
|
||||
import 'models/place.dart';
|
||||
|
||||
import 'models/route_info.dart';
|
||||
|
||||
/// كل الخرائط من map-saas مباشرة (قرار 2026-07-20). نقاط `/maps/*` في باك إند
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import '../../../core/api/api_client.dart';
|
||||
|
||||
import 'models/fare_quote.dart';
|
||||
|
||||
import 'models/geo_point.dart';
|
||||
|
||||
import 'models/ride_type.dart';
|
||||
|
||||
import 'models/trip.dart';
|
||||
|
||||
class TripRepository {
|
||||
|
||||
Reference in New Issue
Block a user