import 'package:farm_tpf/presentation/screens/codes/models/stamp_type.dart';

import '../../../../custom_model/TbCropDTO.dart';

class Stamp {
  int? id;
  TbCropDTO? tbCropDTO;
  String? code;
  num? quantity;
  String? productName;
  String? description;
  String? pathImage;
  String? status;
  String? expiredDate;
  String? createdDate;
  StampType? stampType;

  Stamp({
    this.id,
    this.tbCropDTO,
    this.code,
    this.quantity,
    this.productName,
    this.description,
    this.pathImage,
    this.status,
    this.expiredDate,
    this.createdDate,
    this.stampType,
  });

  Stamp.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    tbCropDTO = json['tbCrop'] != null ? new TbCropDTO.fromJson(json['tbCrop']) : null;
    code = json['code'];
    quantity = json['quantity'];
    productName = json['productName'];
    description = json['description'];
    pathImage = json['pathImage'];
    status = json['status'];
    expiredDate = json['expiredDate'];
    createdDate = json['createdDate'];
    stampType = json['tbExampleStamp'] != null ? new StampType.fromJson(json['tbExampleStamp']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    if (this.tbCropDTO != null) {
      data['tbCrop'] = this.tbCropDTO?.toJson();
    }
    data['code'] = this.code;
    data['quantity'] = this.quantity;
    data['productName'] = this.productName;
    data['description'] = this.description;
    data['pathImage'] = this.pathImage;
    data['status'] = this.status;
    data['expiredDate'] = this.expiredDate;
    data['createdDate'] = this.createdDate;
    if (this.stampType != null) {
      data['tbExampleStamp'] = this.stampType?.toJson();
    }
    return data;
  }
}
