class WorkTimeDetailsModel { final List? wd; final List? munkaszunet; final Month? month; final Weekend? weekend; WorkTimeDetailsModel({ this.wd, this.munkaszunet, this.month, this.weekend, }); WorkTimeDetailsModel.fromJson(Map json) : wd = (json['wd'] as List?) ?.map((dynamic e) => Wd.fromJson(e as Map)) .toList(), munkaszunet = json['munkaszunet'] as List?, month = (json['month'] as Map?) != null ? Month.fromJson(json['month'] as Map) : null, weekend = (json['weekend'] as Map?) != null ? Weekend.fromJson(json['weekend'] as Map) : null; Map toJson() => { 'wd': wd?.map((e) => e.toJson()).toList(), 'munkaszunet': munkaszunet, 'month': month?.toJson(), 'weekend': weekend?.toJson() }; } class Wd { final String? date; final bool? isMunkaszunet; final bool? isHoliday; final bool? isWeekend; final String? location; final String? notes; final List? startStop; final int? fullHours; final int? hours; final int? overTime; Wd({ this.date, this.isMunkaszunet, this.isHoliday, this.isWeekend, this.location, this.notes, this.startStop, this.fullHours, this.hours, this.overTime, }); Wd.fromJson(Map json) : date = json['date'] as String?, isMunkaszunet = json['isMunkaszunet'] as bool?, isHoliday = json['isHoliday'] as bool?, isWeekend = json['isWeekend'] as bool?, location = json['location'] as String?, notes = json['notes'] as String?, startStop = (json['startStop'] as List?) ?.map((dynamic e) => StartStop.fromJson(e as Map)) .toList(), fullHours = json['fullHours'] as int?, hours = json['hours'] as int?, overTime = json['overTime'] as int?; Map toJson() => { 'date': date, 'isMunkaszunet': isMunkaszunet, 'isHoliday': isHoliday, 'isWeekend': isWeekend, 'location': location, 'notes': notes, 'startStop': startStop?.map((e) => e.toJson()).toList(), 'fullHours': fullHours, 'hours': hours, 'overTime': overTime }; } class StartStop { final String? start; final String? stop; final String? arriveLoc; final String? getawayLoc; final ArriveCoords? arriveCoords; final GetavayCoords? getavayCoords; StartStop({ this.start, this.stop, this.arriveLoc, this.getawayLoc, this.arriveCoords, this.getavayCoords, }); StartStop.fromJson(Map json) : start = json['start'] as String?, stop = json['stop'] as String?, arriveLoc = json['arriveLoc'] as String?, getawayLoc = json['getawayLoc'] as String?, arriveCoords = (json['arriveCoords'] as Map?) != null ? ArriveCoords.fromJson( json['arriveCoords'] as Map) : null, getavayCoords = (json['getavayCoords'] as Map?) != null ? GetavayCoords.fromJson( json['getavayCoords'] as Map) : null; Map toJson() => { 'start': start, 'stop': stop, 'arriveLoc': arriveLoc, 'getawayLoc': getawayLoc, 'arriveCoords': arriveCoords?.toJson(), 'getavayCoords': getavayCoords?.toJson() }; } class ArriveCoords { late final double? lat; late final double? lon; ArriveCoords({ this.lat, this.lon, }); ArriveCoords.fromJson(Map json) { if (json.isNotEmpty && json['lat'] != null && json['lon'] != null && json['lat'] != 0 && json['lon'] != 0) { lat = (json['lat'] as double).toDouble(); lon = (json['lon'] as double).toDouble(); } else { lat = 0.0; lon = 0.0; } } Map toJson() => {'lat': lat, 'lon': lon}; } class GetavayCoords { late final double? lat; late final double? lon; GetavayCoords({ this.lat, this.lon, }); GetavayCoords.fromJson(Map json) { if (json.isNotEmpty && json['lat'] != null && json['lon'] != null && json['lat'] != 0 && json['lon'] != 0) { lat = (json['lat'] as double).toDouble(); lon = (json['lon'] as double).toDouble(); } else { lat = 0.0; lon = 0.0; } } Map toJson() => {'lat': lat, 'lon': lon}; } class Month { final int? overTime; final int? workHours; final int? fullWorkHours; Month({ this.overTime, this.workHours, this.fullWorkHours, }); Month.fromJson(Map json) : overTime = json['overTime'] as int?, workHours = json['workHours'] as int?, fullWorkHours = json['fullWorkHours'] as int?; Map toJson() => { 'overTime': overTime, 'workHours': workHours, 'fullWorkHours': fullWorkHours }; } class Weekend { final Saturday? saturday; final Sunday? sunday; Weekend({ this.saturday, this.sunday, }); Weekend.fromJson(Map json) : saturday = (json['Saturday'] as Map?) != null ? Saturday.fromJson(json['Saturday'] as Map) : null, sunday = (json['Sunday'] as Map?) != null ? Sunday.fromJson(json['Sunday'] as Map) : null; Map toJson() => {'Saturday': saturday?.toJson(), 'Sunday': sunday?.toJson()}; } class Saturday { final int? overTime; final int? workHours; final int? fullWorkHours; final int? days; Saturday({ this.overTime, this.workHours, this.fullWorkHours, this.days, }); Saturday.fromJson(Map json) : overTime = json['overTime'] as int?, workHours = json['workHours'] as int?, fullWorkHours = json['fullWorkHours'] as int?, days = json['days'] as int?; Map toJson() => { 'overTime': overTime, 'workHours': workHours, 'fullWorkHours': fullWorkHours, 'days': days }; } class Sunday { final int? overTime; final int? workHours; final int? fullWorkHours; final int? days; Sunday({ this.overTime, this.workHours, this.fullWorkHours, this.days, }); Sunday.fromJson(Map json) : overTime = json['overTime'] as int?, workHours = json['workHours'] as int?, fullWorkHours = json['fullWorkHours'] as int?, days = json['days'] as int?; Map toJson() => { 'overTime': overTime, 'workHours': workHours, 'fullWorkHours': fullWorkHours, 'days': days }; }