feat: 대시보드에 라이선스 만료 요약 및 Lookup 데이터 캐싱 시스템 구현
Some checks failed
Flutter Test & Quality Check / Test on macos-latest (push) Has been cancelled
Flutter Test & Quality Check / Test on ubuntu-latest (push) Has been cancelled
Flutter Test & Quality Check / Build APK (push) Has been cancelled

- License Expiry Summary API 연동 완료
  - 30/60/90일 내 만료 예정 라이선스 요약 표시
  - 대시보드 상단에 알림 카드로 통합
  - 만료 임박 순서로 색상 구분 (빨강/주황/노랑)

- Lookup 데이터 전역 캐싱 시스템 구축
  - LookupService 및 RemoteDataSource 생성
  - 전체 lookup 데이터 일괄 로드 및 캐싱
  - 타입별 필터링 지원

- 새로운 모델 추가
  - LicenseExpirySummary (Freezed)
  - LookupData, LookupCategory, LookupItem 모델

- CLAUDE.md 문서 업데이트
  - 미사용 API 활용 계획 추가
  - 구현 우선순위 정의

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
JiWoong Sul
2025-08-08 14:42:20 +09:00
parent 740a691406
commit 844c7bd92f
15 changed files with 2105 additions and 4 deletions

View File

@@ -0,0 +1,38 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'license_expiry_summary.freezed.dart';
part 'license_expiry_summary.g.dart';
@freezed
class LicenseExpirySummary with _$LicenseExpirySummary {
const factory LicenseExpirySummary({
@JsonKey(name: 'within_30_days') required int within30Days,
@JsonKey(name: 'within_60_days') required int within60Days,
@JsonKey(name: 'within_90_days') required int within90Days,
@JsonKey(name: 'expired') required int expired,
@JsonKey(name: 'total_active') required int totalActive,
@JsonKey(name: 'licenses') required List<LicenseExpiryDetail> licenses,
}) = _LicenseExpirySummary;
factory LicenseExpirySummary.fromJson(Map<String, dynamic> json) =>
_$LicenseExpirySummaryFromJson(json);
}
@freezed
class LicenseExpiryDetail with _$LicenseExpiryDetail {
const factory LicenseExpiryDetail({
required int id,
@JsonKey(name: 'equipment_id') required int equipmentId,
@JsonKey(name: 'equipment_name') required String equipmentName,
@JsonKey(name: 'serial_number') required String serialNumber,
@JsonKey(name: 'company_name') required String companyName,
@JsonKey(name: 'license_type') required String licenseType,
@JsonKey(name: 'start_date') required String startDate,
@JsonKey(name: 'end_date') required String endDate,
@JsonKey(name: 'days_remaining') required int daysRemaining,
@JsonKey(name: 'is_expired') required bool isExpired,
}) = _LicenseExpiryDetail;
factory LicenseExpiryDetail.fromJson(Map<String, dynamic> json) =>
_$LicenseExpiryDetailFromJson(json);
}

View File

