import 'package:test_sa/models/lookup.dart';

class EndUserAssetDetailsModel {
  int? id;
  int? typeId;
  int? assetDeliveryExternalDeliveryId;
  String? type;
  String? itemNumber;
  String? costCenterName;
  Lookup? status;
  Lookup? rejectionReason;
  String? description;
  double? receivedQty;
  num? rejectedQty;
  String? assetNumber;
  String? serialNo;
  String? assetType;
  String? replacedAssetNo;

  EndUserAssetDetailsModel(
      {this.costCenterName,
      this.rejectedQty,
      this.description,
      this.id,
      this.typeId,
      this.status,
      this.rejectionReason,
      this.assetType,
      this.assetNumber,
      this.serialNo,
      this.itemNumber,
      this.type,
      this.receivedQty,
      this.replacedAssetNo,
      this.assetDeliveryExternalDeliveryId});

  EndUserAssetDetailsModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    typeId = json['typeId'];
    type = json['type'];
    itemNumber = json['itemNumber'];
    status = json['status'] != null ? Lookup.fromJson(json['status']) : null;
    rejectionReason = json['rejectReason'] != null ? Lookup.fromJson(json['rejectReason']) : null;
    description = json['description'];
    receivedQty = json['receivedQty'];
    rejectedQty = json['rejectedQty'];
    assetNumber = json['assetNumber'];
    serialNo = json['serialNo'];
    assetType = json['assetType'];
    replacedAssetNo = json['replacedAssetNo'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = {};
    data['id'] = id;
    data['assetDeliveryExternalDeliveryId'] = assetDeliveryExternalDeliveryId;
    data['costCenterName'] = costCenterName;
    data['typeId'] = typeId;
    data['type'] = type;
    data['itemNumber'] = itemNumber;
    data['statusId'] = status?.id;
    // data['status'] = status;
    // data['rejectionReason'] = rejectionReason;
    data['rejectReasonId'] = rejectionReason?.id;
    data['description'] = description;
    data['receivedQty'] = receivedQty;
    data['rejectedQty'] = rejectedQty;

    return data;
  }
}
