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

class SiteModel extends Base {
  final int? id;
  final String? siteName;
  final int? siteCode;

  SiteModel({
    this.id,
    this.siteName,
    this.siteCode,
  }) : super(name: siteName, identifier: id?.toString());

  factory SiteModel.fromJson(Map<String, dynamic> json) {
    return SiteModel(
      id: json['id'],
      siteName: json['siteName'],
      siteCode: json['siteCode'],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'id': id,
      'siteName': siteName,
      'siteCode': siteCode,
    };
  }
}
