// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'product_dtos.dart';

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

_$ProductDtoImpl _$$ProductDtoImplFromJson(Map<String, dynamic> json) =>
    _$ProductDtoImpl(
      id: json['id'] as String?,
      organizationId: json['organization_id'] as String?,
      categoryId: json['category_id'] as String?,
      sku: json['sku'] as String?,
      name: json['name'] as String?,
      description: json['description'] as String?,
      price: (json['price'] as num?)?.toInt(),
      cost: (json['cost'] as num?)?.toInt(),
      businessType: json['business_type'] as String?,
      imageUrl: json['image_url'] as String?,
      printerType: json['printer_type'] as String?,
      metadata: json['metadata'] as Map<String, dynamic>?,
      isActive: json['is_active'] as bool?,
      createdAt: json['created_at'] == null
          ? null
          : DateTime.parse(json['created_at'] as String),
      updatedAt: json['updated_at'] == null
          ? null
          : DateTime.parse(json['updated_at'] as String),
      variants: (json['variants'] as List<dynamic>?)
          ?.map((e) => ProductVariantDto.fromJson(e as Map<String, dynamic>))
          .toList(),
    );

Map<String, dynamic> _$$ProductDtoImplToJson(_$ProductDtoImpl instance) =>
    <String, dynamic>{
      'id': instance.id,
      'organization_id': instance.organizationId,
      'category_id': instance.categoryId,
      'sku': instance.sku,
      'name': instance.name,
      'description': instance.description,
      'price': instance.price,
      'cost': instance.cost,
      'business_type': instance.businessType,
      'image_url': instance.imageUrl,
      'printer_type': instance.printerType,
      'metadata': instance.metadata,
      'is_active': instance.isActive,
      'created_at': instance.createdAt?.toIso8601String(),
      'updated_at': instance.updatedAt?.toIso8601String(),
      'variants': instance.variants,
    };

_$ProductVariantDtoImpl _$$ProductVariantDtoImplFromJson(
  Map<String, dynamic> json,
) => _$ProductVariantDtoImpl(
  id: json['id'] as String?,
  productId: json['product_id'] as String?,
  name: json['name'] as String?,
  priceModifier: (json['price_modifier'] as num?)?.toInt(),
  cost: (json['cost'] as num?)?.toInt(),
  metadata: json['metadata'] as Map<String, dynamic>?,
  createdAt: json['created_at'] == null
      ? null
      : DateTime.parse(json['created_at'] as String),
  updatedAt: json['updated_at'] == null
      ? null
      : DateTime.parse(json['updated_at'] as String),
);

Map<String, dynamic> _$$ProductVariantDtoImplToJson(
  _$ProductVariantDtoImpl instance,
) => <String, dynamic>{
  'id': instance.id,
  'product_id': instance.productId,
  'name': instance.name,
  'price_modifier': instance.priceModifier,
  'cost': instance.cost,
  'metadata': instance.metadata,
  'created_at': instance.createdAt?.toIso8601String(),
  'updated_at': instance.updatedAt?.toIso8601String(),
};
