backup: 사용하지 않는 파일 삭제 전 복구 지점
- 전체 371개 파일 중 82개 미사용 파일 식별 - Phase 1: 33개 파일 삭제 예정 (100% 안전) - Phase 2: 30개 파일 삭제 검토 예정 - Phase 3: 19개 파일 수동 검토 예정 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:superport/data/models/equipment_history_dto.dart';
|
||||
import 'package:superport/data/models/stock_status_dto.dart';
|
||||
import 'package:superport/domain/usecases/equipment_history_usecase.dart';
|
||||
import 'package:superport/services/equipment_history_service.dart';
|
||||
import 'package:superport/injection_container.dart';
|
||||
import 'package:superport/utils/constants.dart';
|
||||
import 'package:superport/core/constants/app_constants.dart';
|
||||
|
||||
class EquipmentHistoryController extends ChangeNotifier {
|
||||
final EquipmentHistoryUseCase _useCase = getIt<EquipmentHistoryUseCase>();
|
||||
final EquipmentHistoryService _service = EquipmentHistoryService();
|
||||
|
||||
// 상태 관리
|
||||
bool _isLoading = false;
|
||||
@@ -15,9 +18,10 @@ class EquipmentHistoryController extends ChangeNotifier {
|
||||
|
||||
// 데이터 (백엔드 스키마 기반)
|
||||
List<EquipmentHistoryDto> _histories = [];
|
||||
List<StockStatusDto> _stockStatus = [];
|
||||
int _totalCount = 0;
|
||||
int _currentPage = 1;
|
||||
final int _pageSize = PaginationConstants.defaultPageSize;
|
||||
final int _pageSize = AppConstants.historyPageSize;
|
||||
|
||||
// 필터
|
||||
int? _filterEquipmentId;
|
||||
@@ -34,6 +38,7 @@ class EquipmentHistoryController extends ChangeNotifier {
|
||||
String? get errorMessage => _errorMessage;
|
||||
String? get successMessage => _successMessage;
|
||||
List<EquipmentHistoryDto> get histories => _histories;
|
||||
List<StockStatusDto> get stockStatus => _stockStatus;
|
||||
int get totalCount => _totalCount;
|
||||
int get currentPage => _currentPage;
|
||||
int get pageSize => _pageSize;
|
||||
@@ -271,6 +276,23 @@ class EquipmentHistoryController extends ChangeNotifier {
|
||||
};
|
||||
}
|
||||
|
||||
/// 재고 현황 조회 (핵심 기능)
|
||||
Future<void> loadStockStatus() async {
|
||||
_isLoading = true;
|
||||
_errorMessage = null;
|
||||
notifyListeners();
|
||||
|
||||
try {
|
||||
_stockStatus = await _service.getStockStatus();
|
||||
} catch (e) {
|
||||
_errorMessage = e.toString();
|
||||
_stockStatus = [];
|
||||
} finally {
|
||||
_isLoading = false;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
// 메시지 클리어
|
||||
void clearMessages() {
|
||||
_errorMessage = null;
|
||||
@@ -281,6 +303,7 @@ class EquipmentHistoryController extends ChangeNotifier {
|
||||
@override
|
||||
void dispose() {
|
||||
_histories.clear();
|
||||
_stockStatus.clear();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user