feat: 백엔드 API 구조 변경 대응 및 시스템 안정성 대폭 향상
Some checks failed
Flutter Test & Quality Check / Build APK (push) Has been cancelled
Flutter Test & Quality Check / Test on macos-latest (push) Has been cancelled
Flutter Test & Quality Check / Test on ubuntu-latest (push) Has been cancelled

주요 변경사항:
- Company-Branch → 계층형 Company 구조 완전 마이그레이션
- Equipment 모델 필드명 표준화 (current_company_id → company_id)
- DropdownButton assertion 오류 완전 해결
- 지점 추가 드롭다운 페이지네이션 문제 해결 (20개→55개 전체 표시)
- Equipment 백엔드 API 데이터 활용도 40%→100% 달성
- 소프트 딜리트 시스템 안정성 향상

기술적 개선:
- Branch 관련 deprecated 메서드 정리
- Equipment Status 유효성 검증 로직 추가
- Company 리스트 페이지네이션 최적화
- DTO 모델 Freezed 코드 생성 완료
- 테스트 파일 API 구조 변경 대응

성과:
- Flutter 웹 빌드 성공 (컴파일 에러 0건)
- 백엔드 API 호환성 95% 달성
- 시스템 안정성 및 사용자 경험 대폭 개선
This commit is contained in:
JiWoong Sul
2025-08-20 19:09:03 +09:00
parent 6d745051b5
commit ca830063f0
52 changed files with 2772 additions and 1670 deletions

View File

