import 'package:domain/generated/json/base/json_convert_content.dart';
import 'package:domain/entity/response/s_g_attendance_review_option_entity.dart';
import 'package:domain/entity/response/index_option_entity.dart';


SGAttendanceReviewOptionEntity $SGAttendanceReviewOptionEntityFromJson(Map<String, dynamic> json) {
  final SGAttendanceReviewOptionEntity sGAttendanceReviewOptionEntity = SGAttendanceReviewOptionEntity();
  final List<IndexOptionEntity>? sourceList = (json['source_list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<IndexOptionEntity>(e) as IndexOptionEntity).toList();
  if (sourceList != null) {
    sGAttendanceReviewOptionEntity.sourceList = sourceList;
  }
  final List<IndexOptionEntity>? outletList = (json['outlet_list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<IndexOptionEntity>(e) as IndexOptionEntity).toList();
  if (outletList != null) {
    sGAttendanceReviewOptionEntity.outletList = outletList;
  }
  return sGAttendanceReviewOptionEntity;
}

Map<String, dynamic> $SGAttendanceReviewOptionEntityToJson(SGAttendanceReviewOptionEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['source_list'] = entity.sourceList.map((v) => v.toJson()).toList();
  data['outlet_list'] = entity.outletList.map((v) => v.toJson()).toList();
  return data;
}

extension SGAttendanceReviewOptionEntityExtension on SGAttendanceReviewOptionEntity {
  SGAttendanceReviewOptionEntity copyWith({
    List<IndexOptionEntity>? sourceList,
    List<IndexOptionEntity>? outletList,
  }) {
    return SGAttendanceReviewOptionEntity()
      ..sourceList = sourceList ?? this.sourceList
      ..outletList = outletList ?? this.outletList;
  }
}