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

class SuppEngineerWorkOrders extends Base {
  SuppEngineerWorkOrders({this.id, this.supplierContactId, this.personName, this.personRoleName, this.contact, this.externalEngCode, this.email}) : super(identifier: id?.toString(), name: personName);

  SuppEngineerWorkOrders.fromJson(dynamic json) {
    id = json['id'];
    identifier = id?.toString();
    supplierContactId = json['supplierContactId'] ?? json["supplierId"];
    personName = json['personName'];
    name = personName;
    personRoleName = json['personRoleName'];
    contact = json['contact'];
    externalEngCode = json['externalEngCode'];
    email = json['email'];
  }

  num? id;
  num? supplierContactId;
  String? personName;
  String? personRoleName;
  String? contact;
  String? externalEngCode;
  String? email;

  SuppEngineerWorkOrders copyWith({num? id, num? supplierContactId, String? personName, String? personRoleName, String? contact, String? externalEngCode, String? email}) => SuppEngineerWorkOrders(
        id: id ?? this.id,
        supplierContactId: supplierContactId ?? this.supplierContactId,
        personName: personName ?? this.personName,
        personRoleName: personRoleName ?? this.personRoleName,
        contact: contact ?? this.contact,
        externalEngCode: externalEngCode ?? this.externalEngCode,
        email: email ?? this.email,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = id;
    map['supplierContactId'] = supplierContactId;
    map['personName'] = personName;
    map['personRoleName'] = personRoleName;
    map['contact'] = contact;
    map['externalEngCode'] = externalEngCode;
    map['email'] = email;
    return map;
  }
}
