import '../lookup.dart';

class TechnicalGuidanceBook {
  TechnicalGuidanceBook({this.id, this.guidanceBook});

  TechnicalGuidanceBook.fromJson(dynamic json) {
    id = json['id'];
    guidanceBook = json['guidanceBook'] != null ? Lookup.fromJson(json['guidanceBook']) : null;
  }

  num? id; // Now nullable
  Lookup? guidanceBook; // Nownullable

  TechnicalGuidanceBook copyWith({
    num? id, // Parameter is now nullable
    Lookup? guidanceBook, // Parameter is now nullable
  }) =>
      TechnicalGuidanceBook(
        id: id ?? this.id,
        guidanceBook: guidanceBook ?? this.guidanceBook,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = id;
    if (guidanceBook != null) {
      map['guidanceBook'] = guidanceBook?.toJson(); // Use '?.' for nullsafety
    }
    return map;
  }
}
