인벤토리 화면 한글 주석 추가

This commit is contained in:
JiWoong Sul
2025-09-29 17:25:53 +09:00
parent 2a0db08079
commit 1b7033d35d
4 changed files with 18 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ import 'package:superport_v2/core/permissions/permission_manager.dart';
const String _inboundTransactionTypeId = '입고';
/// 입고 목록과 상세/등록 모달을 관리하는 화면.
class InboundPage extends StatefulWidget {
const InboundPage({super.key, required this.routeUri});
@@ -27,6 +28,7 @@ class InboundPage extends StatefulWidget {
State<InboundPage> createState() => _InboundPageState();
}
/// 입고 화면의 상태와 사용자 상호작용을 제어한다.
class _InboundPageState extends State<InboundPage> {
final TextEditingController _searchController = TextEditingController();
final DateFormat _dateFormatter = DateFormat('yyyy-MM-dd');
@@ -800,6 +802,9 @@ class _InboundPageState extends State<InboundPage> {
return (totalItems / _pageSize).ceil();
}
/// 입고 등록/수정 모달을 띄우고 사용자가 입력한 결과를 반환한다.
///
/// [initial] 값이 있으면 수정 모드로 작동하며, 입력 검증 실패 시 토스트로 안내한다.
Future<InboundRecord?> _showInboundFormDialog({
InboundRecord? initial,
}) async {
@@ -1540,6 +1545,7 @@ class _LineItemFieldErrors {
}
}
/// 입고 등록 폼 내용을 검증하고 오류 메시지를 반환한다.
_InboundFormValidation _validateInboundForm({
required TextEditingController writerController,
required String warehouseValue,

View File

@@ -16,6 +16,7 @@ import 'package:superport_v2/core/permissions/permission_manager.dart';
const String _outboundTransactionTypeId = '출고';
/// 출고 목록과 등록/수정 모달을 관리하는 페이지.
class OutboundPage extends StatefulWidget {
const OutboundPage({super.key, required this.routeUri});
@@ -25,6 +26,7 @@ class OutboundPage extends StatefulWidget {
State<OutboundPage> createState() => _OutboundPageState();
}
/// 출고 화면의 상태와 사용자 인터랙션을 담당한다.
class _OutboundPageState extends State<OutboundPage> {
final TextEditingController _searchController = TextEditingController();
final DateFormat _dateFormatter = DateFormat('yyyy-MM-dd');
@@ -805,6 +807,7 @@ class _OutboundPageState extends State<OutboundPage> {
return (totalItems / _pageSize).ceil();
}
/// 출고 등록/수정 모달을 표시하고 입력된 결과를 반환한다.
Future<OutboundRecord?> _showOutboundFormDialog({
OutboundRecord? initial,
}) async {
@@ -1624,6 +1627,7 @@ double _parseCurrency(String input) {
return double.tryParse(normalized.isEmpty ? '0' : normalized) ?? 0;
}
/// 출고 폼의 필수 입력 및 품목 조건을 검증한다.
_OutboundFormValidation _validateOutboundForm({
required TextEditingController writerController,
required String warehouseValue,

View File

@@ -18,6 +18,7 @@ import 'package:superport_v2/core/permissions/permission_manager.dart';
const String _rentalTransactionTypeRent = '대여';
const String _rentalTransactionTypeReturn = '반납';
/// 대여/반납 목록과 등록 모달을 관리하는 페이지.
class RentalPage extends StatefulWidget {
const RentalPage({super.key, required this.routeUri});
@@ -27,6 +28,7 @@ class RentalPage extends StatefulWidget {
State<RentalPage> createState() => _RentalPageState();
}
/// 대여 화면의 상태를 관리하고 사용자 동작을 처리한다.
class _RentalPageState extends State<RentalPage> {
final TextEditingController _searchController = TextEditingController();
final DateFormat _dateFormatter = DateFormat('yyyy-MM-dd');
@@ -889,6 +891,7 @@ class _RentalPageState extends State<RentalPage> {
: _rentalTransactionTypeRent;
}
/// 대여 등록/수정 모달을 띄워 사용자가 입력한 레코드를 반환한다.
Future<RentalRecord?> _showRentalFormDialog({RentalRecord? initial}) async {
final processedAt = ValueNotifier<DateTime>(
initial?.processedAt ?? DateTime.now(),
@@ -1850,6 +1853,7 @@ class RentalRecord {
items.fold<double>(0, (sum, item) => sum + (item.price * item.quantity));
}
/// 대여 폼의 필수 값 및 품목 조건을 검증한다.
_RentalFormValidation _validateRentalForm({
required TextEditingController writerController,
required String warehouseValue,

View File

@@ -27,6 +27,7 @@ class InventoryProductAutocompleteField extends StatefulWidget {
_InventoryProductAutocompleteFieldState();
}
/// 자동완성 로직을 구현한 상태 클래스.
class _InventoryProductAutocompleteFieldState
extends State<InventoryProductAutocompleteField> {
InventoryProductCatalogItem? _catalogMatch;
@@ -58,6 +59,7 @@ class _InventoryProductAutocompleteFieldState
}
}
/// 텍스트 입력 변화를 감지해 자동완성 결과를 적용한다.
void _handleTextChanged() {
final text = widget.productController.text.trim();
final match = InventoryProductCatalog.match(text);
@@ -80,6 +82,7 @@ class _InventoryProductAutocompleteFieldState
widget.onChanged?.call();
}
/// 선택된 카탈로그 정보를 관련 필드에 적용한다.
void _applyCatalog(
InventoryProductCatalogItem match, {
bool updateProduct = true,
@@ -103,6 +106,7 @@ class _InventoryProductAutocompleteFieldState
widget.onChanged?.call();
}
/// 주어진 검색어에 매칭되는 제품 목록을 반환한다.
Iterable<InventoryProductCatalogItem> _options(String query) {
return InventoryProductCatalog.filter(query);
}