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:
@@ -719,7 +719,8 @@ mixin _$CompanyResponse {
|
||||
@JsonKey(name: 'contact_name')
|
||||
String get contactName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'contact_position')
|
||||
String get contactPosition => throw _privateConstructorUsedError;
|
||||
String? get contactPosition =>
|
||||
throw _privateConstructorUsedError; // nullable로 변경
|
||||
@JsonKey(name: 'contact_phone')
|
||||
String get contactPhone => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'contact_email')
|
||||
@@ -732,7 +733,7 @@ mixin _$CompanyResponse {
|
||||
@JsonKey(name: 'created_at')
|
||||
DateTime get createdAt => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'updated_at')
|
||||
DateTime get updatedAt => throw _privateConstructorUsedError;
|
||||
DateTime? get updatedAt => throw _privateConstructorUsedError; // nullable로 변경
|
||||
@JsonKey(name: 'address_id')
|
||||
int? get addressId => throw _privateConstructorUsedError;
|
||||
|
||||
@@ -757,14 +758,14 @@ abstract class $CompanyResponseCopyWith<$Res> {
|
||||
String name,
|
||||
String address,
|
||||
@JsonKey(name: 'contact_name') String contactName,
|
||||
@JsonKey(name: 'contact_position') String contactPosition,
|
||||
@JsonKey(name: 'contact_position') String? contactPosition,
|
||||
@JsonKey(name: 'contact_phone') String contactPhone,
|
||||
@JsonKey(name: 'contact_email') String contactEmail,
|
||||
@JsonKey(name: 'company_types') List<String> companyTypes,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_active') bool isActive,
|
||||
@JsonKey(name: 'created_at') DateTime createdAt,
|
||||
@JsonKey(name: 'updated_at') DateTime updatedAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt,
|
||||
@JsonKey(name: 'address_id') int? addressId});
|
||||
}
|
||||
|
||||
@@ -787,14 +788,14 @@ class _$CompanyResponseCopyWithImpl<$Res, $Val extends CompanyResponse>
|
||||
Object? name = null,
|
||||
Object? address = null,
|
||||
Object? contactName = null,
|
||||
Object? contactPosition = null,
|
||||
Object? contactPosition = freezed,
|
||||
Object? contactPhone = null,
|
||||
Object? contactEmail = null,
|
||||
Object? companyTypes = null,
|
||||
Object? remark = freezed,
|
||||
Object? isActive = null,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
Object? updatedAt = freezed,
|
||||
Object? addressId = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
@@ -814,10 +815,10 @@ class _$CompanyResponseCopyWithImpl<$Res, $Val extends CompanyResponse>
|
||||
? _value.contactName
|
||||
: contactName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
contactPosition: null == contactPosition
|
||||
contactPosition: freezed == contactPosition
|
||||
? _value.contactPosition
|
||||
: contactPosition // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as String?,
|
||||
contactPhone: null == contactPhone
|
||||
? _value.contactPhone
|
||||
: contactPhone // ignore: cast_nullable_to_non_nullable
|
||||
@@ -842,10 +843,10 @@ class _$CompanyResponseCopyWithImpl<$Res, $Val extends CompanyResponse>
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
updatedAt: null == updatedAt
|
||||
updatedAt: freezed == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
as DateTime?,
|
||||
addressId: freezed == addressId
|
||||
? _value.addressId
|
||||
: addressId // ignore: cast_nullable_to_non_nullable
|
||||
@@ -867,14 +868,14 @@ abstract class _$$CompanyResponseImplCopyWith<$Res>
|
||||
String name,
|
||||
String address,
|
||||
@JsonKey(name: 'contact_name') String contactName,
|
||||
@JsonKey(name: 'contact_position') String contactPosition,
|
||||
@JsonKey(name: 'contact_position') String? contactPosition,
|
||||
@JsonKey(name: 'contact_phone') String contactPhone,
|
||||
@JsonKey(name: 'contact_email') String contactEmail,
|
||||
@JsonKey(name: 'company_types') List<String> companyTypes,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_active') bool isActive,
|
||||
@JsonKey(name: 'created_at') DateTime createdAt,
|
||||
@JsonKey(name: 'updated_at') DateTime updatedAt,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt,
|
||||
@JsonKey(name: 'address_id') int? addressId});
|
||||
}
|
||||
|
||||
@@ -895,14 +896,14 @@ class __$$CompanyResponseImplCopyWithImpl<$Res>
|
||||
Object? name = null,
|
||||
Object? address = null,
|
||||
Object? contactName = null,
|
||||
Object? contactPosition = null,
|
||||
Object? contactPosition = freezed,
|
||||
Object? contactPhone = null,
|
||||
Object? contactEmail = null,
|
||||
Object? companyTypes = null,
|
||||
Object? remark = freezed,
|
||||
Object? isActive = null,
|
||||
Object? createdAt = null,
|
||||
Object? updatedAt = null,
|
||||
Object? updatedAt = freezed,
|
||||
Object? addressId = freezed,
|
||||
}) {
|
||||
return _then(_$CompanyResponseImpl(
|
||||
@@ -922,10 +923,10 @@ class __$$CompanyResponseImplCopyWithImpl<$Res>
|
||||
? _value.contactName
|
||||
: contactName // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
contactPosition: null == contactPosition
|
||||
contactPosition: freezed == contactPosition
|
||||
? _value.contactPosition
|
||||
: contactPosition // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
as String?,
|
||||
contactPhone: null == contactPhone
|
||||
? _value.contactPhone
|
||||
: contactPhone // ignore: cast_nullable_to_non_nullable
|
||||
@@ -950,10 +951,10 @@ class __$$CompanyResponseImplCopyWithImpl<$Res>
|
||||
? _value.createdAt
|
||||
: createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
updatedAt: null == updatedAt
|
||||
updatedAt: freezed == updatedAt
|
||||
? _value.updatedAt
|
||||
: updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime,
|
||||
as DateTime?,
|
||||
addressId: freezed == addressId
|
||||
? _value.addressId
|
||||
: addressId // ignore: cast_nullable_to_non_nullable
|
||||
@@ -970,7 +971,7 @@ class _$CompanyResponseImpl implements _CompanyResponse {
|
||||
required this.name,
|
||||
required this.address,
|
||||
@JsonKey(name: 'contact_name') required this.contactName,
|
||||
@JsonKey(name: 'contact_position') required this.contactPosition,
|
||||
@JsonKey(name: 'contact_position') this.contactPosition,
|
||||
@JsonKey(name: 'contact_phone') required this.contactPhone,
|
||||
@JsonKey(name: 'contact_email') required this.contactEmail,
|
||||
@JsonKey(name: 'company_types')
|
||||
@@ -978,7 +979,7 @@ class _$CompanyResponseImpl implements _CompanyResponse {
|
||||
this.remark,
|
||||
@JsonKey(name: 'is_active') required this.isActive,
|
||||
@JsonKey(name: 'created_at') required this.createdAt,
|
||||
@JsonKey(name: 'updated_at') required this.updatedAt,
|
||||
@JsonKey(name: 'updated_at') this.updatedAt,
|
||||
@JsonKey(name: 'address_id') this.addressId})
|
||||
: _companyTypes = companyTypes;
|
||||
|
||||
@@ -996,7 +997,8 @@ class _$CompanyResponseImpl implements _CompanyResponse {
|
||||
final String contactName;
|
||||
@override
|
||||
@JsonKey(name: 'contact_position')
|
||||
final String contactPosition;
|
||||
final String? contactPosition;
|
||||
// nullable로 변경
|
||||
@override
|
||||
@JsonKey(name: 'contact_phone')
|
||||
final String contactPhone;
|
||||
@@ -1022,7 +1024,8 @@ class _$CompanyResponseImpl implements _CompanyResponse {
|
||||
final DateTime createdAt;
|
||||
@override
|
||||
@JsonKey(name: 'updated_at')
|
||||
final DateTime updatedAt;
|
||||
final DateTime? updatedAt;
|
||||
// nullable로 변경
|
||||
@override
|
||||
@JsonKey(name: 'address_id')
|
||||
final int? addressId;
|
||||
@@ -1098,20 +1101,20 @@ class _$CompanyResponseImpl implements _CompanyResponse {
|
||||
|
||||
abstract class _CompanyResponse implements CompanyResponse {
|
||||
const factory _CompanyResponse(
|
||||
{required final int id,
|
||||
required final String name,
|
||||
required final String address,
|
||||
@JsonKey(name: 'contact_name') required final String contactName,
|
||||
@JsonKey(name: 'contact_position') required final String contactPosition,
|
||||
@JsonKey(name: 'contact_phone') required final String contactPhone,
|
||||
@JsonKey(name: 'contact_email') required final String contactEmail,
|
||||
@JsonKey(name: 'company_types') final List<String> companyTypes,
|
||||
final String? remark,
|
||||
@JsonKey(name: 'is_active') required final bool isActive,
|
||||
@JsonKey(name: 'created_at') required final DateTime createdAt,
|
||||
@JsonKey(name: 'updated_at') required final DateTime updatedAt,
|
||||
@JsonKey(name: 'address_id')
|
||||
final int? addressId}) = _$CompanyResponseImpl;
|
||||
{required final int id,
|
||||
required final String name,
|
||||
required final String address,
|
||||
@JsonKey(name: 'contact_name') required final String contactName,
|
||||
@JsonKey(name: 'contact_position') final String? contactPosition,
|
||||
@JsonKey(name: 'contact_phone') required final String contactPhone,
|
||||
@JsonKey(name: 'contact_email') required final String contactEmail,
|
||||
@JsonKey(name: 'company_types') final List<String> companyTypes,
|
||||
final String? remark,
|
||||
@JsonKey(name: 'is_active') required final bool isActive,
|
||||
@JsonKey(name: 'created_at') required final DateTime createdAt,
|
||||
@JsonKey(name: 'updated_at') final DateTime? updatedAt,
|
||||
@JsonKey(name: 'address_id') final int? addressId}) =
|
||||
_$CompanyResponseImpl;
|
||||
|
||||
factory _CompanyResponse.fromJson(Map<String, dynamic> json) =
|
||||
_$CompanyResponseImpl.fromJson;
|
||||
@@ -1127,7 +1130,7 @@ abstract class _CompanyResponse implements CompanyResponse {
|
||||
String get contactName;
|
||||
@override
|
||||
@JsonKey(name: 'contact_position')
|
||||
String get contactPosition;
|
||||
String? get contactPosition; // nullable로 변경
|
||||
@override
|
||||
@JsonKey(name: 'contact_phone')
|
||||
String get contactPhone;
|
||||
@@ -1147,7 +1150,7 @@ abstract class _CompanyResponse implements CompanyResponse {
|
||||
DateTime get createdAt;
|
||||
@override
|
||||
@JsonKey(name: 'updated_at')
|
||||
DateTime get updatedAt;
|
||||
DateTime? get updatedAt; // nullable로 변경
|
||||
@override
|
||||
@JsonKey(name: 'address_id')
|
||||
int? get addressId;
|
||||
|
||||
Reference in New Issue
Block a user