feat(approvals): 결재 상세 전표 연동과 스코프 권한 매핑 확장
- 결재 상세 다이얼로그에 전표 요약·라인·고객 섹션을 추가하고 현재 사용자 단계 강조 및 비고 입력 검증을 개선함 - 대시보드·결재 목록에서 전표 리포지토리와 AuthService를 주입해 상세 진입과 결재 관리 이동 버튼을 제공함 - StockTransactionApprovalInput이 template/steps를 config 노드로 직렬화하도록 변경하고 통합 테스트를 갱신함 - scope 권한 문자열을 리소스권으로 변환하는 PermissionScopeMapper와 단위 테스트를 추가하고 AuthPermission을 연동함 - 재고 메뉴 정렬, 상세 컨트롤러 오류 리셋, 요청자 자동완성 상태 동기화 등 주변 UI 버그를 수정하고 테스트를 보강함
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import '../../../../core/permissions/permission_manager.dart';
|
||||
import '../../../../core/permissions/permission_resources.dart';
|
||||
import '../../../../core/permissions/permission_scope_mapper.dart';
|
||||
|
||||
/// 로그인 응답에서 내려오는 단일 권한(리소스 + 액션 목록)을 표현한다.
|
||||
class AuthPermission {
|
||||
@@ -23,13 +24,28 @@ class AuthPermission {
|
||||
}
|
||||
actionSet.add(parsed);
|
||||
}
|
||||
if (actionSet.isEmpty && isScope) {
|
||||
actionSet.add(PermissionAction.view);
|
||||
|
||||
final mappings = <String, Set<PermissionAction>>{};
|
||||
if (isScope) {
|
||||
final scopeMap = PermissionScopeMapper.map(normalized);
|
||||
if (scopeMap != null && scopeMap.isNotEmpty) {
|
||||
mappings.addAll(scopeMap);
|
||||
}
|
||||
}
|
||||
|
||||
if (actionSet.isEmpty) {
|
||||
return <String, Set<PermissionAction>>{};
|
||||
if (isScope) {
|
||||
final fallback = {PermissionAction.view};
|
||||
mappings.putIfAbsent(normalized, () => <PermissionAction>{})
|
||||
.addAll(fallback);
|
||||
return mappings;
|
||||
}
|
||||
return mappings;
|
||||
}
|
||||
return {normalized: actionSet};
|
||||
|
||||
mappings.putIfAbsent(normalized, () => <PermissionAction>{})
|
||||
.addAll(actionSet);
|
||||
return mappings;
|
||||
}
|
||||
|
||||
/// 백엔드 권한 문자열을 [PermissionAction]으로 변환한다.
|
||||
|
||||
Reference in New Issue
Block a user