import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/response/labour_report_entity.dart'; LabourReportEntity $LabourReportEntityFromJson(Map json) { final LabourReportEntity labourReportEntity = LabourReportEntity(); final List? rows = (json['rows'] as List?)?.map( (e) => jsonConvert.convert(e) as LabourReportRows).toList(); if (rows != null) { labourReportEntity.rows = rows; } final LabourReportTotal? total = jsonConvert.convert(json['total']); if (total != null) { labourReportEntity.total = total; } return labourReportEntity; } Map $LabourReportEntityToJson(LabourReportEntity entity) { final Map data = {}; data['rows'] = entity.rows.map((v) => v.toJson()).toList(); data['total'] = entity.total?.toJson(); return data; } extension LabourReportEntityExtension on LabourReportEntity { LabourReportEntity copyWith({ List? rows, LabourReportTotal? total, }) { return LabourReportEntity() ..rows = rows ?? this.rows ..total = total ?? this.total; } } LabourReportRows $LabourReportRowsFromJson(Map json) { final LabourReportRows labourReportRows = LabourReportRows(); final int? outletId = jsonConvert.convert(json['outlet_id']); if (outletId != null) { labourReportRows.outletId = outletId; } final String? outletName = jsonConvert.convert(json['outlet_name']); if (outletName != null) { labourReportRows.outletName = outletName; } final String? hrs = jsonConvert.convert(json['hrs']); if (hrs != null) { labourReportRows.hrs = hrs; } final String? agAmt = jsonConvert.convert(json['ag_amt']); if (agAmt != null) { labourReportRows.agAmt = agAmt; } final String? inHrs = jsonConvert.convert(json['in_hrs']); if (inHrs != null) { labourReportRows.inHrs = inHrs; } final String? inAgAmt = jsonConvert.convert(json['in_ag_amt']); if (inAgAmt != null) { labourReportRows.inAgAmt = inAgAmt; } final String? totHrs = jsonConvert.convert(json['tot_hrs']); if (totHrs != null) { labourReportRows.totHrs = totHrs; } final String? totAgAmt = jsonConvert.convert(json['tot_ag_amt']); if (totAgAmt != null) { labourReportRows.totAgAmt = totAgAmt; } return labourReportRows; } Map $LabourReportRowsToJson(LabourReportRows entity) { final Map data = {}; data['outlet_id'] = entity.outletId; data['outlet_name'] = entity.outletName; data['hrs'] = entity.hrs; data['ag_amt'] = entity.agAmt; data['in_hrs'] = entity.inHrs; data['in_ag_amt'] = entity.inAgAmt; data['tot_hrs'] = entity.totHrs; data['tot_ag_amt'] = entity.totAgAmt; return data; } extension LabourReportRowsExtension on LabourReportRows { LabourReportRows copyWith({ int? outletId, String? outletName, String? hrs, String? agAmt, String? inHrs, String? inAgAmt, String? totHrs, String? totAgAmt, }) { return LabourReportRows() ..outletId = outletId ?? this.outletId ..outletName = outletName ?? this.outletName ..hrs = hrs ?? this.hrs ..agAmt = agAmt ?? this.agAmt ..inHrs = inHrs ?? this.inHrs ..inAgAmt = inAgAmt ?? this.inAgAmt ..totHrs = totHrs ?? this.totHrs ..totAgAmt = totAgAmt ?? this.totAgAmt; } } LabourReportTotal $LabourReportTotalFromJson(Map json) { final LabourReportTotal labourReportTotal = LabourReportTotal(); final String? hrs = jsonConvert.convert(json['hrs']); if (hrs != null) { labourReportTotal.hrs = hrs; } final String? agAmt = jsonConvert.convert(json['ag_amt']); if (agAmt != null) { labourReportTotal.agAmt = agAmt; } final String? inHrs = jsonConvert.convert(json['in_hrs']); if (inHrs != null) { labourReportTotal.inHrs = inHrs; } final String? inAgAmt = jsonConvert.convert(json['in_ag_amt']); if (inAgAmt != null) { labourReportTotal.inAgAmt = inAgAmt; } final String? totHrs = jsonConvert.convert(json['tot_hrs']); if (totHrs != null) { labourReportTotal.totHrs = totHrs; } final String? totAgAmt = jsonConvert.convert(json['tot_ag_amt']); if (totAgAmt != null) { labourReportTotal.totAgAmt = totAgAmt; } return labourReportTotal; } Map $LabourReportTotalToJson(LabourReportTotal entity) { final Map data = {}; data['hrs'] = entity.hrs; data['ag_amt'] = entity.agAmt; data['in_hrs'] = entity.inHrs; data['in_ag_amt'] = entity.inAgAmt; data['tot_hrs'] = entity.totHrs; data['tot_ag_amt'] = entity.totAgAmt; return data; } extension LabourReportTotalExtension on LabourReportTotal { LabourReportTotal copyWith({ String? hrs, String? agAmt, String? inHrs, String? inAgAmt, String? totHrs, String? totAgAmt, }) { return LabourReportTotal() ..hrs = hrs ?? this.hrs ..agAmt = agAmt ?? this.agAmt ..inHrs = inHrs ?? this.inHrs ..inAgAmt = inAgAmt ?? this.inAgAmt ..totHrs = totHrs ?? this.totHrs ..totAgAmt = totAgAmt ?? this.totAgAmt; } }