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:
co-authored by
Claude Opus 5
parent
fff76c949f
commit
9909d9b4c1
@@ -0,0 +1,33 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// نموذج رسالة الدردشة — من `GET /chat/:tripId/messages` و`POST /chat/:tripId/send`.
|
||||
class ChatMessageModel extends Equatable {
|
||||
final String id;
|
||||
final String tripId;
|
||||
final String senderId;
|
||||
final String text;
|
||||
final DateTime createdAt;
|
||||
final bool isMe;
|
||||
|
||||
const ChatMessageModel({
|
||||
required this.id,
|
||||
required this.tripId,
|
||||
required this.senderId,
|
||||
required this.text,
|
||||
required this.createdAt,
|
||||
required this.isMe,
|
||||
});
|
||||
|
||||
factory ChatMessageModel.fromJson(Map<String, dynamic> j, {String? currentUserId}) =>
|
||||
ChatMessageModel(
|
||||
id: j['id'] as String,
|
||||
tripId: (j['tripId'] ?? '') as String,
|
||||
senderId: j['senderId'] as String,
|
||||
text: j['text'] as String,
|
||||
createdAt: DateTime.parse(j['createdAt'] as String),
|
||||
isMe: j['senderId'] == currentUserId,
|
||||
);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, tripId, senderId, text, createdAt];
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
/// نموذج الرحلة من وجهة نظر السائق — من `GET /trips/available` وتحديثات WebSocket.
|
||||
class DriverTripModel extends Equatable {
|
||||
final String id;
|
||||
final String status;
|
||||
final String? clientId;
|
||||
final String? clientName;
|
||||
final String? clientPhone;
|
||||
final double pickupLat;
|
||||
final double pickupLng;
|
||||
final String? pickupAddress;
|
||||
final double dropoffLat;
|
||||
final double dropoffLng;
|
||||
final String? dropoffAddress;
|
||||
final String vehicleClass;
|
||||
final num? fare;
|
||||
final String? currency;
|
||||
final String? paymentMethod;
|
||||
final DateTime? createdAt;
|
||||
final DateTime? updatedAt;
|
||||
|
||||
const DriverTripModel({
|
||||
required this.id,
|
||||
required this.status,
|
||||
this.clientId,
|
||||
this.clientName,
|
||||
this.clientPhone,
|
||||
required this.pickupLat,
|
||||
required this.pickupLng,
|
||||
this.pickupAddress,
|
||||
required this.dropoffLat,
|
||||
required this.dropoffLng,
|
||||
this.dropoffAddress,
|
||||
required this.vehicleClass,
|
||||
this.fare,
|
||||
this.currency,
|
||||
this.paymentMethod,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
});
|
||||
|
||||
factory DriverTripModel.fromJson(Map<String, dynamic> j) => DriverTripModel(
|
||||
id: j['id'] as String,
|
||||
status: j['status'] as String,
|
||||
clientId: j['clientId'] as String?,
|
||||
clientName: j['clientName'] as String?,
|
||||
clientPhone: j['clientPhone'] as String?,
|
||||
pickupLat: (j['pickup']?['lat'] ?? j['pickupLat'] ?? 0).toDouble(),
|
||||
pickupLng: (j['pickup']?['lng'] ?? j['pickupLng'] ?? 0).toDouble(),
|
||||
pickupAddress: (j['pickup']?['address'] ?? j['pickupAddress']) as String?,
|
||||
dropoffLat: (j['dropoff']?['lat'] ?? j['dropoffLat'] ?? 0).toDouble(),
|
||||
dropoffLng: (j['dropoff']?['lng'] ?? j['dropoffLng'] ?? 0).toDouble(),
|
||||
dropoffAddress: (j['dropoff']?['address'] ?? j['dropoffAddress']) as String?,
|
||||
vehicleClass: (j['vehicleClass'] ?? '') as String,
|
||||
fare: (j['fare'] as num?),
|
||||
currency: j['currency'] as String?,
|
||||
paymentMethod: j['paymentMethod'] as String?,
|
||||
createdAt: j['createdAt'] != null ? DateTime.tryParse(j['createdAt'] as String) : null,
|
||||
updatedAt: j['updatedAt'] != null ? DateTime.tryParse(j['updatedAt'] as String) : null,
|
||||
);
|
||||
|
||||
DriverTripModel copyWith({
|
||||
String? status,
|
||||
String? clientName,
|
||||
String? clientPhone,
|
||||
num? fare,
|
||||
String? currency,
|
||||
}) {
|
||||
return DriverTripModel(
|
||||
id: id,
|
||||
status: status ?? this.status,
|
||||
clientId: clientId,
|
||||
clientName: clientName ?? this.clientName,
|
||||
clientPhone: clientPhone ?? this.clientPhone,
|
||||
pickupLat: pickupLat,
|
||||
pickupLng: pickupLng,
|
||||
pickupAddress: pickupAddress,
|
||||
dropoffLat: dropoffLat,
|
||||
dropoffLng: dropoffLng,
|
||||
dropoffAddress: dropoffAddress,
|
||||
vehicleClass: vehicleClass,
|
||||
fare: fare ?? this.fare,
|
||||
currency: currency ?? this.currency,
|
||||
paymentMethod: paymentMethod,
|
||||
createdAt: createdAt,
|
||||
updatedAt: DateTime.now(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, status, clientId, vehicleClass, fare];
|
||||
}
|
||||
Reference in New Issue
Block a user