refactor: 회사 폼 UI 개선 및 코드 정리
- 담당자 연락처 필드를 드롭다운 + 입력 방식으로 분리 - 사용자 폼과 동일한 전화번호 UI 패턴 적용 - 미사용 위젯 파일 4개 정리 (branch_card, contact_info_* 등) - 파일명 통일성 확보 (branch_edit_screen → branch_form, company_form_simplified → company_form) - 네이밍 일관성 개선으로 유지보수성 향상
This commit is contained in:
@@ -3,7 +3,6 @@ import 'package:injectable/injectable.dart';
|
||||
import '../../core/errors/failures.dart';
|
||||
import '../../domain/repositories/warehouse_location_repository.dart';
|
||||
import '../../models/warehouse_location_model.dart';
|
||||
import '../../models/address_model.dart';
|
||||
import '../datasources/remote/warehouse_location_remote_datasource.dart';
|
||||
import '../models/common/paginated_response.dart';
|
||||
import '../models/warehouse/warehouse_dto.dart';
|
||||
@@ -307,12 +306,13 @@ class WarehouseLocationRepositoryImpl implements WarehouseLocationRepository {
|
||||
return WarehouseLocation(
|
||||
id: dto.id,
|
||||
name: dto.name,
|
||||
// String? address를 Address 객체로 변환
|
||||
address: dto.address != null && dto.address!.isNotEmpty
|
||||
? Address.fromFullAddress(dto.address!)
|
||||
: const Address(),
|
||||
// DTO에 없는 필드는 remark로 통합 (WarehouseLocation 모델의 실제 필드)
|
||||
remark: null, // DTO에는 description이나 remark 필드가 없음
|
||||
address: dto.address, // 단일 String 필드
|
||||
managerName: dto.managerName,
|
||||
managerPhone: dto.managerPhone,
|
||||
capacity: dto.capacity,
|
||||
remark: dto.remark,
|
||||
isActive: dto.isActive,
|
||||
createdAt: dto.createdAt,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -320,12 +320,13 @@ class WarehouseLocationRepositoryImpl implements WarehouseLocationRepository {
|
||||
return WarehouseLocation(
|
||||
id: dto.id,
|
||||
name: dto.name,
|
||||
// String? address를 Address 객체로 변환
|
||||
address: dto.address != null && dto.address!.isNotEmpty
|
||||
? Address.fromFullAddress(dto.address!)
|
||||
: const Address(),
|
||||
// DTO에 없는 필드는 remark로 통합 (WarehouseLocation 모델의 실제 필드)
|
||||
remark: null, // DTO에는 description이나 remark 필드가 없음
|
||||
address: dto.address, // 단일 String 필드
|
||||
managerName: dto.managerName,
|
||||
managerPhone: dto.managerPhone,
|
||||
capacity: dto.capacity,
|
||||
remark: dto.remark,
|
||||
isActive: dto.isActive,
|
||||
createdAt: dto.createdAt,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -335,25 +336,22 @@ class WarehouseLocationRepositoryImpl implements WarehouseLocationRepository {
|
||||
CreateWarehouseLocationRequest _mapDomainToCreateRequest(WarehouseLocation warehouseLocation) {
|
||||
return CreateWarehouseLocationRequest(
|
||||
name: warehouseLocation.name,
|
||||
// Address 객체를 String으로 변환
|
||||
address: warehouseLocation.address.toString(),
|
||||
// DTO 요청에 없는 필드들은 제거하고 DTO에 있는 필드만 매핑
|
||||
// capacity는 DTO에 있지만 모델에 없으므로 기본값 사용
|
||||
capacity: 0,
|
||||
// 나머지 필드들도 DTO 구조에 맞게 조정
|
||||
address: warehouseLocation.address,
|
||||
managerName: warehouseLocation.managerName,
|
||||
managerPhone: warehouseLocation.managerPhone,
|
||||
capacity: warehouseLocation.capacity,
|
||||
remark: warehouseLocation.remark,
|
||||
);
|
||||
}
|
||||
|
||||
UpdateWarehouseLocationRequest _mapDomainToUpdateRequest(WarehouseLocation warehouseLocation) {
|
||||
return UpdateWarehouseLocationRequest(
|
||||
name: warehouseLocation.name,
|
||||
// Address 객체를 String으로 변환
|
||||
address: warehouseLocation.address.toString(),
|
||||
// DTO 요청에 없는 필드들은 제거하고 DTO에 있는 필드만 매핑
|
||||
// capacity는 DTO에 있지만 모델에 없으므로 기본값 사용
|
||||
capacity: 0,
|
||||
// isActive는 DTO에 있지만 모델에 없으므로 기본값 true 사용
|
||||
isActive: true,
|
||||
address: warehouseLocation.address,
|
||||
managerName: warehouseLocation.managerName,
|
||||
managerPhone: warehouseLocation.managerPhone,
|
||||
capacity: warehouseLocation.capacity,
|
||||
remark: warehouseLocation.remark,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user