import '../../domain/entities/scooter_order.dart';
import '../../domain/entities/pagination.dart';

class ScooterOrderHistoryResponse {
  final List<ScooterOrder> orders;
  final Pagination pagination;

  ScooterOrderHistoryResponse({
    required this.orders,
    required this.pagination,
  });

  factory ScooterOrderHistoryResponse.fromJson(Map<String, dynamic> json) {
    return ScooterOrderHistoryResponse(
      orders: (json['data'] as List<dynamic>)
          .map((e) => ScooterOrder.fromJson(e as Map<String, dynamic>))
          .toList(),
      pagination: Pagination.fromJson(json['pagination']),
    );
  }
}