refactor: 회사 폼 UI 개선 및 코드 정리
- 담당자 연락처 필드를 드롭다운 + 입력 방식으로 분리 - 사용자 폼과 동일한 전화번호 UI 패턴 적용 - 미사용 위젯 파일 4개 정리 (branch_card, contact_info_* 등) - 파일명 통일성 확보 (branch_edit_screen → branch_form, company_form_simplified → company_form) - 네이밍 일관성 개선으로 유지보수성 향상
This commit is contained in:
@@ -9,13 +9,9 @@ class CreateWarehouseLocationRequest with _$CreateWarehouseLocationRequest {
|
||||
const factory CreateWarehouseLocationRequest({
|
||||
required String name,
|
||||
String? address,
|
||||
String? city,
|
||||
String? state,
|
||||
@JsonKey(name: 'postal_code') String? postalCode,
|
||||
String? country,
|
||||
@JsonKey(name: 'manager_name') String? managerName,
|
||||
@JsonKey(name: 'manager_phone') String? managerPhone,
|
||||
int? capacity,
|
||||
@JsonKey(name: 'manager_id') int? managerId,
|
||||
@JsonKey(name: 'company_id') int? companyId,
|
||||
String? remark,
|
||||
}) = _CreateWarehouseLocationRequest;
|
||||
|
||||
@@ -29,13 +25,9 @@ class UpdateWarehouseLocationRequest with _$UpdateWarehouseLocationRequest {
|
||||
const factory UpdateWarehouseLocationRequest({
|
||||
String? name,
|
||||
String? address,
|
||||
String? city,
|
||||
String? state,
|
||||
@JsonKey(name: 'postal_code') String? postalCode,
|
||||
String? country,
|
||||
@JsonKey(name: 'manager_name') String? managerName,
|
||||
@JsonKey(name: 'manager_phone') String? managerPhone,
|
||||
int? capacity,
|
||||
@JsonKey(name: 'manager_id') int? managerId,
|
||||
@JsonKey(name: 'is_active') bool? isActive,
|
||||
String? remark,
|
||||
}) = _UpdateWarehouseLocationRequest;
|
||||
|
||||
@@ -49,22 +41,13 @@ class WarehouseLocationDto with _$WarehouseLocationDto {
|
||||
const factory WarehouseLocationDto({
|
||||
required int id,
|
||||
required String name,
|
||||
String? code,
|
||||
String? address,
|
||||
@JsonKey(name: 'manager_name') String? managerName,
|
||||
@JsonKey(name: 'manager_phone') String? managerPhone,
|
||||
int? capacity,
|
||||
String? remark,
|
||||
@JsonKey(name: 'is_active') required bool isActive,
|
||||
@JsonKey(name: 'created_at') required DateTime createdAt,
|
||||
// API에 없는 필드들은 nullable로 변경
|
||||
String? address,
|
||||
String? city,
|
||||
String? state,
|
||||
@JsonKey(name: 'postal_code') String? postalCode,
|
||||
String? country,
|
||||
@JsonKey(name: 'manager_id') int? managerId,
|
||||
@JsonKey(name: 'updated_at') DateTime? updatedAt,
|
||||
@JsonKey(name: 'current_stock') int? currentStock,
|
||||
@JsonKey(name: 'available_capacity') int? availableCapacity,
|
||||
}) = _WarehouseLocationDto;
|
||||
|
||||
factory WarehouseLocationDto.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -11,13 +11,9 @@ _$CreateWarehouseLocationRequestImpl
|
||||
_$CreateWarehouseLocationRequestImpl(
|
||||
name: json['name'] as String,
|
||||
address: json['address'] as String?,
|
||||
city: json['city'] as String?,
|
||||
state: json['state'] as String?,
|
||||
postalCode: json['postal_code'] as String?,
|
||||
country: json['country'] as String?,
|
||||
managerName: json['manager_name'] as String?,
|
||||
managerPhone: json['manager_phone'] as String?,
|
||||
capacity: (json['capacity'] as num?)?.toInt(),
|
||||
managerId: (json['manager_id'] as num?)?.toInt(),
|
||||
companyId: (json['company_id'] as num?)?.toInt(),
|
||||
remark: json['remark'] as String?,
|
||||
);
|
||||
|
||||
@@ -26,13 +22,9 @@ Map<String, dynamic> _$$CreateWarehouseLocationRequestImplToJson(
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
'address': instance.address,
|
||||
'city': instance.city,
|
||||
'state': instance.state,
|
||||
'postal_code': instance.postalCode,
|
||||
'country': instance.country,
|
||||
'manager_name': instance.managerName,
|
||||
'manager_phone': instance.managerPhone,
|
||||
'capacity': instance.capacity,
|
||||
'manager_id': instance.managerId,
|
||||
'company_id': instance.companyId,
|
||||
'remark': instance.remark,
|
||||
};
|
||||
|
||||
@@ -41,13 +33,9 @@ _$UpdateWarehouseLocationRequestImpl
|
||||
_$UpdateWarehouseLocationRequestImpl(
|
||||
name: json['name'] as String?,
|
||||
address: json['address'] as String?,
|
||||
city: json['city'] as String?,
|
||||
state: json['state'] as String?,
|
||||
postalCode: json['postal_code'] as String?,
|
||||
country: json['country'] as String?,
|
||||
managerName: json['manager_name'] as String?,
|
||||
managerPhone: json['manager_phone'] as String?,
|
||||
capacity: (json['capacity'] as num?)?.toInt(),
|
||||
managerId: (json['manager_id'] as num?)?.toInt(),
|
||||
isActive: json['is_active'] as bool?,
|
||||
remark: json['remark'] as String?,
|
||||
);
|
||||
|
||||
@@ -56,13 +44,9 @@ Map<String, dynamic> _$$UpdateWarehouseLocationRequestImplToJson(
|
||||
<String, dynamic>{
|
||||
'name': instance.name,
|
||||
'address': instance.address,
|
||||
'city': instance.city,
|
||||
'state': instance.state,
|
||||
'postal_code': instance.postalCode,
|
||||
'country': instance.country,
|
||||
'manager_name': instance.managerName,
|
||||
'manager_phone': instance.managerPhone,
|
||||
'capacity': instance.capacity,
|
||||
'manager_id': instance.managerId,
|
||||
'is_active': instance.isActive,
|
||||
'remark': instance.remark,
|
||||
};
|
||||
|
||||
@@ -71,23 +55,13 @@ _$WarehouseLocationDtoImpl _$$WarehouseLocationDtoImplFromJson(
|
||||
_$WarehouseLocationDtoImpl(
|
||||
id: (json['id'] as num).toInt(),
|
||||
name: json['name'] as String,
|
||||
code: json['code'] as String?,
|
||||
address: json['address'] as String?,
|
||||
managerName: json['manager_name'] as String?,
|
||||
managerPhone: json['manager_phone'] as String?,
|
||||
capacity: (json['capacity'] as num?)?.toInt(),
|
||||
remark: json['remark'] as String?,
|
||||
isActive: json['is_active'] as bool,
|
||||
createdAt: DateTime.parse(json['created_at'] as String),
|
||||
address: json['address'] as String?,
|
||||
city: json['city'] as String?,
|
||||
state: json['state'] as String?,
|
||||
postalCode: json['postal_code'] as String?,
|
||||
country: json['country'] as String?,
|
||||
managerId: (json['manager_id'] as num?)?.toInt(),
|
||||
updatedAt: json['updated_at'] == null
|
||||
? null
|
||||
: DateTime.parse(json['updated_at'] as String),
|
||||
currentStock: (json['current_stock'] as num?)?.toInt(),
|
||||
availableCapacity: (json['available_capacity'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$WarehouseLocationDtoImplToJson(
|
||||
@@ -95,21 +69,13 @@ Map<String, dynamic> _$$WarehouseLocationDtoImplToJson(
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'code': instance.code,
|
||||
'address': instance.address,
|
||||
'manager_name': instance.managerName,
|
||||
'manager_phone': instance.managerPhone,
|
||||
'capacity': instance.capacity,
|
||||
'remark': instance.remark,
|
||||
'is_active': instance.isActive,
|
||||
'created_at': instance.createdAt.toIso8601String(),
|
||||
'address': instance.address,
|
||||
'city': instance.city,
|
||||
'state': instance.state,
|
||||
'postal_code': instance.postalCode,
|
||||
'country': instance.country,
|
||||
'manager_id': instance.managerId,
|
||||
'updated_at': instance.updatedAt?.toIso8601String(),
|
||||
'current_stock': instance.currentStock,
|
||||
'available_capacity': instance.availableCapacity,
|
||||
};
|
||||
|
||||
_$WarehouseLocationListDtoImpl _$$WarehouseLocationListDtoImplFromJson(
|
||||
|
||||
Reference in New Issue
Block a user