class Tenant {
  int? code;
  TenantDetails? details;
  String? message;
  bool? status;

  Tenant({this.code, this.details, this.message, this.status});

  factory Tenant.fromJson(Map<String, dynamic> json) {
    return Tenant(
      code: json['code'] as int?,
      details: json['details'] != null
          ? TenantDetails.fromJson(json['details'] as Map<String, dynamic>)
          : null,
      message: json['message'] as String?,
      status: json['status'] as bool?,
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['code'] = code;
    if (details != null) {
      data['details'] = details!.toJson();
    }
    data['message'] = message;
    data['status'] = status;
    return data;
  }
}

class TenantDetails {
  int? pricingId;
  int? tenantId;
  int? locationId;
  String? pricingDate;
  int? basePrice;
  int? pricePerKm;
  int? minKm;
  int? otherCharges;

  TenantDetails({
    this.pricingId,
    this.tenantId,
    this.locationId,
    this.pricingDate,
    this.basePrice,
    this.pricePerKm,
    this.minKm,
    this.otherCharges,
  });

  factory TenantDetails.fromJson(Map<String, dynamic> json) {
    return TenantDetails(
      pricingId: json['pricingid'] as int?,
      tenantId: json['tenantid'] as int?,
      locationId: json['locationid'] as int?,
      pricingDate: json['pricingdate'] as String?,
      basePrice: json['baseprice'] as int?,
      pricePerKm: json['priceperkm'] as int?,
      minKm: json['minkm'] as int?,
      otherCharges: json['othercharges'] as int?,
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['pricingid'] = pricingId;
    data['tenantid'] = tenantId;
    data['locationid'] = locationId;
    data['pricingdate'] = pricingDate;
    data['baseprice'] = basePrice;
    data['priceperkm'] = pricePerKm;
    data['minkm'] = minKm;
    data['othercharges'] = otherCharges;
    return data;
  }
}