feat(dashboard): 결재 역할 뱃지와 문서 정합성 반영
- doc/frontend_backend_alignment_report.md에 roles 필터 적용 배경과 UI 반영 사항을 기록 - lib/features/dashboard/data/dashboard_summary_dto.dart에서 roles 파싱과 enum 매핑 로직, 문자열 리스트 util 추가 - lib/features/dashboard/domain/entities/dashboard_pending_approval.dart에 역할 enum과 도메인 필드 추가 - lib/features/dashboard/presentation/pages/dashboard_page.dart에서 결재 카드 헤더/설명 수정 및 역할 뱃지 렌더링 지원 - test/features/dashboard/data/dashboard_summary_dto_test.dart 신규 작성해 DTO→도메인 매핑과 무시 케이스를 검증 - test/features/masters/user/presentation/pages/user_page_test.dart에서 사용되지 않는 PermissionManager import 제거
This commit is contained in:
@@ -1,3 +1,42 @@
|
||||
/// 대시보드 결재 항목에서 사용자의 역할을 구분한다.
|
||||
enum DashboardApprovalRole {
|
||||
assigned(key: 'assigned', label: '배정됨'),
|
||||
requester(key: 'requester', label: '상신자', aliases: ['requested']),
|
||||
completed(key: 'completed', label: '기결재자');
|
||||
|
||||
const DashboardApprovalRole({
|
||||
required this.key,
|
||||
required this.label,
|
||||
this.aliases = const [],
|
||||
});
|
||||
|
||||
/// 백엔드가 내려주는 원시 값.
|
||||
final String key;
|
||||
|
||||
/// UI에 노출할 한국어 라벨.
|
||||
final String label;
|
||||
|
||||
/// 과거/대체 표기를 허용하기 위한 값.
|
||||
final List<String> aliases;
|
||||
|
||||
/// 문자열에서 역할 정보를 복원한다.
|
||||
static DashboardApprovalRole? fromName(String? raw) {
|
||||
if (raw == null) {
|
||||
return null;
|
||||
}
|
||||
final normalized = raw.trim().toLowerCase();
|
||||
if (normalized.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
for (final role in values) {
|
||||
if (role.key == normalized || role.aliases.contains(normalized)) {
|
||||
return role;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// 결재 대기 요약 정보.
|
||||
class DashboardPendingApproval {
|
||||
const DashboardPendingApproval({
|
||||
@@ -6,6 +45,7 @@ class DashboardPendingApproval {
|
||||
required this.title,
|
||||
required this.stepSummary,
|
||||
this.requestedAt,
|
||||
this.roles = const [],
|
||||
});
|
||||
|
||||
/// 결재 고유 식별자(ID). 상세 조회가 필요할 때 사용된다.
|
||||
@@ -22,4 +62,7 @@ class DashboardPendingApproval {
|
||||
|
||||
/// 상신 일시
|
||||
final DateTime? requestedAt;
|
||||
|
||||
/// 로그인 사용자가 해당 결재에서 가진 역할 집합.
|
||||
final List<DashboardApprovalRole> roles;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user