@@ -0,0 +1,690 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'license_expiry_summary.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
LicenseExpirySummary _$LicenseExpirySummaryFromJson(Map<String, dynamic> json) {
return _LicenseExpirySummary.fromJson(json);
}
/// @nodoc
mixin _$LicenseExpirySummary {
@JsonKey(name: 'within_30_days')
int get within30Days => throw _privateConstructorUsedError;
@JsonKey(name: 'within_60_days')
int get within60Days => throw _privateConstructorUsedError;
@JsonKey(name: 'within_90_days')
int get within90Days => throw _privateConstructorUsedError;
@JsonKey(name: 'expired')
int get expired => throw _privateConstructorUsedError;
@JsonKey(name: 'total_active')
int get totalActive => throw _privateConstructorUsedError;
@JsonKey(name: 'licenses')
List<LicenseExpiryDetail> get licenses => throw _privateConstructorUsedError;
/// Serializes this LicenseExpirySummary to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of LicenseExpirySummary
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$LicenseExpirySummaryCopyWith<LicenseExpirySummary> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $LicenseExpirySummaryCopyWith<$Res> {
factory $LicenseExpirySummaryCopyWith(LicenseExpirySummary value,
$Res Function(LicenseExpirySummary) then) =
_$LicenseExpirySummaryCopyWithImpl<$Res, LicenseExpirySummary>;
@useResult
$Res call(
{@JsonKey(name: 'within_30_days') int within30Days,
@JsonKey(name: 'within_60_days') int within60Days,
@JsonKey(name: 'within_90_days') int within90Days,
@JsonKey(name: 'expired') int expired,
@JsonKey(name: 'total_active') int totalActive,
@JsonKey(name: 'licenses') List<LicenseExpiryDetail> licenses});
}
/// @nodoc
class _$LicenseExpirySummaryCopyWithImpl<$Res,
$Val extends LicenseExpirySummary>
implements $LicenseExpirySummaryCopyWith<$Res> {
_$LicenseExpirySummaryCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of LicenseExpirySummary
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? within30Days = null,
Object? within60Days = null,
Object? within90Days = null,
Object? expired = null,
Object? totalActive = null,
Object? licenses = null,
}) {
return _then(_value.copyWith(
within30Days: null == within30Days
? _value.within30Days
: within30Days // ignore: cast_nullable_to_non_nullable
as int,
within60Days: null == within60Days
? _value.within60Days
: within60Days // ignore: cast_nullable_to_non_nullable
as int,
within90Days: null == within90Days
? _value.within90Days
: within90Days // ignore: cast_nullable_to_non_nullable
as int,
expired: null == expired
? _value.expired
: expired // ignore: cast_nullable_to_non_nullable
as int,
totalActive: null == totalActive
? _value.totalActive
: totalActive // ignore: cast_nullable_to_non_nullable
as int,
licenses: null == licenses
? _value.licenses
: licenses // ignore: cast_nullable_to_non_nullable
as List<LicenseExpiryDetail>,
) as $Val);
}
}
/// @nodoc
abstract class _$$LicenseExpirySummaryImplCopyWith<$Res>
implements $LicenseExpirySummaryCopyWith<$Res> {
factory _$$LicenseExpirySummaryImplCopyWith(_$LicenseExpirySummaryImpl value,
$Res Function(_$LicenseExpirySummaryImpl) then) =
__$$LicenseExpirySummaryImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{@JsonKey(name: 'within_30_days') int within30Days,
@JsonKey(name: 'within_60_days') int within60Days,
@JsonKey(name: 'within_90_days') int within90Days,
@JsonKey(name: 'expired') int expired,
@JsonKey(name: 'total_active') int totalActive,
@JsonKey(name: 'licenses') List<LicenseExpiryDetail> licenses});
}
/// @nodoc
class __$$LicenseExpirySummaryImplCopyWithImpl<$Res>
extends _$LicenseExpirySummaryCopyWithImpl<$Res, _$LicenseExpirySummaryImpl>
implements _$$LicenseExpirySummaryImplCopyWith<$Res> {
__$$LicenseExpirySummaryImplCopyWithImpl(_$LicenseExpirySummaryImpl _value,
$Res Function(_$LicenseExpirySummaryImpl) _then)
: super(_value, _then);
/// Create a copy of LicenseExpirySummary
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? within30Days = null,
Object? within60Days = null,
Object? within90Days = null,
Object? expired = null,
Object? totalActive = null,
Object? licenses = null,
}) {
return _then(_$LicenseExpirySummaryImpl(
within30Days: null == within30Days
? _value.within30Days
: within30Days // ignore: cast_nullable_to_non_nullable
as int,
within60Days: null == within60Days
? _value.within60Days
: within60Days // ignore: cast_nullable_to_non_nullable
as int,
within90Days: null == within90Days
? _value.within90Days
: within90Days // ignore: cast_nullable_to_non_nullable
as int,
expired: null == expired
? _value.expired
: expired // ignore: cast_nullable_to_non_nullable
as int,
totalActive: null == totalActive
? _value.totalActive
: totalActive // ignore: cast_nullable_to_non_nullable
as int,
licenses: null == licenses
? _value._licenses
: licenses // ignore: cast_nullable_to_non_nullable
as List<LicenseExpiryDetail>,
));
}
}
/// @nodoc
@JsonSerializable()
class _$LicenseExpirySummaryImpl implements _LicenseExpirySummary {
const _$LicenseExpirySummaryImpl(
{@JsonKey(name: 'within_30_days') required this.within30Days,
@JsonKey(name: 'within_60_days') required this.within60Days,
@JsonKey(name: 'within_90_days') required this.within90Days,
@JsonKey(name: 'expired') required this.expired,
@JsonKey(name: 'total_active') required this.totalActive,
@JsonKey(name: 'licenses')
required final List<LicenseExpiryDetail> licenses})
: _licenses = licenses;
factory _$LicenseExpirySummaryImpl.fromJson(Map<String, dynamic> json) =>
_$$LicenseExpirySummaryImplFromJson(json);
@override
@JsonKey(name: 'within_30_days')
final int within30Days;
@override
@JsonKey(name: 'within_60_days')
final int within60Days;
@override
@JsonKey(name: 'within_90_days')
final int within90Days;
@override
@JsonKey(name: 'expired')
final int expired;
@override
@JsonKey(name: 'total_active')
final int totalActive;
final List<LicenseExpiryDetail> _licenses;
@override
@JsonKey(name: 'licenses')
List<LicenseExpiryDetail> get licenses {
if (_licenses is EqualUnmodifiableListView) return _licenses;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_licenses);
}
@override
String toString() {
return 'LicenseExpirySummary(within30Days: $within30Days, within60Days: $within60Days, within90Days: $within90Days, expired: $expired, totalActive: $totalActive, licenses: $licenses)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$LicenseExpirySummaryImpl &&
(identical(other.within30Days, within30Days) ||
other.within30Days == within30Days) &&
(identical(other.within60Days, within60Days) ||
other.within60Days == within60Days) &&
(identical(other.within90Days, within90Days) ||
other.within90Days == within90Days) &&
(identical(other.expired, expired) || other.expired == expired) &&
(identical(other.totalActive, totalActive) ||
other.totalActive == totalActive) &&
const DeepCollectionEquality().equals(other._licenses, _licenses));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
within30Days,
within60Days,
within90Days,
expired,
totalActive,
const DeepCollectionEquality().hash(_licenses));
/// Create a copy of LicenseExpirySummary
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$LicenseExpirySummaryImplCopyWith<_$LicenseExpirySummaryImpl>
get copyWith =>
__$$LicenseExpirySummaryImplCopyWithImpl<_$LicenseExpirySummaryImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$LicenseExpirySummaryImplToJson(
this,
);
}
}
abstract class _LicenseExpirySummary implements LicenseExpirySummary {
const factory _LicenseExpirySummary(
{@JsonKey(name: 'within_30_days') required final int within30Days,
@JsonKey(name: 'within_60_days') required final int within60Days,
@JsonKey(name: 'within_90_days') required final int within90Days,
@JsonKey(name: 'expired') required final int expired,
@JsonKey(name: 'total_active') required final int totalActive,
@JsonKey(name: 'licenses')
required final List<LicenseExpiryDetail> licenses}) =
_$LicenseExpirySummaryImpl;
factory _LicenseExpirySummary.fromJson(Map<String, dynamic> json) =
_$LicenseExpirySummaryImpl.fromJson;
@override
@JsonKey(name: 'within_30_days')
int get within30Days;
@override
@JsonKey(name: 'within_60_days')
int get within60Days;
@override
@JsonKey(name: 'within_90_days')
int get within90Days;
@override
@JsonKey(name: 'expired')
int get expired;
@override
@JsonKey(name: 'total_active')
int get totalActive;
@override
@JsonKey(name: 'licenses')
List<LicenseExpiryDetail> get licenses;
/// Create a copy of LicenseExpirySummary
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$LicenseExpirySummaryImplCopyWith<_$LicenseExpirySummaryImpl>
get copyWith => throw _privateConstructorUsedError;
}
LicenseExpiryDetail _$LicenseExpiryDetailFromJson(Map<String, dynamic> json) {
return _LicenseExpiryDetail.fromJson(json);
}
/// @nodoc
mixin _$LicenseExpiryDetail {
int get id => throw _privateConstructorUsedError;
@JsonKey(name: 'equipment_id')
int get equipmentId => throw _privateConstructorUsedError;
@JsonKey(name: 'equipment_name')
String get equipmentName => throw _privateConstructorUsedError;
@JsonKey(name: 'serial_number')
String get serialNumber => throw _privateConstructorUsedError;
@JsonKey(name: 'company_name')
String get companyName => throw _privateConstructorUsedError;
@JsonKey(name: 'license_type')
String get licenseType => throw _privateConstructorUsedError;
@JsonKey(name: 'start_date')
String get startDate => throw _privateConstructorUsedError;
@JsonKey(name: 'end_date')
String get endDate => throw _privateConstructorUsedError;
@JsonKey(name: 'days_remaining')
int get daysRemaining => throw _privateConstructorUsedError;
@JsonKey(name: 'is_expired')
bool get isExpired => throw _privateConstructorUsedError;
/// Serializes this LicenseExpiryDetail to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
/// Create a copy of LicenseExpiryDetail
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$LicenseExpiryDetailCopyWith<LicenseExpiryDetail> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $LicenseExpiryDetailCopyWith<$Res> {
factory $LicenseExpiryDetailCopyWith(
LicenseExpiryDetail value, $Res Function(LicenseExpiryDetail) then) =
_$LicenseExpiryDetailCopyWithImpl<$Res, LicenseExpiryDetail>;
@useResult
$Res call(
{int id,
@JsonKey(name: 'equipment_id') int equipmentId,
@JsonKey(name: 'equipment_name') String equipmentName,
@JsonKey(name: 'serial_number') String serialNumber,
@JsonKey(name: 'company_name') String companyName,
@JsonKey(name: 'license_type') String licenseType,
@JsonKey(name: 'start_date') String startDate,
@JsonKey(name: 'end_date') String endDate,
@JsonKey(name: 'days_remaining') int daysRemaining,
@JsonKey(name: 'is_expired') bool isExpired});
}
/// @nodoc
class _$LicenseExpiryDetailCopyWithImpl<$Res, $Val extends LicenseExpiryDetail>
implements $LicenseExpiryDetailCopyWith<$Res> {
_$LicenseExpiryDetailCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of LicenseExpiryDetail
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? equipmentId = null,
Object? equipmentName = null,
Object? serialNumber = null,
Object? companyName = null,
Object? licenseType = null,
Object? startDate = null,
Object? endDate = null,
Object? daysRemaining = null,
Object? isExpired = null,
}) {
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
equipmentId: null == equipmentId
? _value.equipmentId
: equipmentId // ignore: cast_nullable_to_non_nullable
as int,
equipmentName: null == equipmentName
? _value.equipmentName
: equipmentName // ignore: cast_nullable_to_non_nullable
as String,
serialNumber: null == serialNumber
? _value.serialNumber
: serialNumber // ignore: cast_nullable_to_non_nullable
as String,
companyName: null == companyName
? _value.companyName
: companyName // ignore: cast_nullable_to_non_nullable
as String,
licenseType: null == licenseType
? _value.licenseType
: licenseType // ignore: cast_nullable_to_non_nullable
as String,
startDate: null == startDate
? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable
as String,
endDate: null == endDate
? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable
as String,
daysRemaining: null == daysRemaining
? _value.daysRemaining
: daysRemaining // ignore: cast_nullable_to_non_nullable
as int,
isExpired: null == isExpired
? _value.isExpired
: isExpired // ignore: cast_nullable_to_non_nullable
as bool,
) as $Val);
}
}
/// @nodoc
abstract class _$$LicenseExpiryDetailImplCopyWith<$Res>
implements $LicenseExpiryDetailCopyWith<$Res> {
factory _$$LicenseExpiryDetailImplCopyWith(_$LicenseExpiryDetailImpl value,
$Res Function(_$LicenseExpiryDetailImpl) then) =
__$$LicenseExpiryDetailImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{int id,
@JsonKey(name: 'equipment_id') int equipmentId,
@JsonKey(name: 'equipment_name') String equipmentName,
@JsonKey(name: 'serial_number') String serialNumber,
@JsonKey(name: 'company_name') String companyName,
@JsonKey(name: 'license_type') String licenseType,
@JsonKey(name: 'start_date') String startDate,
@JsonKey(name: 'end_date') String endDate,
@JsonKey(name: 'days_remaining') int daysRemaining,
@JsonKey(name: 'is_expired') bool isExpired});
}
/// @nodoc
class __$$LicenseExpiryDetailImplCopyWithImpl<$Res>
extends _$LicenseExpiryDetailCopyWithImpl<$Res, _$LicenseExpiryDetailImpl>
implements _$$LicenseExpiryDetailImplCopyWith<$Res> {
__$$LicenseExpiryDetailImplCopyWithImpl(_$LicenseExpiryDetailImpl _value,
$Res Function(_$LicenseExpiryDetailImpl) _then)
: super(_value, _then);
/// Create a copy of LicenseExpiryDetail
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? equipmentId = null,
Object? equipmentName = null,
Object? serialNumber = null,
Object? companyName = null,
Object? licenseType = null,
Object? startDate = null,
Object? endDate = null,
Object? daysRemaining = null,
Object? isExpired = null,
}) {
return _then(_$LicenseExpiryDetailImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as int,
equipmentId: null == equipmentId
? _value.equipmentId
: equipmentId // ignore: cast_nullable_to_non_nullable
as int,
equipmentName: null == equipmentName
? _value.equipmentName
: equipmentName // ignore: cast_nullable_to_non_nullable
as String,
serialNumber: null == serialNumber
? _value.serialNumber
: serialNumber // ignore: cast_nullable_to_non_nullable
as String,
companyName: null == companyName
? _value.companyName
: companyName // ignore: cast_nullable_to_non_nullable
as String,
licenseType: null == licenseType
? _value.licenseType
: licenseType // ignore: cast_nullable_to_non_nullable
as String,
startDate: null == startDate
? _value.startDate
: startDate // ignore: cast_nullable_to_non_nullable
as String,
endDate: null == endDate
? _value.endDate
: endDate // ignore: cast_nullable_to_non_nullable
as String,
daysRemaining: null == daysRemaining
? _value.daysRemaining
: daysRemaining // ignore: cast_nullable_to_non_nullable
as int,
isExpired: null == isExpired
? _value.isExpired
: isExpired // ignore: cast_nullable_to_non_nullable
as bool,
));
}
}
/// @nodoc
@JsonSerializable()
class _$LicenseExpiryDetailImpl implements _LicenseExpiryDetail {
const _$LicenseExpiryDetailImpl(
{required this.id,
@JsonKey(name: 'equipment_id') required this.equipmentId,
@JsonKey(name: 'equipment_name') required this.equipmentName,
@JsonKey(name: 'serial_number') required this.serialNumber,
@JsonKey(name: 'company_name') required this.companyName,
@JsonKey(name: 'license_type') required this.licenseType,
@JsonKey(name: 'start_date') required this.startDate,
@JsonKey(name: 'end_date') required this.endDate,
@JsonKey(name: 'days_remaining') required this.daysRemaining,
@JsonKey(name: 'is_expired') required this.isExpired});
factory _$LicenseExpiryDetailImpl.fromJson(Map<String, dynamic> json) =>
_$$LicenseExpiryDetailImplFromJson(json);
@override
final int id;
@override
@JsonKey(name: 'equipment_id')
final int equipmentId;
@override
@JsonKey(name: 'equipment_name')
final String equipmentName;
@override
@JsonKey(name: 'serial_number')
final String serialNumber;
@override
@JsonKey(name: 'company_name')
final String companyName;
@override
@JsonKey(name: 'license_type')
final String licenseType;
@override
@JsonKey(name: 'start_date')
final String startDate;
@override
@JsonKey(name: 'end_date')
final String endDate;
@override
@JsonKey(name: 'days_remaining')
final int daysRemaining;
@override
@JsonKey(name: 'is_expired')
final bool isExpired;
@override
String toString() {
return 'LicenseExpiryDetail(id: $id, equipmentId: $equipmentId, equipmentName: $equipmentName, serialNumber: $serialNumber, companyName: $companyName, licenseType: $licenseType, startDate: $startDate, endDate: $endDate, daysRemaining: $daysRemaining, isExpired: $isExpired)';
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$LicenseExpiryDetailImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.equipmentId, equipmentId) ||
other.equipmentId == equipmentId) &&
(identical(other.equipmentName, equipmentName) ||
other.equipmentName == equipmentName) &&
(identical(other.serialNumber, serialNumber) ||
other.serialNumber == serialNumber) &&
(identical(other.companyName, companyName) ||
other.companyName == companyName) &&
(identical(other.licenseType, licenseType) ||
other.licenseType == licenseType) &&
(identical(other.startDate, startDate) ||
other.startDate == startDate) &&
(identical(other.endDate, endDate) || other.endDate == endDate) &&
(identical(other.daysRemaining, daysRemaining) ||
other.daysRemaining == daysRemaining) &&
(identical(other.isExpired, isExpired) ||
other.isExpired == isExpired));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
id,
equipmentId,
equipmentName,
serialNumber,
companyName,
licenseType,
startDate,
endDate,
daysRemaining,
isExpired);
/// Create a copy of LicenseExpiryDetail
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$LicenseExpiryDetailImplCopyWith<_$LicenseExpiryDetailImpl> get copyWith =>
__$$LicenseExpiryDetailImplCopyWithImpl<_$LicenseExpiryDetailImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$LicenseExpiryDetailImplToJson(
this,
);
}
}
abstract class _LicenseExpiryDetail implements LicenseExpiryDetail {
const factory _LicenseExpiryDetail(
{required final int id,
@JsonKey(name: 'equipment_id') required final int equipmentId,
@JsonKey(name: 'equipment_name') required final String equipmentName,
@JsonKey(name: 'serial_number') required final String serialNumber,
@JsonKey(name: 'company_name') required final String companyName,
@JsonKey(name: 'license_type') required final String licenseType,
@JsonKey(name: 'start_date') required final String startDate,
@JsonKey(name: 'end_date') required final String endDate,
@JsonKey(name: 'days_remaining') required final int daysRemaining,
@JsonKey(name: 'is_expired') required final bool isExpired}) =
_$LicenseExpiryDetailImpl;
factory _LicenseExpiryDetail.fromJson(Map<String, dynamic> json) =
_$LicenseExpiryDetailImpl.fromJson;
@override
int get id;
@override
@JsonKey(name: 'equipment_id')
int get equipmentId;
@override
@JsonKey(name: 'equipment_name')
String get equipmentName;
@override
@JsonKey(name: 'serial_number')
String get serialNumber;
@override
@JsonKey(name: 'company_name')
String get companyName;
@override
@JsonKey(name: 'license_type')
String get licenseType;
@override
@JsonKey(name: 'start_date')
String get startDate;
@override
@JsonKey(name: 'end_date')
String get endDate;
@override
@JsonKey(name: 'days_remaining')
int get daysRemaining;
@override
@JsonKey(name: 'is_expired')
bool get isExpired;
/// Create a copy of LicenseExpiryDetail
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$LicenseExpiryDetailImplCopyWith<_$LicenseExpiryDetailImpl> get copyWith =>
throw _privateConstructorUsedError;
}

