## 주요 변경사항 - Company, Equipment, License, Warehouse Location 모든 화면에 소프트 딜리트 구현 - 관리자 권한으로 삭제된 데이터 조회 가능 (includeInactive 파라미터) - 데이터 무결성 보장을 위한 논리 삭제 시스템 완성 ## 기능 개선 - 각 리스트 컨트롤러에 toggleIncludeInactive() 메서드 추가 - UI에 "비활성 포함" 체크박스 추가 (관리자 전용) - API 데이터소스에 includeInactive 파라미터 지원 ## 문서 정리 - 불필요한 문서 파일 제거 및 재구성 - CLAUDE.md 프로젝트 상태 업데이트 (진행률 80%) - 테스트 결과 문서화 (test20250812v01.md) ## UI 컴포넌트 - Equipment 화면 위젯 모듈화 (custom_dropdown_field, equipment_basic_info_section) - 폼 유효성 검증 강화 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
137 lines
4.7 KiB
Dart
137 lines
4.7 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,
|
|
String? city,
|
|
String? state,
|
|
@JsonKey(name: 'postal_code') String? postalCode,
|
|
String? country,
|
|
int? capacity,
|
|
@JsonKey(name: 'manager_id') int? managerId,
|
|
@JsonKey(name: 'company_id') int? companyId,
|
|
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,
|
|
String? city,
|
|
String? state,
|
|
@JsonKey(name: 'postal_code') String? postalCode,
|
|
String? country,
|
|
int? capacity,
|
|
@JsonKey(name: 'manager_id') int? managerId,
|
|
@JsonKey(name: 'is_active') bool? isActive,
|
|
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? code,
|
|
@JsonKey(name: 'manager_name') String? managerName,
|
|
@JsonKey(name: 'manager_phone') String? managerPhone,
|
|
int? capacity,
|
|
@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) =>
|
|
_$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);
|
|
} |