feat(approvals): 결재 접근 차단 대응과 전표 전이 메모 전달 강화
- approvals 모듈에서 APPROVAL_ACCESS_DENIED 응답을 포착하여 ApprovalAccessDeniedException으로 변환하고 접근 거부 시 토스트·대시보드 리다이렉트를 처리 - approval history 조회가 서버 action id에 맞춰 필터링되도록 repository·controller·테스트를 보강 - 재고 트랜잭션 상태 전이 API 호출에 note를 전달하도록 repository·컨트롤러·통합/단위 테스트를 업데이트 - 승인 플로우 QA 체크리스트 및 연동 문서를 최신 계약과 테스트 흐름으로 업데이트
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:intl/intl.dart' as intl;
|
||||
import 'package:lucide_icons_flutter/lucide_icons.dart' as lucide;
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
@@ -88,6 +89,7 @@ class _ApprovalEnabledPageState extends State<_ApprovalEnabledPage> {
|
||||
InventoryEmployeeSuggestion? _selectedRequester;
|
||||
final intl.DateFormat _dateTimeFormat = intl.DateFormat('yyyy-MM-dd HH:mm');
|
||||
String? _lastError;
|
||||
String? _lastAccessDeniedMessage;
|
||||
int? _selectedTemplateId;
|
||||
String? _pendingRouteSelection;
|
||||
|
||||
@@ -138,6 +140,21 @@ class _ApprovalEnabledPageState extends State<_ApprovalEnabledPage> {
|
||||
|
||||
void _handleControllerUpdate() {
|
||||
final error = _controller.errorMessage;
|
||||
if (_controller.isAccessDenied) {
|
||||
final message = _controller.accessDeniedMessage ?? '결재를 조회할 권한이 없습니다.';
|
||||
if (mounted) {
|
||||
if (_lastAccessDeniedMessage != message) {
|
||||
SuperportToast.warning(context, message);
|
||||
_lastAccessDeniedMessage = message;
|
||||
}
|
||||
final router = GoRouter.maybeOf(context);
|
||||
router?.go(dashboardRoutePath);
|
||||
}
|
||||
_controller.acknowledgeAccessDenied();
|
||||
return;
|
||||
} else {
|
||||
_lastAccessDeniedMessage = null;
|
||||
}
|
||||
if (error != null && error != _lastError && mounted) {
|
||||
_lastError = error;
|
||||
SuperportToast.error(context, error);
|
||||
|
||||
Reference in New Issue
Block a user