import 'package:common_utils/common_utils.dart';

class KeyManageRecordListModel {
  int? id;
  String? code;
  int? status;
  String? facilityName;
  String? correspondingPosition;
  String? storageLocation;
  String? auditDate;
  String? reason;

  KeyManageRecordListModel(
      {required this.id,
      this.code,
      this.status,
      this.facilityName,
      this.correspondingPosition,
      this.storageLocation,
      this.auditDate,
      this.reason});

  KeyManageRecordListModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    code = json['code'];
    status = json['status'];
    facilityName = json['facilityName'];
    correspondingPosition = json['correspondingPosition'];
    storageLocation = json['storageLocation'];
    auditDate = json['auditDate'];
    reason = json['reason'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['code'] = this.code;
    data['status'] = this.status;
    data['facilityName'] = this.facilityName;
    data['correspondingPosition'] = this.correspondingPosition;
    data['storageLocation'] = this.storageLocation;
    data['auditDate'] = this.auditDate;
    data['reason'] = this.reason;
    return data;
  }

   String get auditDateString => DateUtil.formatDateStr(this.auditDate!,format: 'yyyy-MM-dd HH:mm');
}
