feat: 라이선스 및 창고 관리 API 연동 구현
- 라이선스 관리 API 연동 완료 - LicenseRemoteDataSource, LicenseService 구현 - LicenseListController, LicenseFormController API 연동 - 페이지네이션, 검색, 필터링 기능 추가 - 라이선스 할당/해제 기능 구현 - 창고 관리 API 연동 완료 - WarehouseRemoteDataSource, WarehouseService 구현 - WarehouseLocationListController, WarehouseLocationFormController API 연동 - 창고별 장비 조회 및 용량 관리 기능 추가 - DI 컨테이너에 새로운 서비스 등록 - API 통합 문서 업데이트 (전체 진행률 100% 달성)
This commit is contained in:
132
lib/data/models/warehouse/warehouse_dto.dart
Normal file
132
lib/data/models/warehouse/warehouse_dto.dart
Normal file
@@ -0,0 +1,132 @@
|
||||
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,
|
||||
}) = _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,
|
||||
}) = _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,
|
||||
String? city,
|
||||
String? state,
|
||||
@JsonKey(name: 'postal_code') String? postalCode,
|
||||
String? country,
|
||||
int? capacity,
|
||||
@JsonKey(name: 'manager_id') int? managerId,
|
||||
@JsonKey(name: 'manager_name') String? managerName,
|
||||
@JsonKey(name: 'is_active') required bool isActive,
|
||||
@JsonKey(name: 'created_at') required DateTime createdAt,
|
||||
@JsonKey(name: 'updated_at') required 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);
|
||||
}
|
||||
Reference in New Issue
Block a user