결재 API 계약 보완 및 테스트 정리
This commit is contained in:
33
lib/features/dashboard/domain/entities/dashboard_kpi.dart
Normal file
33
lib/features/dashboard/domain/entities/dashboard_kpi.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
/// 대시보드 KPI 카드에 사용할 수치 정보.
|
||||
class DashboardKpi {
|
||||
const DashboardKpi({
|
||||
required this.key,
|
||||
required this.label,
|
||||
required this.value,
|
||||
this.trendLabel,
|
||||
this.delta,
|
||||
});
|
||||
|
||||
/// API에서 식별 목적으로 사용하는 키 (예: inbound, outbound)
|
||||
final String key;
|
||||
|
||||
/// 사용자에게 노출할 라벨.
|
||||
final String label;
|
||||
|
||||
/// KPI 수치(건수 등)
|
||||
final num value;
|
||||
|
||||
/// 전일 대비 등 비교 텍스트.
|
||||
final String? trendLabel;
|
||||
|
||||
/// 증감 퍼센트(선택)
|
||||
final double? delta;
|
||||
|
||||
/// 카드에 표시할 값 문자열을 생성한다.
|
||||
String get displayValue {
|
||||
if (value is int || value == value.roundToDouble()) {
|
||||
return '${value.round()}건';
|
||||
}
|
||||
return value.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/// 결재 대기 요약 정보.
|
||||
class DashboardPendingApproval {
|
||||
const DashboardPendingApproval({
|
||||
required this.approvalNo,
|
||||
required this.title,
|
||||
required this.stepSummary,
|
||||
this.requestedAt,
|
||||
});
|
||||
|
||||
/// 결재 문서 번호
|
||||
final String approvalNo;
|
||||
|
||||
/// 결재 제목
|
||||
final String title;
|
||||
|
||||
/// 현재 단계/승인자 요약
|
||||
final String stepSummary;
|
||||
|
||||
/// 상신 일시(문자열)
|
||||
final String? requestedAt;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import 'dashboard_kpi.dart';
|
||||
import 'dashboard_pending_approval.dart';
|
||||
import 'dashboard_transaction_summary.dart';
|
||||
|
||||
/// 대시보드 전체 요약 응답.
|
||||
class DashboardSummary {
|
||||
const DashboardSummary({
|
||||
required this.generatedAt,
|
||||
required this.kpis,
|
||||
required this.recentTransactions,
|
||||
required this.pendingApprovals,
|
||||
});
|
||||
|
||||
/// 요약 데이터 생성 시각.
|
||||
final DateTime? generatedAt;
|
||||
|
||||
/// KPI 카드 목록.
|
||||
final List<DashboardKpi> kpis;
|
||||
|
||||
/// 최근 트랜잭션 목록.
|
||||
final List<DashboardTransactionSummary> recentTransactions;
|
||||
|
||||
/// 결재 대기 목록.
|
||||
final List<DashboardPendingApproval> pendingApprovals;
|
||||
|
||||
/// KPI를 키로 찾는다.
|
||||
DashboardKpi? findKpi(String key) {
|
||||
for (final kpi in kpis) {
|
||||
if (kpi.key == key) {
|
||||
return kpi;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/// 최근 트랜잭션 요약 정보.
|
||||
class DashboardTransactionSummary {
|
||||
const DashboardTransactionSummary({
|
||||
required this.transactionNo,
|
||||
required this.transactionDate,
|
||||
required this.transactionType,
|
||||
required this.statusName,
|
||||
required this.createdBy,
|
||||
});
|
||||
|
||||
/// 트랜잭션 번호
|
||||
final String transactionNo;
|
||||
|
||||
/// 발생 일자 (형식: yyyy-MM-dd)
|
||||
final String transactionDate;
|
||||
|
||||
/// 입고/출고/대여 등 유형
|
||||
final String transactionType;
|
||||
|
||||
/// 현재 상태 명칭
|
||||
final String statusName;
|
||||
|
||||
/// 작성자 이름
|
||||
final String createdBy;
|
||||
}
|
||||
Reference in New Issue
Block a user