// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'license_dto.dart';

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

_$LicenseDtoImpl _$$LicenseDtoImplFromJson(Map<String, dynamic> json) =>
    _$LicenseDtoImpl(
      id: (json['id'] as num).toInt(),
      licenseKey: json['license_key'] as String,
      productName: json['product_name'] as String?,
      vendor: json['vendor'] as String?,
      licenseType: json['license_type'] as String?,
      userCount: (json['user_count'] as num?)?.toInt(),
      purchaseDate: _dateFromJson(json['purchase_date'] as String?),
      expiryDate: _dateFromJson(json['expiry_date'] as String?),
      purchasePrice: _priceFromJson(json['purchase_price']),
      companyId: (json['company_id'] as num?)?.toInt(),
      branchId: (json['branch_id'] as num?)?.toInt(),
      assignedUserId: (json['assigned_user_id'] as num?)?.toInt(),
      remark: json['remark'] as String?,
      isActive: json['is_active'] as bool,
      createdAt: DateTime.parse(json['created_at'] as String),
      updatedAt: DateTime.parse(json['updated_at'] as String),
      companyName: json['company_name'] as String?,
      branchName: json['branch_name'] as String?,
      assignedUserName: json['assigned_user_name'] as String?,
    );

Map<String, dynamic> _$$LicenseDtoImplToJson(_$LicenseDtoImpl instance) =>
    <String, dynamic>{
      'id': instance.id,
      'license_key': instance.licenseKey,
      'product_name': instance.productName,
      'vendor': instance.vendor,
      'license_type': instance.licenseType,
      'user_count': instance.userCount,
      'purchase_date': _dateToJson(instance.purchaseDate),
      'expiry_date': _dateToJson(instance.expiryDate),
      'purchase_price': _priceToJson(instance.purchasePrice),
      'company_id': instance.companyId,
      'branch_id': instance.branchId,
      'assigned_user_id': instance.assignedUserId,
      'remark': instance.remark,
      'is_active': instance.isActive,
      'created_at': instance.createdAt.toIso8601String(),
      'updated_at': instance.updatedAt.toIso8601String(),
      'company_name': instance.companyName,
      'branch_name': instance.branchName,
      'assigned_user_name': instance.assignedUserName,
    };

_$LicenseListResponseDtoImpl _$$LicenseListResponseDtoImplFromJson(
        Map<String, dynamic> json) =>
    _$LicenseListResponseDtoImpl(
      items: (json['items'] as List<dynamic>)
          .map((e) => LicenseDto.fromJson(e as Map<String, dynamic>))
          .toList(),
      total: (json['total'] as num).toInt(),
      page: (json['page'] as num).toInt(),
      perPage: (json['per_page'] as num).toInt(),
      totalPages: (json['total_pages'] as num).toInt(),
    );

Map<String, dynamic> _$$LicenseListResponseDtoImplToJson(
        _$LicenseListResponseDtoImpl instance) =>
    <String, dynamic>{
      'items': instance.items,
      'total': instance.total,
      'page': instance.page,
      'per_page': instance.perPage,
      'total_pages': instance.totalPages,
    };

_$ExpiringLicenseDtoImpl _$$ExpiringLicenseDtoImplFromJson(
        Map<String, dynamic> json) =>
    _$ExpiringLicenseDtoImpl(
      id: (json['id'] as num).toInt(),
      licenseKey: json['license_key'] as String,
      productName: json['product_name'] as String?,
      vendor: json['vendor'] as String?,
      expiryDate: _requiredDateFromJson(json['expiry_date'] as String?),
      daysUntilExpiry: (json['days_until_expiry'] as num).toInt(),
      assignedUserId: (json['assigned_user_id'] as num?)?.toInt(),
      companyId: (json['company_id'] as num?)?.toInt(),
      companyName: json['company_name'] as String?,
      assignedUserName: json['assigned_user_name'] as String?,
      isActive: json['is_active'] as bool? ?? true,
    );

Map<String, dynamic> _$$ExpiringLicenseDtoImplToJson(
        _$ExpiringLicenseDtoImpl instance) =>
    <String, dynamic>{
      'id': instance.id,
      'license_key': instance.licenseKey,
      'product_name': instance.productName,
      'vendor': instance.vendor,
      'expiry_date': instance.expiryDate.toIso8601String(),
      'days_until_expiry': instance.daysUntilExpiry,
      'assigned_user_id': instance.assignedUserId,
      'company_id': instance.companyId,
      'company_name': instance.companyName,
      'assigned_user_name': instance.assignedUserName,
      'is_active': instance.isActive,
    };

_$ExpiringLicenseListDtoImpl _$$ExpiringLicenseListDtoImplFromJson(
        Map<String, dynamic> json) =>
    _$ExpiringLicenseListDtoImpl(
      items: (json['items'] as List<dynamic>)
          .map((e) => ExpiringLicenseDto.fromJson(e as Map<String, dynamic>))
          .toList(),
      total: (json['total'] as num).toInt(),
      page: (json['page'] as num).toInt(),
      perPage: (json['per_page'] as num).toInt(),
      totalPages: (json['total_pages'] as num).toInt(),
    );

Map<String, dynamic> _$$ExpiringLicenseListDtoImplToJson(
        _$ExpiringLicenseListDtoImpl instance) =>
    <String, dynamic>{
      'items': instance.items,
      'total': instance.total,
      'page': instance.page,
      'per_page': instance.perPage,
      'total_pages': instance.totalPages,
    };
