Co-authored-by: MENDOZA BALLARDO GAEL RICARDO <gael-meb123@users.noreply.github.com>
Co-authored-by: Azareth-Tr <Azareth-Tr@users.noreply.github.com> Co-authored-by: eddgranados12 <eddgranados12@users.noreply.github.com> vistas de mockup actualizaco
This commit is contained in:
39
views_v2/feedback_model.dart
Normal file
39
views_v2/feedback_model.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
// lib/features/feedback/feedback_model.dart
|
||||
// La queja solo registra target_unit_id (número de unidad), NUNCA el chofer.
|
||||
|
||||
enum FeedbackType {
|
||||
noPaso('no_paso', 'No pasó el camión'),
|
||||
llegoTarde('llego_tarde', 'Llegó tarde'),
|
||||
comportamiento('comportamiento', 'Comportamiento'),
|
||||
otro('otro', 'Otro');
|
||||
|
||||
final String value;
|
||||
final String label;
|
||||
const FeedbackType(this.value, this.label);
|
||||
}
|
||||
|
||||
class FeedbackRequest {
|
||||
final String addressId;
|
||||
final FeedbackType type;
|
||||
final int rating; // 1-5
|
||||
final String? message;
|
||||
/// Solo el número de unidad — nunca el ID del chofer.
|
||||
final String targetUnitId;
|
||||
|
||||
const FeedbackRequest({
|
||||
required this.addressId,
|
||||
required this.type,
|
||||
required this.rating,
|
||||
required this.targetUnitId,
|
||||
this.message,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'address_id': addressId,
|
||||
'type': type.value,
|
||||
'rating': rating,
|
||||
'target_unit_id': targetUnitId, // ej. "101"
|
||||
if (message != null && message!.isNotEmpty) 'message': message,
|
||||
// ⚠️ NUNCA se manda: driver_id, driver_name, chofer_*
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user