import 'package:freezed_annotation/freezed_annotation.dart';

part 'expiring_license.freezed.dart';
part 'expiring_license.g.dart';

@freezed
class ExpiringLicense with _$ExpiringLicense {
  const factory ExpiringLicense({
    required int id,
    @JsonKey(name: 'license_key') required String licenseKey,
    @JsonKey(name: 'software_name') required String softwareName,
    @JsonKey(name: 'company_name') required String companyName,
    @JsonKey(name: 'expiry_date') required DateTime expiryDate,
    @JsonKey(name: 'days_until_expiry') required int daysUntilExpiry,
    @JsonKey(name: 'renewal_cost') required double renewalCost,
    @JsonKey(name: 'auto_renew') required bool autoRenew,
  }) = _ExpiringLicense;

  factory ExpiringLicense.fromJson(Map<String, dynamic> json) =>
      _$ExpiringLicenseFromJson(json);
}