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

class AssetRetiredHelperModel {
  int? id;
  int? workOrderId;
  Lookup? retirmentReason;
  String? retirementComment;
  List<ActivityAssetToBeRetiredAttachments>?
  activityAssetToBeRetiredAttachments=[];

  AssetRetiredHelperModel(
      {this.id,
        this.workOrderId,
        this.retirmentReason,
        this.retirementComment,
        this.activityAssetToBeRetiredAttachments});

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data =  <String, dynamic>{};
    data['id'] = id;
    data['workOrderId'] = workOrderId;
    data['retirmentReasonId'] = retirmentReason?.id;
    data['retirementComment'] = retirementComment;
    if (activityAssetToBeRetiredAttachments != null) {
      data['activityAssetToBeRetiredAttachments'] = activityAssetToBeRetiredAttachments!
          .map((v) => v.toJson())
          .toList();
    }
    return data;
  }
}

class ActivityAssetToBeRetiredAttachments {
  int? id;
  String? name;
  ActivityAssetToBeRetiredAttachments({this.id, this.name});
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['name'] = name;
    return data;
  }
}
