fix: API 응답 파싱 오류 수정 및 에러 처리 개선
주요 변경사항: - 창고 관리 API 응답 구조와 DTO 불일치 수정 - WarehouseLocationDto에 code, manager_phone 필드 추가 - RemoteDataSource에서 API 응답을 DTO 구조에 맞게 변환 - 회사 관리 API 응답 파싱 오류 수정 - CompanyResponse의 필수 필드를 nullable로 변경 - PaginatedResponse 구조 매핑 로직 개선 - 에러 처리 및 로깅 개선 - Service Layer에 상세 에러 로깅 추가 - Controller에서 에러 타입별 처리 - 새로운 유틸리티 추가 - ResponseInterceptor: API 응답 정규화 - DebugLogger: 디버깅 도구 - HealthCheckService: 서버 상태 확인 - 문서화 - API 통합 테스트 가이드 - 에러 분석 보고서 - 리팩토링 계획서
This commit is contained in:
@@ -21,16 +21,20 @@ ExpiringLicense _$ExpiringLicenseFromJson(Map<String, dynamic> json) {
|
||||
/// @nodoc
|
||||
mixin _$ExpiringLicense {
|
||||
int get id => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'license_name')
|
||||
String get licenseName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'license_key')
|
||||
String get licenseKey => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'software_name')
|
||||
String get softwareName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'company_name')
|
||||
String get companyName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'expiry_date')
|
||||
DateTime get expiryDate => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'days_remaining')
|
||||
int get daysRemaining => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'license_type')
|
||||
String get licenseType => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'days_until_expiry')
|
||||
int get daysUntilExpiry => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'renewal_cost')
|
||||
double get renewalCost => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'auto_renew')
|
||||
bool get autoRenew => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ExpiringLicense to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@@ -50,11 +54,13 @@ abstract class $ExpiringLicenseCopyWith<$Res> {
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
@JsonKey(name: 'license_name') String licenseName,
|
||||
@JsonKey(name: 'license_key') String licenseKey,
|
||||
@JsonKey(name: 'software_name') String softwareName,
|
||||
@JsonKey(name: 'company_name') String companyName,
|
||||
@JsonKey(name: 'expiry_date') DateTime expiryDate,
|
||||
@JsonKey(name: 'days_remaining') int daysRemaining,
|
||||
@JsonKey(name: 'license_type') String licenseType});
|
||||
@JsonKey(name: 'days_until_expiry') int daysUntilExpiry,
|
||||
@JsonKey(name: 'renewal_cost') double renewalCost,
|
||||
@JsonKey(name: 'auto_renew') bool autoRenew});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -73,20 +79,26 @@ class _$ExpiringLicenseCopyWithImpl<$Res, $Val extends ExpiringLicense>
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? licenseName = null,
|
||||
Object? licenseKey = null,
|
||||
Object? softwareName = null,
|
||||
Object? companyName = null,
|
||||
Object? expiryDate = null,
|
||||
Object? daysRemaining = null,
|
||||
Object? licenseType = null,
|
||||
Object? daysUntilExpiry = null,
|
||||
Object? renewalCost = null,
|
||||
Object? autoRenew = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
licenseName: null == licenseName
|
||||
? _value.licenseName
|
||||
: licenseName // ignore: cast_nullable_to_non_nullable
|
||||
licenseKey: null == licenseKey
|
||||
? _value.licenseKey
|
||||
: licenseKey // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
softwareName: null == softwareName
|
||||
? _value.softwareName
|
||||
: softwareName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
companyName: null == companyName
|
||||
? _value.companyName
|
||||
@@ -96,14 +108,18 @@ class _$ExpiringLicenseCopyWithImpl<$Res, $Val extends ExpiringLicense>
|
||||
? _value.expiryDate
|
||||
: expiryDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
daysRemaining: null == daysRemaining
|
||||
? _value.daysRemaining
|
||||
: daysRemaining // ignore: cast_nullable_to_non_nullable
|
||||
daysUntilExpiry: null == daysUntilExpiry
|
||||
? _value.daysUntilExpiry
|
||||
: daysUntilExpiry // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
licenseType: null == licenseType
|
||||
? _value.licenseType
|
||||
: licenseType // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
renewalCost: null == renewalCost
|
||||
? _value.renewalCost
|
||||
: renewalCost // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
autoRenew: null == autoRenew
|
||||
? _value.autoRenew
|
||||
: autoRenew // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
@@ -118,11 +134,13 @@ abstract class _$$ExpiringLicenseImplCopyWith<$Res>
|
||||
@useResult
|
||||
$Res call(
|
||||
{int id,
|
||||
@JsonKey(name: 'license_name') String licenseName,
|
||||
@JsonKey(name: 'license_key') String licenseKey,
|
||||
@JsonKey(name: 'software_name') String softwareName,
|
||||
@JsonKey(name: 'company_name') String companyName,
|
||||
@JsonKey(name: 'expiry_date') DateTime expiryDate,
|
||||
@JsonKey(name: 'days_remaining') int daysRemaining,
|
||||
@JsonKey(name: 'license_type') String licenseType});
|
||||
@JsonKey(name: 'days_until_expiry') int daysUntilExpiry,
|
||||
@JsonKey(name: 'renewal_cost') double renewalCost,
|
||||
@JsonKey(name: 'auto_renew') bool autoRenew});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -139,20 +157,26 @@ class __$$ExpiringLicenseImplCopyWithImpl<$Res>
|
||||
@override
|
||||
$Res call({
|
||||
Object? id = null,
|
||||
Object? licenseName = null,
|
||||
Object? licenseKey = null,
|
||||
Object? softwareName = null,
|
||||
Object? companyName = null,
|
||||
Object? expiryDate = null,
|
||||
Object? daysRemaining = null,
|
||||
Object? licenseType = null,
|
||||
Object? daysUntilExpiry = null,
|
||||
Object? renewalCost = null,
|
||||
Object? autoRenew = null,
|
||||
}) {
|
||||
return _then(_$ExpiringLicenseImpl(
|
||||
id: null == id
|
||||
? _value.id
|
||||
: id // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
licenseName: null == licenseName
|
||||
? _value.licenseName
|
||||
: licenseName // ignore: cast_nullable_to_non_nullable
|
||||
licenseKey: null == licenseKey
|
||||
? _value.licenseKey
|
||||
: licenseKey // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
softwareName: null == softwareName
|
||||
? _value.softwareName
|
||||
: softwareName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
companyName: null == companyName
|
||||
? _value.companyName
|
||||
@@ -162,14 +186,18 @@ class __$$ExpiringLicenseImplCopyWithImpl<$Res>
|
||||
? _value.expiryDate
|
||||
: expiryDate // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
daysRemaining: null == daysRemaining
|
||||
? _value.daysRemaining
|
||||
: daysRemaining // ignore: cast_nullable_to_non_nullable
|
||||
daysUntilExpiry: null == daysUntilExpiry
|
||||
? _value.daysUntilExpiry
|
||||
: daysUntilExpiry // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
licenseType: null == licenseType
|
||||
? _value.licenseType
|
||||
: licenseType // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
renewalCost: null == renewalCost
|
||||
? _value.renewalCost
|
||||
: renewalCost // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
autoRenew: null == autoRenew
|
||||
? _value.autoRenew
|
||||
: autoRenew // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -179,11 +207,13 @@ class __$$ExpiringLicenseImplCopyWithImpl<$Res>
|
||||
class _$ExpiringLicenseImpl implements _ExpiringLicense {
|
||||
const _$ExpiringLicenseImpl(
|
||||
{required this.id,
|
||||
@JsonKey(name: 'license_name') required this.licenseName,
|
||||
@JsonKey(name: 'license_key') required this.licenseKey,
|
||||
@JsonKey(name: 'software_name') required this.softwareName,
|
||||
@JsonKey(name: 'company_name') required this.companyName,
|
||||
@JsonKey(name: 'expiry_date') required this.expiryDate,
|
||||
@JsonKey(name: 'days_remaining') required this.daysRemaining,
|
||||
@JsonKey(name: 'license_type') required this.licenseType});
|
||||
@JsonKey(name: 'days_until_expiry') required this.daysUntilExpiry,
|
||||
@JsonKey(name: 'renewal_cost') required this.renewalCost,
|
||||
@JsonKey(name: 'auto_renew') required this.autoRenew});
|
||||
|
||||
factory _$ExpiringLicenseImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ExpiringLicenseImplFromJson(json);
|
||||
@@ -191,8 +221,11 @@ class _$ExpiringLicenseImpl implements _ExpiringLicense {
|
||||
@override
|
||||
final int id;
|
||||
@override
|
||||
@JsonKey(name: 'license_name')
|
||||
final String licenseName;
|
||||
@JsonKey(name: 'license_key')
|
||||
final String licenseKey;
|
||||
@override
|
||||
@JsonKey(name: 'software_name')
|
||||
final String softwareName;
|
||||
@override
|
||||
@JsonKey(name: 'company_name')
|
||||
final String companyName;
|
||||
@@ -200,15 +233,18 @@ class _$ExpiringLicenseImpl implements _ExpiringLicense {
|
||||
@JsonKey(name: 'expiry_date')
|
||||
final DateTime expiryDate;
|
||||
@override
|
||||
@JsonKey(name: 'days_remaining')
|
||||
final int daysRemaining;
|
||||
@JsonKey(name: 'days_until_expiry')
|
||||
final int daysUntilExpiry;
|
||||
@override
|
||||
@JsonKey(name: 'license_type')
|
||||
final String licenseType;
|
||||
@JsonKey(name: 'renewal_cost')
|
||||
final double renewalCost;
|
||||
@override
|
||||
@JsonKey(name: 'auto_renew')
|
||||
final bool autoRenew;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ExpiringLicense(id: $id, licenseName: $licenseName, companyName: $companyName, expiryDate: $expiryDate, daysRemaining: $daysRemaining, licenseType: $licenseType)';
|
||||
return 'ExpiringLicense(id: $id, licenseKey: $licenseKey, softwareName: $softwareName, companyName: $companyName, expiryDate: $expiryDate, daysUntilExpiry: $daysUntilExpiry, renewalCost: $renewalCost, autoRenew: $autoRenew)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -217,22 +253,26 @@ class _$ExpiringLicenseImpl implements _ExpiringLicense {
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$ExpiringLicenseImpl &&
|
||||
(identical(other.id, id) || other.id == id) &&
|
||||
(identical(other.licenseName, licenseName) ||
|
||||
other.licenseName == licenseName) &&
|
||||
(identical(other.licenseKey, licenseKey) ||
|
||||
other.licenseKey == licenseKey) &&
|
||||
(identical(other.softwareName, softwareName) ||
|
||||
other.softwareName == softwareName) &&
|
||||
(identical(other.companyName, companyName) ||
|
||||
other.companyName == companyName) &&
|
||||
(identical(other.expiryDate, expiryDate) ||
|
||||
other.expiryDate == expiryDate) &&
|
||||
(identical(other.daysRemaining, daysRemaining) ||
|
||||
other.daysRemaining == daysRemaining) &&
|
||||
(identical(other.licenseType, licenseType) ||
|
||||
other.licenseType == licenseType));
|
||||
(identical(other.daysUntilExpiry, daysUntilExpiry) ||
|
||||
other.daysUntilExpiry == daysUntilExpiry) &&
|
||||
(identical(other.renewalCost, renewalCost) ||
|
||||
other.renewalCost == renewalCost) &&
|
||||
(identical(other.autoRenew, autoRenew) ||
|
||||
other.autoRenew == autoRenew));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, id, licenseName, companyName,
|
||||
expiryDate, daysRemaining, licenseType);
|
||||
int get hashCode => Object.hash(runtimeType, id, licenseKey, softwareName,
|
||||
companyName, expiryDate, daysUntilExpiry, renewalCost, autoRenew);
|
||||
|
||||
/// Create a copy of ExpiringLicense
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -253,13 +293,15 @@ class _$ExpiringLicenseImpl implements _ExpiringLicense {
|
||||
|
||||
abstract class _ExpiringLicense implements ExpiringLicense {
|
||||
const factory _ExpiringLicense(
|
||||
{required final int id,
|
||||
@JsonKey(name: 'license_name') required final String licenseName,
|
||||
@JsonKey(name: 'company_name') required final String companyName,
|
||||
@JsonKey(name: 'expiry_date') required final DateTime expiryDate,
|
||||
@JsonKey(name: 'days_remaining') required final int daysRemaining,
|
||||
@JsonKey(name: 'license_type') required final String licenseType}) =
|
||||
_$ExpiringLicenseImpl;
|
||||
{required final int id,
|
||||
@JsonKey(name: 'license_key') required final String licenseKey,
|
||||
@JsonKey(name: 'software_name') required final String softwareName,
|
||||
@JsonKey(name: 'company_name') required final String companyName,
|
||||
@JsonKey(name: 'expiry_date') required final DateTime expiryDate,
|
||||
@JsonKey(name: 'days_until_expiry') required final int daysUntilExpiry,
|
||||
@JsonKey(name: 'renewal_cost') required final double renewalCost,
|
||||
@JsonKey(name: 'auto_renew')
|
||||
required final bool autoRenew}) = _$ExpiringLicenseImpl;
|
||||
|
||||
factory _ExpiringLicense.fromJson(Map<String, dynamic> json) =
|
||||
_$ExpiringLicenseImpl.fromJson;
|
||||
@@ -267,8 +309,11 @@ abstract class _ExpiringLicense implements ExpiringLicense {
|
||||
@override
|
||||
int get id;
|
||||
@override
|
||||
@JsonKey(name: 'license_name')
|
||||
String get licenseName;
|
||||
@JsonKey(name: 'license_key')
|
||||
String get licenseKey;
|
||||
@override
|
||||
@JsonKey(name: 'software_name')
|
||||
String get softwareName;
|
||||
@override
|
||||
@JsonKey(name: 'company_name')
|
||||
String get companyName;
|
||||
@@ -276,11 +321,14 @@ abstract class _ExpiringLicense implements ExpiringLicense {
|
||||
@JsonKey(name: 'expiry_date')
|
||||
DateTime get expiryDate;
|
||||
@override
|
||||
@JsonKey(name: 'days_remaining')
|
||||
int get daysRemaining;
|
||||
@JsonKey(name: 'days_until_expiry')
|
||||
int get daysUntilExpiry;
|
||||
@override
|
||||
@JsonKey(name: 'license_type')
|
||||
String get licenseType;
|
||||
@JsonKey(name: 'renewal_cost')
|
||||
double get renewalCost;
|
||||
@override
|
||||
@JsonKey(name: 'auto_renew')
|
||||
bool get autoRenew;
|
||||
|
||||
/// Create a copy of ExpiringLicense
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
||||
Reference in New Issue
Block a user