From 1b7033d35d394d1d6f3ab92ffbd96a0f11c7b00a Mon Sep 17 00:00:00 2001 From: JiWoong Sul Date: Mon, 29 Sep 2025 17:25:53 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B8=EB=B2=A4=ED=86=A0=EB=A6=AC=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=ED=95=9C=EA=B8=80=20=EC=A3=BC=EC=84=9D=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inventory/inbound/presentation/pages/inbound_page.dart | 6 ++++++ .../outbound/presentation/pages/outbound_page.dart | 4 ++++ .../inventory/rental/presentation/pages/rental_page.dart | 4 ++++ .../shared/widgets/product_autocomplete_field.dart | 4 ++++ 4 files changed, 18 insertions(+) diff --git a/lib/features/inventory/inbound/presentation/pages/inbound_page.dart b/lib/features/inventory/inbound/presentation/pages/inbound_page.dart index f144eda..738c5ca 100644 --- a/lib/features/inventory/inbound/presentation/pages/inbound_page.dart +++ b/lib/features/inventory/inbound/presentation/pages/inbound_page.dart @@ -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 createState() => _InboundPageState(); } +/// 입고 화면의 상태와 사용자 상호작용을 제어한다. class _InboundPageState extends State { final TextEditingController _searchController = TextEditingController(); final DateFormat _dateFormatter = DateFormat('yyyy-MM-dd'); @@ -800,6 +802,9 @@ class _InboundPageState extends State { return (totalItems / _pageSize).ceil(); } + /// 입고 등록/수정 모달을 띄우고 사용자가 입력한 결과를 반환한다. + /// + /// [initial] 값이 있으면 수정 모드로 작동하며, 입력 검증 실패 시 토스트로 안내한다. Future _showInboundFormDialog({ InboundRecord? initial, }) async { @@ -1540,6 +1545,7 @@ class _LineItemFieldErrors { } } +/// 입고 등록 폼 내용을 검증하고 오류 메시지를 반환한다. _InboundFormValidation _validateInboundForm({ required TextEditingController writerController, required String warehouseValue, diff --git a/lib/features/inventory/outbound/presentation/pages/outbound_page.dart b/lib/features/inventory/outbound/presentation/pages/outbound_page.dart index 44e8c5a..570bf81 100644 --- a/lib/features/inventory/outbound/presentation/pages/outbound_page.dart +++ b/lib/features/inventory/outbound/presentation/pages/outbound_page.dart @@ -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 createState() => _OutboundPageState(); } +/// 출고 화면의 상태와 사용자 인터랙션을 담당한다. class _OutboundPageState extends State { final TextEditingController _searchController = TextEditingController(); final DateFormat _dateFormatter = DateFormat('yyyy-MM-dd'); @@ -805,6 +807,7 @@ class _OutboundPageState extends State { return (totalItems / _pageSize).ceil(); } + /// 출고 등록/수정 모달을 표시하고 입력된 결과를 반환한다. Future _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, diff --git a/lib/features/inventory/rental/presentation/pages/rental_page.dart b/lib/features/inventory/rental/presentation/pages/rental_page.dart index 7ef9be2..3dba065 100644 --- a/lib/features/inventory/rental/presentation/pages/rental_page.dart +++ b/lib/features/inventory/rental/presentation/pages/rental_page.dart @@ -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 createState() => _RentalPageState(); } +/// 대여 화면의 상태를 관리하고 사용자 동작을 처리한다. class _RentalPageState extends State { final TextEditingController _searchController = TextEditingController(); final DateFormat _dateFormatter = DateFormat('yyyy-MM-dd'); @@ -889,6 +891,7 @@ class _RentalPageState extends State { : _rentalTransactionTypeRent; } + /// 대여 등록/수정 모달을 띄워 사용자가 입력한 레코드를 반환한다. Future _showRentalFormDialog({RentalRecord? initial}) async { final processedAt = ValueNotifier( initial?.processedAt ?? DateTime.now(), @@ -1850,6 +1853,7 @@ class RentalRecord { items.fold(0, (sum, item) => sum + (item.price * item.quantity)); } +/// 대여 폼의 필수 값 및 품목 조건을 검증한다. _RentalFormValidation _validateRentalForm({ required TextEditingController writerController, required String warehouseValue, diff --git a/lib/features/inventory/shared/widgets/product_autocomplete_field.dart b/lib/features/inventory/shared/widgets/product_autocomplete_field.dart index bcb5fa0..57512ac 100644 --- a/lib/features/inventory/shared/widgets/product_autocomplete_field.dart +++ b/lib/features/inventory/shared/widgets/product_autocomplete_field.dart @@ -27,6 +27,7 @@ class InventoryProductAutocompleteField extends StatefulWidget { _InventoryProductAutocompleteFieldState(); } +/// 자동완성 로직을 구현한 상태 클래스. class _InventoryProductAutocompleteFieldState extends State { 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 _options(String query) { return InventoryProductCatalog.filter(query); }