import 'package:domain/generated/json/base/json_convert_content.dart';
import 'package:domain/entity/response/staff_report_v_n_entity.dart';
import 'package:domain/entity/response/staff_request_report_entity.dart';


StaffReportVNEntity $StaffReportVNEntityFromJson(Map<String, dynamic> json) {
  final StaffReportVNEntity staffReportVNEntity = StaffReportVNEntity();
  final String? startDate = jsonConvert.convert<String>(json['start_date']);
  if (startDate != null) {
    staffReportVNEntity.startDate = startDate;
  }
  final String? endDate = jsonConvert.convert<String>(json['end_date']);
  if (endDate != null) {
    staffReportVNEntity.endDate = endDate;
  }
  final List<StaffRequestReportEntity>? requestList = (json['request_list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<StaffRequestReportEntity>(e) as StaffRequestReportEntity).toList();
  if (requestList != null) {
    staffReportVNEntity.requestList = requestList;
  }
  final int? totalNum = jsonConvert.convert<int>(json['total_num']);
  if (totalNum != null) {
    staffReportVNEntity.totalNum = totalNum;
  }
  return staffReportVNEntity;
}

Map<String, dynamic> $StaffReportVNEntityToJson(StaffReportVNEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['start_date'] = entity.startDate;
  data['end_date'] = entity.endDate;
  data['request_list'] = entity.requestList.map((v) => v.toJson()).toList();
  data['total_num'] = entity.totalNum;
  return data;
}

extension StaffReportVNEntityExtension on StaffReportVNEntity {
  StaffReportVNEntity copyWith({
    String? startDate,
    String? endDate,
    List<StaffRequestReportEntity>? requestList,
    int? totalNum,
  }) {
    return StaffReportVNEntity()
      ..startDate = startDate ?? this.startDate
      ..endDate = endDate ?? this.endDate
      ..requestList = requestList ?? this.requestList
      ..totalNum = totalNum ?? this.totalNum;
  }
}