/// id : 6
/// category_id : 4
/// name : "KENT SILVER"
/// ean : "46187413"
/// articul : 1
/// price : 500
/// opt_price : 500
/// base_price : 500
/// divisible : 0
/// updated_at : "2021-02-03 11:37:34"

class GoodResponse {
  int? id;
  int? categoryId;
  String name = '';
  String? ean;
  int? articul;
  int? price;
  int? optPrice;
  int? basePrice;
  int? divisible;
  String? updatedAt;

  static GoodResponse fromMap(dynamic map) {
    final GoodResponse goodResponseBean = GoodResponse();
    goodResponseBean.id = map['id'] as int;
    goodResponseBean.categoryId = map['category_id'] as int;
    goodResponseBean.name = map['name'] as String;
    goodResponseBean.ean = map['ean'] as String;
    goodResponseBean.articul = map['articul'] as int;
    goodResponseBean.price = map['price'] as int;
    goodResponseBean.optPrice = map['opt_price'] as int;
    goodResponseBean.basePrice = map['base_price'] as int;
    goodResponseBean.divisible = map['divisible'] as int;
    goodResponseBean.updatedAt = map['updated_at'] as String;
    return goodResponseBean;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> map = <String, dynamic>{
      'id': id,
      'category_id': categoryId,
      'name': name,
      'ean': ean,
      'articul': articul,
      'price': price,
      'opt_price': optPrice,
      'base_price': basePrice,
      'divisible': divisible,
      'updated_at': updatedAt,
    };
    return map;
  }
}
