refactor: 회사 폼 UI 개선 및 코드 정리
- 담당자 연락처 필드를 드롭다운 + 입력 방식으로 분리 - 사용자 폼과 동일한 전화번호 UI 패턴 적용 - 미사용 위젯 파일 4개 정리 (branch_card, contact_info_* 등) - 파일명 통일성 확보 (branch_edit_screen → branch_form, company_form_simplified → company_form) - 네이밍 일관성 개선으로 유지보수성 향상
This commit is contained in:
@@ -6,7 +6,6 @@ import 'package:superport/core/errors/failures.dart';
|
||||
import 'package:superport/data/datasources/remote/warehouse_remote_datasource.dart';
|
||||
import 'package:superport/data/models/common/paginated_response.dart';
|
||||
import 'package:superport/data/models/warehouse/warehouse_dto.dart';
|
||||
import 'package:superport/models/address_model.dart';
|
||||
import 'package:superport/models/warehouse_location_model.dart';
|
||||
|
||||
@lazySingleton
|
||||
@@ -66,10 +65,10 @@ class WarehouseService {
|
||||
try {
|
||||
final request = CreateWarehouseLocationRequest(
|
||||
name: location.name,
|
||||
address: location.address.detailAddress,
|
||||
city: location.address.region,
|
||||
postalCode: location.address.zipCode,
|
||||
country: 'KR', // 기본값
|
||||
address: location.address, // 단일 문자열 주소
|
||||
managerName: location.managerName,
|
||||
managerPhone: location.managerPhone,
|
||||
capacity: location.capacity,
|
||||
remark: location.remark,
|
||||
);
|
||||
|
||||
@@ -87,10 +86,10 @@ class WarehouseService {
|
||||
try {
|
||||
final request = UpdateWarehouseLocationRequest(
|
||||
name: location.name,
|
||||
address: location.address.detailAddress,
|
||||
city: location.address.region,
|
||||
postalCode: location.address.zipCode,
|
||||
country: 'KR', // country 필드 추가
|
||||
address: location.address, // 단일 문자열 주소
|
||||
managerName: location.managerName,
|
||||
managerPhone: location.managerPhone,
|
||||
capacity: location.capacity,
|
||||
remark: location.remark,
|
||||
);
|
||||
|
||||
@@ -167,32 +166,18 @@ class WarehouseService {
|
||||
}
|
||||
}
|
||||
|
||||
// DTO를 Flutter 모델로 변환
|
||||
// DTO를 Flutter 모델로 변환 (백엔드 API 호환)
|
||||
WarehouseLocation _convertDtoToWarehouseLocation(WarehouseLocationDto dto) {
|
||||
// API에 주소 정보가 없으므로 기본값 사용
|
||||
final address = Address(
|
||||
zipCode: dto.postalCode ?? '',
|
||||
region: dto.city ?? '',
|
||||
detailAddress: dto.address ?? '주소 정보 없음',
|
||||
);
|
||||
|
||||
// 담당자 정보 조합
|
||||
final remarkParts = <String>[];
|
||||
if (dto.code != null) {
|
||||
remarkParts.add('코드: ${dto.code}');
|
||||
}
|
||||
if (dto.managerName != null) {
|
||||
remarkParts.add('담당자: ${dto.managerName}');
|
||||
}
|
||||
if (dto.managerPhone != null) {
|
||||
remarkParts.add('연락처: ${dto.managerPhone}');
|
||||
}
|
||||
|
||||
return WarehouseLocation(
|
||||
id: dto.id,
|
||||
name: dto.name,
|
||||
address: address,
|
||||
remark: remarkParts.isNotEmpty ? remarkParts.join(', ') : null,
|
||||
address: dto.address, // 단일 문자열 주소
|
||||
managerName: dto.managerName,
|
||||
managerPhone: dto.managerPhone,
|
||||
capacity: dto.capacity,
|
||||
remark: dto.remark,
|
||||
isActive: dto.isActive,
|
||||
createdAt: dto.createdAt,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user