- Service.fromJson: lat/lng con Decimal de Prisma llegaban como string y
el cast 'as num?' lanzaba TypeError silencioso → lista de servicios vacía.
Mismo patrón que average_score, fix: double.tryParse(?.toString())
- service_status: agregar enumToStringService que mapea el enum de Flutter
al string que espera el DTO del backend ('pending','accepted', etc.).
changeServiceStatus enviaba el índice entero → @IsEnum rechazaba → el
profesional no podía aceptar ni rechazar solicitudes
- maps_service: agregar MapsService.reverseGeocode que usa el Geocoder del
Maps JS SDK ya cargado, sin requerir la Geocoding API habilitada por separado
- dashboard_view: _reverseGeocode usa el JS Geocoder en vez del endpoint HTTP
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
810 B
Dart
30 lines
810 B
Dart
export 'service_status.dart';
|
|
|
|
enum ServiceStatus {
|
|
pending, // 0
|
|
acepted, // 1
|
|
denied, // 2
|
|
active, // 3
|
|
cancelled, // 4
|
|
completed, // 5
|
|
selfBooked // 6
|
|
}
|
|
|
|
// Maps Flutter enum → backend string (matches ServiceStatus enum in the backend DTO)
|
|
const _serviceStatusStrings = {
|
|
ServiceStatus.pending: 'pending',
|
|
ServiceStatus.acepted: 'accepted',
|
|
ServiceStatus.denied: 'denied',
|
|
ServiceStatus.active: 'active',
|
|
ServiceStatus.cancelled: 'cancelled',
|
|
ServiceStatus.completed: 'completed',
|
|
ServiceStatus.selfBooked:'self_booked',
|
|
};
|
|
|
|
String enumToStringService(ServiceStatus state) =>
|
|
_serviceStatusStrings[state] ?? 'pending';
|
|
|
|
int enumToIntService(ServiceStatus state) => state.index;
|
|
|
|
ServiceStatus intToEnumService(int value) => ServiceStatus.values[value];
|