class  DriversModel {
  String supplier_name='';
  String driver_name='';
  String status='';
  String address='';
  String deliveries='';
  String commision='';
  String years_of_experience='';
  List<String> availability= ['filled', 'available'];
  String phone_number='';
  String alt_phone_number='';
  String license_number='';
  String age='';
  String license_expiry_date='';
  String picture='';
  String dbId='';
  List<dynamic> licenseImages= [];
  List<dynamic> blocked_dates = [];
  DriversModel();

  factory DriversModel.fromJson(Map<String, dynamic> json) {
    DriversModel rtvm = DriversModel();

    rtvm.supplier_name       = json['suppliername'] ?? '';
    rtvm.driver_name         = json['name'] ?? '';   // ✅ Correct
    rtvm.status              = json['status'] ?? '';
    rtvm.dbId              = json['_id'] ?? '';
    rtvm.address             = json['address'] ?? '';
    rtvm.phone_number        = json['phone'] ?? '';
    rtvm.alt_phone_number    = json['alternativeContactNumber'] ?? '';
    rtvm.years_of_experience = json['years_of_experience'] ?? '';
    rtvm.license_number      = json['license_number'] ?? '';
    rtvm.deliveries      = json['deliveries'] ?? '';
    rtvm.picture      = json['picture'] ?? '';
    rtvm.license_expiry_date=json['license_number'] ?? '';
    rtvm.age=json['age'] ?? '';
    rtvm.licenseImages   = json['images'] ?? [];
    rtvm.blocked_dates =
        json['blocked_dates'] ?? [];
    return rtvm;
  }
}