feat(approvals): Approval Flow v2 프런트엔드 전면 개편
- 환경/라우터 모듈에 approval_flow_v2 토글을 추가하고 FeatureFlags 초기화를 연결 (.env*, lib/core/**) - ApiClient 빌더·ApiRoutes 확장과 ApprovalRepositoryRemote 리팩터링으로 include·액션 시그니처를 정합화 - ApprovalFlow·ApprovalDraft 엔티티/레포/유즈케이스를 도입해 서버 초안과 단계 액션(승인·회수·재상신)을 지원 - Approval 컨트롤러·히스토리·템플릿 페이지와 공유 위젯을 재작성해 감사 로그·회수 UX·템플릿 CRUD를 반영 - Inbound/Outbound/Rental 컨트롤러·페이지에 결재 섹션을 삽입하고 대시보드 pending 카드 요약을 갱신 - SuperportDialog·FormField 등 공통 위젯을 보강하고 승인 위젯 가이드를 추가해 UI 가이드를 정리 - 결재/재고 테스트 픽스처와 단위·위젯·통합 테스트를 확장하고 flutter_test_config로 스테이징 호스트를 허용 - Approval Flow 레포트/플랜 문서를 업데이트하고 ApprovalFlow_System_Integration_and_ChangePlan.md를 추가 - 실행: flutter analyze, flutter test
This commit is contained in:
@@ -19,6 +19,9 @@ import '../../domain/entities/approval.dart';
|
||||
import '../../domain/entities/approval_template.dart';
|
||||
import '../../domain/repositories/approval_repository.dart';
|
||||
import '../../domain/repositories/approval_template_repository.dart';
|
||||
import '../../domain/usecases/get_approval_draft_use_case.dart';
|
||||
import '../../domain/usecases/list_approval_drafts_use_case.dart';
|
||||
import '../../domain/usecases/save_approval_draft_use_case.dart';
|
||||
import '../../../inventory/lookups/domain/repositories/inventory_lookup_repository.dart';
|
||||
import '../../../inventory/shared/widgets/employee_autocomplete_field.dart';
|
||||
import '../controllers/approval_controller.dart';
|
||||
@@ -98,6 +101,15 @@ class _ApprovalEnabledPageState extends State<_ApprovalEnabledPage> {
|
||||
lookupRepository: GetIt.I.isRegistered<InventoryLookupRepository>()
|
||||
? GetIt.I<InventoryLookupRepository>()
|
||||
: null,
|
||||
saveDraftUseCase: GetIt.I.isRegistered<SaveApprovalDraftUseCase>()
|
||||
? GetIt.I<SaveApprovalDraftUseCase>()
|
||||
: null,
|
||||
getDraftUseCase: GetIt.I.isRegistered<GetApprovalDraftUseCase>()
|
||||
? GetIt.I<GetApprovalDraftUseCase>()
|
||||
: null,
|
||||
listDraftsUseCase: GetIt.I.isRegistered<ListApprovalDraftsUseCase>()
|
||||
? GetIt.I<ListApprovalDraftsUseCase>()
|
||||
: null,
|
||||
)..addListener(_handleControllerUpdate);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
await Future.wait([
|
||||
@@ -307,24 +319,28 @@ class _ApprovalEnabledPageState extends State<_ApprovalEnabledPage> {
|
||||
),
|
||||
SizedBox(
|
||||
width: 200,
|
||||
child: ShadSelect<ApprovalStatusFilter>(
|
||||
key: ValueKey(_controller.statusFilter),
|
||||
initialValue: _controller.statusFilter,
|
||||
selectedOptionBuilder: (context, value) =>
|
||||
Text(_statusLabel(value)),
|
||||
onChanged: (value) {
|
||||
if (value == null) return;
|
||||
_controller.updateStatusFilter(value);
|
||||
_controller.fetch(page: 1);
|
||||
},
|
||||
options: ApprovalStatusFilter.values
|
||||
.map(
|
||||
(filter) => ShadOption(
|
||||
value: filter,
|
||||
child: Text(_statusLabel(filter)),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
child: Tooltip(
|
||||
message: '전체 상태 선택 시 임시저장·상신·진행중 결재까지 함께 조회합니다.',
|
||||
waitDuration: const Duration(milliseconds: 200),
|
||||
child: ShadSelect<ApprovalStatusFilter>(
|
||||
key: ValueKey(_controller.statusFilter),
|
||||
initialValue: _controller.statusFilter,
|
||||
selectedOptionBuilder: (context, value) =>
|
||||
Text(_statusLabel(value)),
|
||||
onChanged: (value) {
|
||||
if (value == null) return;
|
||||
_controller.updateStatusFilter(value);
|
||||
_controller.fetch(page: 1);
|
||||
},
|
||||
options: ApprovalStatusFilter.values
|
||||
.map(
|
||||
(filter) => ShadOption(
|
||||
value: filter,
|
||||
child: Text(_statusLabel(filter)),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -875,6 +891,11 @@ class _ApprovalEnabledPageState extends State<_ApprovalEnabledPage> {
|
||||
style: shadTheme.textTheme.small,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
_dialogDescription(type),
|
||||
style: shadTheme.textTheme.muted,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text('비고', style: shadTheme.textTheme.small),
|
||||
const SizedBox(height: 8),
|
||||
ShadTextarea(
|
||||
@@ -950,11 +971,11 @@ class _ApprovalEnabledPageState extends State<_ApprovalEnabledPage> {
|
||||
String _dialogTitle(ApprovalStepActionType type) {
|
||||
switch (type) {
|
||||
case ApprovalStepActionType.approve:
|
||||
return '단계 승인';
|
||||
return '결재 단계 승인';
|
||||
case ApprovalStepActionType.reject:
|
||||
return '단계 반려';
|
||||
return '결재 단계 반려';
|
||||
case ApprovalStepActionType.comment:
|
||||
return '코멘트 등록';
|
||||
return '결재 단계 코멘트';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -979,6 +1000,17 @@ class _ApprovalEnabledPageState extends State<_ApprovalEnabledPage> {
|
||||
return '코멘트를 등록했습니다.';
|
||||
}
|
||||
}
|
||||
|
||||
String _dialogDescription(ApprovalStepActionType type) {
|
||||
switch (type) {
|
||||
case ApprovalStepActionType.approve:
|
||||
return '승인하면 다음 단계로 진행합니다. 필요 시 비고를 남길 수 있습니다.';
|
||||
case ApprovalStepActionType.reject:
|
||||
return '반려 사유를 입력해 단계를 반려합니다. 비고는 선택 사항입니다.';
|
||||
case ApprovalStepActionType.comment:
|
||||
return '코멘트를 등록하면 결재 참여자에게 공유됩니다. 비고 입력이 필요합니다.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class _ApprovalTable extends StatelessWidget {
|
||||
|
||||
Reference in New Issue
Block a user