- 담당자 연락처 필드를 드롭다운 + 입력 방식으로 분리 - 사용자 폼과 동일한 전화번호 UI 패턴 적용 - 미사용 위젯 파일 4개 정리 (branch_card, contact_info_* 등) - 파일명 통일성 확보 (branch_edit_screen → branch_form, company_form_simplified → company_form) - 네이밍 일관성 개선으로 유지보수성 향상
120 lines
4.2 KiB
Dart
120 lines
4.2 KiB
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part 'warehouse_dto.freezed.dart';
|
|
part 'warehouse_dto.g.dart';
|
|
|
|
/// 창고 위치 생성 요청 DTO
|
|
@freezed
|
|
class CreateWarehouseLocationRequest with _$CreateWarehouseLocationRequest {
|
|
const factory CreateWarehouseLocationRequest({
|
|
required String name,
|
|
String? address,
|
|
@JsonKey(name: 'manager_name') String? managerName,
|
|
@JsonKey(name: 'manager_phone') String? managerPhone,
|
|
int? capacity,
|
|
String? remark,
|
|
}) = _CreateWarehouseLocationRequest;
|
|
|
|
factory CreateWarehouseLocationRequest.fromJson(Map<String, dynamic> json) =>
|
|
_$CreateWarehouseLocationRequestFromJson(json);
|
|
}
|
|
|
|
/// 창고 위치 수정 요청 DTO
|
|
@freezed
|
|
class UpdateWarehouseLocationRequest with _$UpdateWarehouseLocationRequest {
|
|
const factory UpdateWarehouseLocationRequest({
|
|
String? name,
|
|
String? address,
|
|
@JsonKey(name: 'manager_name') String? managerName,
|
|
@JsonKey(name: 'manager_phone') String? managerPhone,
|
|
int? capacity,
|
|
String? remark,
|
|
}) = _UpdateWarehouseLocationRequest;
|
|
|
|
factory UpdateWarehouseLocationRequest.fromJson(Map<String, dynamic> json) =>
|
|
_$UpdateWarehouseLocationRequestFromJson(json);
|
|
}
|
|
|
|
/// 창고 위치 응답 DTO
|
|
@freezed
|
|
class WarehouseLocationDto with _$WarehouseLocationDto {
|
|
const factory WarehouseLocationDto({
|
|
required int id,
|
|
required String name,
|
|
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,
|
|
}) = _WarehouseLocationDto;
|
|
|
|
factory WarehouseLocationDto.fromJson(Map<String, dynamic> json) =>
|
|
_$WarehouseLocationDtoFromJson(json);
|
|
}
|
|
|
|
/// 창고 위치 목록 응답 DTO
|
|
@freezed
|
|
class WarehouseLocationListDto with _$WarehouseLocationListDto {
|
|
const factory WarehouseLocationListDto({
|
|
required List<WarehouseLocationDto> items,
|
|
required int total,
|
|
required int page,
|
|
@JsonKey(name: 'per_page') required int perPage,
|
|
@JsonKey(name: 'total_pages') required int totalPages,
|
|
}) = _WarehouseLocationListDto;
|
|
|
|
factory WarehouseLocationListDto.fromJson(Map<String, dynamic> json) =>
|
|
_$WarehouseLocationListDtoFromJson(json);
|
|
}
|
|
|
|
/// 창고 용량 정보 DTO
|
|
@freezed
|
|
class WarehouseCapacityInfo with _$WarehouseCapacityInfo {
|
|
const factory WarehouseCapacityInfo({
|
|
@JsonKey(name: 'warehouse_id') required int warehouseId,
|
|
@JsonKey(name: 'total_capacity') required int totalCapacity,
|
|
@JsonKey(name: 'used_capacity') required int usedCapacity,
|
|
@JsonKey(name: 'available_capacity') required int availableCapacity,
|
|
@JsonKey(name: 'usage_percentage') required double usagePercentage,
|
|
@JsonKey(name: 'equipment_count') required int equipmentCount,
|
|
}) = _WarehouseCapacityInfo;
|
|
|
|
factory WarehouseCapacityInfo.fromJson(Map<String, dynamic> json) =>
|
|
_$WarehouseCapacityInfoFromJson(json);
|
|
}
|
|
|
|
/// 창고별 장비 목록 DTO
|
|
@freezed
|
|
class WarehouseEquipmentDto with _$WarehouseEquipmentDto {
|
|
const factory WarehouseEquipmentDto({
|
|
required int id,
|
|
@JsonKey(name: 'equipment_number') required String equipmentNumber,
|
|
String? manufacturer,
|
|
@JsonKey(name: 'equipment_name') String? equipmentName,
|
|
@JsonKey(name: 'serial_number') String? serialNumber,
|
|
required int quantity,
|
|
String? status,
|
|
@JsonKey(name: 'warehouse_location_id') required int warehouseLocationId,
|
|
@JsonKey(name: 'stored_at') required DateTime storedAt,
|
|
}) = _WarehouseEquipmentDto;
|
|
|
|
factory WarehouseEquipmentDto.fromJson(Map<String, dynamic> json) =>
|
|
_$WarehouseEquipmentDtoFromJson(json);
|
|
}
|
|
|
|
/// 창고별 장비 목록 응답 DTO
|
|
@freezed
|
|
class WarehouseEquipmentListDto with _$WarehouseEquipmentListDto {
|
|
const factory WarehouseEquipmentListDto({
|
|
required List<WarehouseEquipmentDto> items,
|
|
required int total,
|
|
required int page,
|
|
@JsonKey(name: 'per_page') required int perPage,
|
|
@JsonKey(name: 'total_pages') required int totalPages,
|
|
}) = _WarehouseEquipmentListDto;
|
|
|
|
factory WarehouseEquipmentListDto.fromJson(Map<String, dynamic> json) =>
|
|
_$WarehouseEquipmentListDtoFromJson(json);
|
|
} |