// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'inventory_detail_response.dart';

// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************

InventoryDetailResponse _$InventoryDetailResponseFromJson(
  Map<String, dynamic> json,
) => InventoryDetailResponse(
  data: InventoryDetailDataDto.fromJson(json['data'] as Map<String, dynamic>),
);

Map<String, dynamic> _$InventoryDetailResponseToJson(
  InventoryDetailResponse instance,
) => <String, dynamic>{'data': instance.data.toJson()};

InventoryDetailDataDto _$InventoryDetailDataDtoFromJson(
  Map<String, dynamic> json,
) => InventoryDetailDataDto(
  product: InventoryProductDto.fromJson(
    json['product'] as Map<String, dynamic>,
  ),
  totalQuantity: _parseQuantity(json['total_quantity']),
  warehouseBalances:
      (json['warehouse_balances'] as List<dynamic>?)
          ?.map(
            (e) => InventoryWarehouseBalanceDto.fromJson(
              e as Map<String, dynamic>,
            ),
          )
          .toList() ??
      [],
  recentEvents:
      (json['recent_events'] as List<dynamic>?)
          ?.map((e) => InventoryEventDto.fromJson(e as Map<String, dynamic>))
          .toList() ??
      [],
  updatedAt: json['updated_at'] == null
      ? null
      : DateTime.parse(json['updated_at'] as String),
  lastRefreshedAt: json['last_refreshed_at'] == null
      ? null
      : DateTime.parse(json['last_refreshed_at'] as String),
);

Map<String, dynamic> _$InventoryDetailDataDtoToJson(
  InventoryDetailDataDto instance,
) => <String, dynamic>{
  'product': instance.product.toJson(),
  'total_quantity': instance.totalQuantity,
  'warehouse_balances': instance.warehouseBalances
      .map((e) => e.toJson())
      .toList(),
  'recent_events': instance.recentEvents.map((e) => e.toJson()).toList(),
  'updated_at': instance.updatedAt?.toIso8601String(),
  'last_refreshed_at': instance.lastRefreshedAt?.toIso8601String(),
};