View File

@@ -0,0 +1,61 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'license_expiry_summary.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_$LicenseExpirySummaryImpl _$$LicenseExpirySummaryImplFromJson(
Map<String, dynamic> json) =>
_$LicenseExpirySummaryImpl(
within30Days: (json['within_30_days'] as num).toInt(),
within60Days: (json['within_60_days'] as num).toInt(),
within90Days: (json['within_90_days'] as num).toInt(),
expired: (json['expired'] as num).toInt(),
totalActive: (json['total_active'] as num).toInt(),
licenses: (json['licenses'] as List<dynamic>)
.map((e) => LicenseExpiryDetail.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$$LicenseExpirySummaryImplToJson(
_$LicenseExpirySummaryImpl instance) =>
<String, dynamic>{
'within_30_days': instance.within30Days,
'within_60_days': instance.within60Days,
'within_90_days': instance.within90Days,
'expired': instance.expired,
'total_active': instance.totalActive,
'licenses': instance.licenses,
};
_$LicenseExpiryDetailImpl _$$LicenseExpiryDetailImplFromJson(
Map<String, dynamic> json) =>
_$LicenseExpiryDetailImpl(
id: (json['id'] as num).toInt(),
equipmentId: (json['equipment_id'] as num).toInt(),
equipmentName: json['equipment_name'] as String,
serialNumber: json['serial_number'] as String,
companyName: json['company_name'] as String,
licenseType: json['license_type'] as String,
startDate: json['start_date'] as String,
endDate: json['end_date'] as String,
daysRemaining: (json['days_remaining'] as num).toInt(),
isExpired: json['is_expired'] as bool,
);
Map<String, dynamic> _$$LicenseExpiryDetailImplToJson(
_$LicenseExpiryDetailImpl instance) =>
<String, dynamic>{
'id': instance.id,
'equipment_id': instance.equipmentId,
'equipment_name': instance.equipmentName,
'serial_number': instance.serialNumber,
'company_name': instance.companyName,
'license_type': instance.licenseType,
'start_date': instance.startDate,
'end_date': instance.endDate,
'days_remaining': instance.daysRemaining,
'is_expired': instance.isExpired,
};