import 'package:mitra_corporate/model/order_model.dart';

class SearchOrderModel {
  List<OrderModel>? orders;
  String? total;
  int? totalPage;

  SearchOrderModel({this.orders, this.total, this.totalPage});

  SearchOrderModel.fromJson(Map<String, dynamic> json) {
    if (json['data'] != null) {
      orders = <OrderModel>[];
      json['data'].forEach((v) {
        orders!.add(OrderModel.fromJson(v));
      });
    }
    total = json['total'];
    totalPage = json['total_page'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (orders != null) {
      data['data'] = orders!.map((v) => v.toJson()).toList();
    }
    data['total'] = total;
    data['total_page'] = totalPage;
    return data;
  }
}
