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