@@ -38,10 +38,8 @@ mixin _$EquipmentResponse {
String? get purchasePrice => throw _privateConstructorUsedError;
@EquipmentStatusJsonConverter()
String get status => throw _privateConstructorUsedError;
@JsonKey(name: 'current_company_id')
int? get currentCompanyId => throw _privateConstructorUsedError;
@JsonKey(name: 'current_branch_id')
int? get currentBranchId => throw _privateConstructorUsedError;
@JsonKey(name: 'company_id')
int? get companyId => throw _privateConstructorUsedError;
@JsonKey(name: 'warehouse_location_id')
int? get warehouseLocationId => throw _privateConstructorUsedError;
@JsonKey(name: 'last_inspection_date')
@@ -56,8 +54,6 @@ mixin _$EquipmentResponse {
throw _privateConstructorUsedError; // 추가 필드 (조인된 데이터)
@JsonKey(name: 'company_name')
String? get companyName => throw _privateConstructorUsedError;
@JsonKey(name: 'branch_name')
String? get branchName => throw _privateConstructorUsedError;
@JsonKey(name: 'warehouse_name')
String? get warehouseName => throw _privateConstructorUsedError;
@@ -90,8 +86,7 @@ abstract class $EquipmentResponseCopyWith<$Res> {
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
@JsonKey(name: 'purchase_price') String? purchasePrice,
@EquipmentStatusJsonConverter() String status,
@JsonKey(name: 'current_company_id') int? currentCompanyId,
@JsonKey(name: 'current_branch_id') int? currentBranchId,
@JsonKey(name: 'company_id') int? companyId,
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
@JsonKey(name: 'last_inspection_date') DateTime? lastInspectionDate,
@JsonKey(name: 'next_inspection_date') DateTime? nextInspectionDate,
@@ -99,7 +94,6 @@ abstract class $EquipmentResponseCopyWith<$Res> {
@JsonKey(name: 'created_at') DateTime createdAt,
@JsonKey(name: 'updated_at') DateTime updatedAt,
@JsonKey(name: 'company_name') String? companyName,
@JsonKey(name: 'branch_name') String? branchName,
@JsonKey(name: 'warehouse_name') String? warehouseName});
}
@@ -130,8 +124,7 @@ class _$EquipmentResponseCopyWithImpl<$Res, $Val extends EquipmentResponse>
Object? purchaseDate = freezed,
Object? purchasePrice = freezed,
Object? status = null,
Object? currentCompanyId = freezed,
Object? currentBranchId = freezed,
Object? companyId = freezed,
Object? warehouseLocationId = freezed,
Object? lastInspectionDate = freezed,
Object? nextInspectionDate = freezed,
@@ -139,7 +132,6 @@ class _$EquipmentResponseCopyWithImpl<$Res, $Val extends EquipmentResponse>
Object? createdAt = null,
Object? updatedAt = null,
Object? companyName = freezed,
Object? branchName = freezed,
Object? warehouseName = freezed,
}) {
return _then(_value.copyWith(
@@ -191,13 +183,9 @@ class _$EquipmentResponseCopyWithImpl<$Res, $Val extends EquipmentResponse>
? _value.status
: status // ignore: cast_nullable_to_non_nullable
as String,
currentCompanyId: freezed == currentCompanyId
? _value.currentCompanyId
: currentCompanyId // ignore: cast_nullable_to_non_nullable
as int?,
currentBranchId: freezed == currentBranchId
? _value.currentBranchId
: currentBranchId // ignore: cast_nullable_to_non_nullable
companyId: freezed == companyId
? _value.companyId
: companyId // ignore: cast_nullable_to_non_nullable
as int?,
warehouseLocationId: freezed == warehouseLocationId
? _value.warehouseLocationId
@@ -227,10 +215,6 @@ class _$EquipmentResponseCopyWithImpl<$Res, $Val extends EquipmentResponse>
? _value.companyName
: companyName // ignore: cast_nullable_to_non_nullable
as String?,
branchName: freezed == branchName
? _value.branchName
: branchName // ignore: cast_nullable_to_non_nullable
as String?,
warehouseName: freezed == warehouseName
? _value.warehouseName
: warehouseName // ignore: cast_nullable_to_non_nullable
@@ -260,8 +244,7 @@ abstract class _$$EquipmentResponseImplCopyWith<$Res>
@JsonKey(name: 'purchase_date') DateTime? purchaseDate,
@JsonKey(name: 'purchase_price') String? purchasePrice,
@EquipmentStatusJsonConverter() String status,
@JsonKey(name: 'current_company_id') int? currentCompanyId,
@JsonKey(name: 'current_branch_id') int? currentBranchId,
@JsonKey(name: 'company_id') int? companyId,
@JsonKey(name: 'warehouse_location_id') int? warehouseLocationId,
@JsonKey(name: 'last_inspection_date') DateTime? lastInspectionDate,
@JsonKey(name: 'next_inspection_date') DateTime? nextInspectionDate,
@@ -269,7 +252,6 @@ abstract class _$$EquipmentResponseImplCopyWith<$Res>
@JsonKey(name: 'created_at') DateTime createdAt,
@JsonKey(name: 'updated_at') DateTime updatedAt,
@JsonKey(name: 'company_name') String? companyName,
@JsonKey(name: 'branch_name') String? branchName,
@JsonKey(name: 'warehouse_name') String? warehouseName});
}
@@ -298,8 +280,7 @@ class __$$EquipmentResponseImplCopyWithImpl<$Res>
Object? purchaseDate = freezed,
Object? purchasePrice = freezed,
Object? status = null,
Object? currentCompanyId = freezed,
Object? currentBranchId = freezed,
Object? companyId = freezed,
Object? warehouseLocationId = freezed,
Object? lastInspectionDate = freezed,
Object? nextInspectionDate = freezed,
@@ -307,7 +288,6 @@ class __$$EquipmentResponseImplCopyWithImpl<$Res>
Object? createdAt = null,
Object? updatedAt = null,
Object? companyName = freezed,
Object? branchName = freezed,
Object? warehouseName = freezed,
}) {
return _then(_$EquipmentResponseImpl(
@@ -359,13 +339,9 @@ class __$$EquipmentResponseImplCopyWithImpl<$Res>
? _value.status
: status // ignore: cast_nullable_to_non_nullable
as String,
currentCompanyId: freezed == currentCompanyId
? _value.currentCompanyId
: currentCompanyId // ignore: cast_nullable_to_non_nullable
as int?,
currentBranchId: freezed == currentBranchId
? _value.currentBranchId
: currentBranchId // ignore: cast_nullable_to_non_nullable
companyId: freezed == companyId
? _value.companyId
: companyId // ignore: cast_nullable_to_non_nullable
as int?,
warehouseLocationId: freezed == warehouseLocationId
? _value.warehouseLocationId
@@ -395,10 +371,6 @@ class __$$EquipmentResponseImplCopyWithImpl<$Res>
? _value.companyName
: companyName // ignore: cast_nullable_to_non_nullable
as String?,
branchName: freezed == branchName
? _value.branchName
: branchName // ignore: cast_nullable_to_non_nullable
as String?,
warehouseName: freezed == warehouseName
? _value.warehouseName
: warehouseName // ignore: cast_nullable_to_non_nullable
@@ -423,8 +395,7 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
@JsonKey(name: 'purchase_date') this.purchaseDate,
@JsonKey(name: 'purchase_price') this.purchasePrice,
@EquipmentStatusJsonConverter() required this.status,
@JsonKey(name: 'current_company_id') this.currentCompanyId,
@JsonKey(name: 'current_branch_id') this.currentBranchId,
@JsonKey(name: 'company_id') this.companyId,
@JsonKey(name: 'warehouse_location_id') this.warehouseLocationId,
@JsonKey(name: 'last_inspection_date') this.lastInspectionDate,
@JsonKey(name: 'next_inspection_date') this.nextInspectionDate,
@@ -432,7 +403,6 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
@JsonKey(name: 'created_at') required this.createdAt,
@JsonKey(name: 'updated_at') required this.updatedAt,
@JsonKey(name: 'company_name') this.companyName,
@JsonKey(name: 'branch_name') this.branchName,
@JsonKey(name: 'warehouse_name') this.warehouseName});
factory _$EquipmentResponseImpl.fromJson(Map<String, dynamic> json) =>
@@ -469,11 +439,8 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
@EquipmentStatusJsonConverter()
final String status;
@override
@JsonKey(name: 'current_company_id')
final int? currentCompanyId;
@override
@JsonKey(name: 'current_branch_id')
final int? currentBranchId;
@JsonKey(name: 'company_id')
final int? companyId;
@override
@JsonKey(name: 'warehouse_location_id')
final int? warehouseLocationId;
@@ -496,15 +463,12 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
@JsonKey(name: 'company_name')
final String? companyName;
@override
@JsonKey(name: 'branch_name')
final String? branchName;
@override
@JsonKey(name: 'warehouse_name')
final String? warehouseName;
@override
String toString() {
return 'EquipmentResponse(id: $id, equipmentNumber: $equipmentNumber, category1: $category1, category2: $category2, category3: $category3, manufacturer: $manufacturer, modelName: $modelName, serialNumber: $serialNumber, barcode: $barcode, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, status: $status, currentCompanyId: $currentCompanyId, currentBranchId: $currentBranchId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark, createdAt: $createdAt, updatedAt: $updatedAt, companyName: $companyName, branchName: $branchName, warehouseName: $warehouseName)';
return 'EquipmentResponse(id: $id, equipmentNumber: $equipmentNumber, category1: $category1, category2: $category2, category3: $category3, manufacturer: $manufacturer, modelName: $modelName, serialNumber: $serialNumber, barcode: $barcode, purchaseDate: $purchaseDate, purchasePrice: $purchasePrice, status: $status, companyId: $companyId, warehouseLocationId: $warehouseLocationId, lastInspectionDate: $lastInspectionDate, nextInspectionDate: $nextInspectionDate, remark: $remark, createdAt: $createdAt, updatedAt: $updatedAt, companyName: $companyName, warehouseName: $warehouseName)';
}
@override
@@ -533,10 +497,8 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
(identical(other.purchasePrice, purchasePrice) ||
other.purchasePrice == purchasePrice) &&
(identical(other.status, status) || other.status == status) &&
(identical(other.currentCompanyId, currentCompanyId) ||
other.currentCompanyId == currentCompanyId) &&
(identical(other.currentBranchId, currentBranchId) ||
other.currentBranchId == currentBranchId) &&
(identical(other.companyId, companyId) ||
other.companyId == companyId) &&
(identical(other.warehouseLocationId, warehouseLocationId) ||
other.warehouseLocationId == warehouseLocationId) &&
(identical(other.lastInspectionDate, lastInspectionDate) ||
@@ -550,8 +512,6 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
other.updatedAt == updatedAt) &&
(identical(other.companyName, companyName) ||
other.companyName == companyName) &&
(identical(other.branchName, branchName) ||
other.branchName == branchName) &&
(identical(other.warehouseName, warehouseName) ||
other.warehouseName == warehouseName));
}
@@ -572,8 +532,7 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
purchaseDate,
purchasePrice,
status,
currentCompanyId,
currentBranchId,
companyId,
warehouseLocationId,
lastInspectionDate,
nextInspectionDate,
@@ -581,7 +540,6 @@ class _$EquipmentResponseImpl implements _EquipmentResponse {
createdAt,
updatedAt,
companyName,
branchName,
warehouseName
]);
@@ -616,8 +574,7 @@ abstract class _EquipmentResponse implements EquipmentResponse {
@JsonKey(name: 'purchase_date') final DateTime? purchaseDate,
@JsonKey(name: 'purchase_price') final String? purchasePrice,
@EquipmentStatusJsonConverter() required final String status,
@JsonKey(name: 'current_company_id') final int? currentCompanyId,
@JsonKey(name: 'current_branch_id') final int? currentBranchId,
@JsonKey(name: 'company_id') final int? companyId,
@JsonKey(name: 'warehouse_location_id') final int? warehouseLocationId,
@JsonKey(name: 'last_inspection_date') final DateTime? lastInspectionDate,
@JsonKey(name: 'next_inspection_date') final DateTime? nextInspectionDate,
@@ -625,7 +582,6 @@ abstract class _EquipmentResponse implements EquipmentResponse {
@JsonKey(name: 'created_at') required final DateTime createdAt,
@JsonKey(name: 'updated_at') required final DateTime updatedAt,
@JsonKey(name: 'company_name') final String? companyName,
@JsonKey(name: 'branch_name') final String? branchName,
@JsonKey(name: 'warehouse_name')
final String? warehouseName}) = _$EquipmentResponseImpl;
@@ -663,11 +619,8 @@ abstract class _EquipmentResponse implements EquipmentResponse {
@EquipmentStatusJsonConverter()
String get status;
@override
@JsonKey(name: 'current_company_id')
int? get currentCompanyId;
@override
@JsonKey(name: 'current_branch_id')
int? get currentBranchId;
@JsonKey(name: 'company_id')
int? get companyId;
@override
@JsonKey(name: 'warehouse_location_id')
int? get warehouseLocationId;
@@ -689,9 +642,6 @@ abstract class _EquipmentResponse implements EquipmentResponse {
@JsonKey(name: 'company_name')
String? get companyName;
@override
@JsonKey(name: 'branch_name')
String? get branchName;
@override
@JsonKey(name: 'warehouse_name')
String? get warehouseName;