// To parse this JSON data, do
//
//     final classComponents = classComponentsFromJson(jsonString);

import 'package:meta/meta.dart';
import 'dart:convert';

ClassComponents classComponentsFromJson(String str) =>
    ClassComponents.fromJson(json.decode(str));

String classComponentsToJson(ClassComponents data) =>
    json.encode(data.toJson());

class ClassComponents {
  final int id;
  final String componentName;
  final String minBaseUnitvalPercent;
  final String maxBaseUnitvalPercent;
  final String minUnitvalSqrmtr;
  final String maxUnitvalSqrmtr;
  final String minAddBaseunitval;
  final String maxAddBaseunitval;
  final String minDeductBaserate;
  final String maxDeductBaserate;
  final String minLinearMeter;
  final String maxLinearMeter;
  final String minSpacing;
  final String maxSpacing;
  final String roughFinish;
  final String highFinish;
  final bool withoutBucc;

  ClassComponents({
    required this.id,
    required this.componentName,
    required this.minBaseUnitvalPercent,
    required this.maxBaseUnitvalPercent,
    required this.minUnitvalSqrmtr,
    required this.maxUnitvalSqrmtr,
    required this.minAddBaseunitval,
    required this.maxAddBaseunitval,
    required this.minDeductBaserate,
    required this.maxDeductBaserate,
    required this.minLinearMeter,
    required this.maxLinearMeter,
    required this.minSpacing,
    required this.maxSpacing,
    required this.roughFinish,
    required this.highFinish,
    required this.withoutBucc,
  });

  factory ClassComponents.fromJson(Map<String, dynamic> json) =>
      ClassComponents(
        id: json["id"],
        componentName: json["component_name"],
        minBaseUnitvalPercent: json["min_base_unitval_percent"],
        maxBaseUnitvalPercent: json["max_base_unitval_percent"],
        minUnitvalSqrmtr: json["min_unitval_sqrmtr"],
        maxUnitvalSqrmtr: json["max_unitval_sqrmtr"],
        minAddBaseunitval: json["min_add_baseunitval"],
        maxAddBaseunitval: json["max_add_baseunitval"],
        minDeductBaserate: json["min_deduct_baserate"],
        maxDeductBaserate: json["max_deduct_baserate"],
        minLinearMeter: json["min_linear_meter"],
        maxLinearMeter: json["max_linear_meter"],
        minSpacing: json["min_spacing"],
        maxSpacing: json["max_spacing"],
        roughFinish: json["rough_finish"],
        highFinish: json["high_finish"],
        withoutBucc: json["without_bucc"],
      );

  Map<String, dynamic> toJson() => {
        "id": id,
        "component_name": componentName,
        "min_base_unitval_percent": minBaseUnitvalPercent,
        "max_base_unitval_percent": maxBaseUnitvalPercent,
        "min_unitval_sqrmtr": minUnitvalSqrmtr,
        "max_unitval_sqrmtr": maxUnitvalSqrmtr,
        "min_add_baseunitval": minAddBaseunitval,
        "max_add_baseunitval": maxAddBaseunitval,
        "min_deduct_baserate": minDeductBaserate,
        "max_deduct_baserate": maxDeductBaserate,
        "min_linear_meter": minLinearMeter,
        "max_linear_meter": maxLinearMeter,
        "min_spacing": minSpacing,
        "max_spacing": maxSpacing,
        "rough_finish": roughFinish,
        "high_finish": highFinish,
        "without_bucc": withoutBucc,
      };
}
