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:
@@ -4,6 +4,11 @@ import 'package:mocktail/mocktail.dart';
|
||||
import 'package:superport_v2/core/common/models/paginated_result.dart';
|
||||
import 'package:superport_v2/core/network/api_error.dart';
|
||||
import 'package:superport_v2/core/network/failure.dart';
|
||||
import 'package:superport_v2/features/approvals/domain/entities/approval.dart';
|
||||
import 'package:superport_v2/features/approvals/domain/entities/approval_draft.dart';
|
||||
import 'package:superport_v2/features/approvals/domain/usecases/get_approval_draft_use_case.dart';
|
||||
import 'package:superport_v2/features/approvals/domain/usecases/list_approval_drafts_use_case.dart';
|
||||
import 'package:superport_v2/features/approvals/domain/usecases/save_approval_draft_use_case.dart';
|
||||
import 'package:superport_v2/features/inventory/inbound/presentation/controllers/inbound_controller.dart';
|
||||
import 'package:superport_v2/features/inventory/transactions/domain/entities/stock_transaction.dart';
|
||||
import 'package:superport_v2/features/inventory/transactions/domain/entities/stock_transaction_input.dart';
|
||||
@@ -23,20 +28,14 @@ class _MockTransactionLineRepository extends Mock
|
||||
class _MockTransactionCustomerRepository extends Mock
|
||||
implements TransactionCustomerRepository {}
|
||||
|
||||
class _FakeStockTransactionCreateInput extends Fake
|
||||
implements StockTransactionCreateInput {}
|
||||
class _MockSaveApprovalDraftUseCase extends Mock
|
||||
implements SaveApprovalDraftUseCase {}
|
||||
|
||||
class _FakeStockTransactionUpdateInput extends Fake
|
||||
implements StockTransactionUpdateInput {}
|
||||
class _MockGetApprovalDraftUseCase extends Mock
|
||||
implements GetApprovalDraftUseCase {}
|
||||
|
||||
class _FakeStockTransactionListFilter extends Fake
|
||||
implements StockTransactionListFilter {}
|
||||
|
||||
class _FakeTransactionCustomerCreateInput extends Fake
|
||||
implements TransactionCustomerCreateInput {}
|
||||
|
||||
class _FakeTransactionCustomerUpdateInput extends Fake
|
||||
implements TransactionCustomerUpdateInput {}
|
||||
class _MockListApprovalDraftsUseCase extends Mock
|
||||
implements ListApprovalDraftsUseCase {}
|
||||
|
||||
void main() {
|
||||
group('InboundController', () {
|
||||
@@ -47,13 +46,31 @@ void main() {
|
||||
late InboundController controller;
|
||||
|
||||
setUpAll(() {
|
||||
registerFallbackValue(_FakeStockTransactionCreateInput());
|
||||
registerFallbackValue(_FakeStockTransactionUpdateInput());
|
||||
registerFallbackValue(_FakeStockTransactionListFilter());
|
||||
registerFallbackValue(_FakeTransactionCustomerCreateInput());
|
||||
registerFallbackValue(_FakeTransactionCustomerUpdateInput());
|
||||
registerFallbackValue(
|
||||
StockTransactionCreateInput(
|
||||
transactionTypeId: 0,
|
||||
transactionStatusId: 0,
|
||||
warehouseId: 0,
|
||||
transactionDate: DateTime(2000, 1, 1),
|
||||
createdById: 0,
|
||||
approval: StockTransactionApprovalInput(requestedById: 0),
|
||||
),
|
||||
);
|
||||
registerFallbackValue(
|
||||
StockTransactionUpdateInput(transactionStatusId: 0),
|
||||
);
|
||||
registerFallbackValue(StockTransactionListFilter());
|
||||
registerFallbackValue(TransactionCustomerCreateInput(customerId: 0));
|
||||
registerFallbackValue(TransactionCustomerUpdateInput(id: 0));
|
||||
registerFallbackValue(<TransactionCustomerCreateInput>[]);
|
||||
registerFallbackValue(<TransactionCustomerUpdateInput>[]);
|
||||
registerFallbackValue(const ApprovalDraftListFilter(requesterId: 0));
|
||||
registerFallbackValue(
|
||||
ApprovalDraftSaveInput(
|
||||
requesterId: 0,
|
||||
steps: [ApprovalDraftStep(stepOrder: 0, approverId: 0)],
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
setUp(() {
|
||||
@@ -81,6 +98,7 @@ void main() {
|
||||
warehouseId: 3,
|
||||
transactionDate: DateTime(2024, 3, 1),
|
||||
createdById: 9,
|
||||
approval: StockTransactionApprovalInput(requestedById: 9),
|
||||
);
|
||||
|
||||
final record = await controller.createTransaction(
|
||||
@@ -91,6 +109,7 @@ void main() {
|
||||
expect(record.id, equals(transaction.id));
|
||||
expect(controller.records.length, equals(1));
|
||||
expect(controller.records.first.id, equals(transaction.id));
|
||||
expect(controller.approvalDraft?.requestedById, equals(9));
|
||||
verify(() => transactionRepository.create(any())).called(1);
|
||||
});
|
||||
|
||||
@@ -111,6 +130,7 @@ void main() {
|
||||
warehouseId: 3,
|
||||
transactionDate: DateTime(2024, 3, 1),
|
||||
createdById: 9,
|
||||
approval: StockTransactionApprovalInput(requestedById: 9),
|
||||
),
|
||||
refreshAfter: false,
|
||||
);
|
||||
@@ -149,6 +169,7 @@ void main() {
|
||||
warehouseId: 3,
|
||||
transactionDate: DateTime(2024, 3, 1),
|
||||
createdById: 9,
|
||||
approval: StockTransactionApprovalInput(requestedById: 9),
|
||||
),
|
||||
refreshAfter: false,
|
||||
);
|
||||
@@ -197,6 +218,107 @@ void main() {
|
||||
verify(() => customerRepository.addCustomers(42, any())).called(1);
|
||||
});
|
||||
|
||||
test('updateApprovalDraft와 clearApprovalDraft가 초안을 관리한다', () {
|
||||
final approval = StockTransactionApprovalInput(
|
||||
requestedById: 55,
|
||||
approvalStatusId: 7,
|
||||
note: '메모',
|
||||
);
|
||||
|
||||
controller.updateApprovalDraft(approval);
|
||||
|
||||
expect(controller.approvalDraft?.requestedById, equals(55));
|
||||
expect(controller.approvalDraft?.approvalStatusId, equals(7));
|
||||
|
||||
controller.clearApprovalDraft();
|
||||
|
||||
expect(controller.approvalDraft, isNull);
|
||||
});
|
||||
|
||||
test('updateApprovalDraft는 서버 초안을 동기화한다', () async {
|
||||
final saveUseCase = _MockSaveApprovalDraftUseCase();
|
||||
when(() => saveUseCase.call(any())).thenAnswer(
|
||||
(_) async => ApprovalDraftDetail(
|
||||
id: 1,
|
||||
requesterId: 3,
|
||||
savedAt: DateTime.utc(2025, 1, 1),
|
||||
payload: ApprovalDraftPayload(steps: const []),
|
||||
),
|
||||
);
|
||||
final controllerWithSave = InboundController(
|
||||
transactionRepository: transactionRepository,
|
||||
lineRepository: lineRepository,
|
||||
customerRepository: customerRepository,
|
||||
lookupRepository: lookupRepository,
|
||||
saveDraftUseCase: saveUseCase,
|
||||
);
|
||||
|
||||
final approval = StockTransactionApprovalInput(
|
||||
requestedById: 3,
|
||||
approvalStatusId: 2,
|
||||
steps: [ApprovalStepAssignmentItem(stepOrder: 1, approverId: 4)],
|
||||
);
|
||||
|
||||
controllerWithSave.updateApprovalDraft(approval);
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
|
||||
verify(() => saveUseCase.call(captureAny())).called(1);
|
||||
});
|
||||
|
||||
test('loadApprovalDraftFromServer는 원격 초안을 반영한다', () async {
|
||||
final listUseCase = _MockListApprovalDraftsUseCase();
|
||||
final getUseCase = _MockGetApprovalDraftUseCase();
|
||||
final summary = ApprovalDraftSummary(
|
||||
id: 5,
|
||||
requesterId: 3,
|
||||
status: ApprovalDraftStatus.active,
|
||||
savedAt: DateTime.utc(2025, 1, 2),
|
||||
sessionKey: 'inventory_inbound_3',
|
||||
stepCount: 1,
|
||||
);
|
||||
when(() => listUseCase.call(any())).thenAnswer(
|
||||
(_) async => PaginatedResult<ApprovalDraftSummary>(
|
||||
items: [summary],
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
total: 1,
|
||||
),
|
||||
);
|
||||
final detail = ApprovalDraftDetail(
|
||||
id: summary.id,
|
||||
requesterId: 3,
|
||||
savedAt: DateTime.utc(2025, 1, 2),
|
||||
payload: ApprovalDraftPayload(
|
||||
metadata: const {
|
||||
'_client_state': {'status_id': 6},
|
||||
},
|
||||
steps: [ApprovalDraftStep(stepOrder: 1, approverId: 9)],
|
||||
),
|
||||
);
|
||||
when(
|
||||
() => getUseCase.call(id: summary.id, requesterId: 3),
|
||||
).thenAnswer((_) async => detail);
|
||||
|
||||
final controllerWithDrafts = InboundController(
|
||||
transactionRepository: transactionRepository,
|
||||
lineRepository: lineRepository,
|
||||
customerRepository: customerRepository,
|
||||
lookupRepository: lookupRepository,
|
||||
getDraftUseCase: getUseCase,
|
||||
listDraftsUseCase: listUseCase,
|
||||
);
|
||||
|
||||
await controllerWithDrafts.loadApprovalDraftFromServer(requesterId: 3);
|
||||
|
||||
verify(() => listUseCase.call(any())).called(1);
|
||||
verify(() => getUseCase.call(id: summary.id, requesterId: 3)).called(1);
|
||||
final approval = controllerWithDrafts.approvalDraft;
|
||||
expect(approval, isNotNull);
|
||||
expect(approval!.requestedById, 3);
|
||||
expect(approval.approvalStatusId, 6);
|
||||
expect(approval.steps, hasLength(1));
|
||||
});
|
||||
|
||||
test('submitTransaction은 refreshAfter가 true일 때 목록을 다시 불러온다', () async {
|
||||
final filter = StockTransactionListFilter(transactionTypeId: 1);
|
||||
final initial = _buildTransaction();
|
||||
|
||||
@@ -21,7 +21,9 @@ void main() {
|
||||
});
|
||||
|
||||
setUp(() {
|
||||
registerInventoryTestStubs();
|
||||
registerInventoryTestStubs(
|
||||
const InventoryTestStubConfig(registerProductRepository: true),
|
||||
);
|
||||
});
|
||||
|
||||
tearDown(() async {
|
||||
@@ -137,7 +139,9 @@ void main() {
|
||||
matching: find.byType(EditableText),
|
||||
);
|
||||
await tester.enterText(firstProductInput, 'XR-5000');
|
||||
await tester.pump();
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('XR-5000').last);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final addLineButton = find.widgetWithText(ShadButton, '품목 추가');
|
||||
await tester.ensureVisible(addLineButton);
|
||||
@@ -152,12 +156,14 @@ void main() {
|
||||
matching: find.byType(EditableText),
|
||||
);
|
||||
await tester.enterText(secondProductInput, 'XR-5000');
|
||||
await tester.pump();
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('XR-5000').last);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final saveButton = find.widgetWithText(ShadButton, '저장');
|
||||
await tester.ensureVisible(saveButton);
|
||||
await tester.tap(saveButton);
|
||||
await tester.pump();
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('동일 제품이 중복되었습니다.'), findsOneWidget);
|
||||
});
|
||||
|
||||
@@ -21,15 +21,6 @@ class _MockTransactionLineRepository extends Mock
|
||||
class _MockTransactionCustomerRepository extends Mock
|
||||
implements TransactionCustomerRepository {}
|
||||
|
||||
class _FakeStockTransactionCreateInput extends Fake
|
||||
implements StockTransactionCreateInput {}
|
||||
|
||||
class _FakeStockTransactionUpdateInput extends Fake
|
||||
implements StockTransactionUpdateInput {}
|
||||
|
||||
class _FakeStockTransactionListFilter extends Fake
|
||||
implements StockTransactionListFilter {}
|
||||
|
||||
void main() {
|
||||
group('OutboundController', () {
|
||||
late StockTransactionRepository transactionRepository;
|
||||
@@ -39,9 +30,20 @@ void main() {
|
||||
late OutboundController controller;
|
||||
|
||||
setUpAll(() {
|
||||
registerFallbackValue(_FakeStockTransactionCreateInput());
|
||||
registerFallbackValue(_FakeStockTransactionUpdateInput());
|
||||
registerFallbackValue(_FakeStockTransactionListFilter());
|
||||
registerFallbackValue(
|
||||
StockTransactionCreateInput(
|
||||
transactionTypeId: 0,
|
||||
transactionStatusId: 0,
|
||||
warehouseId: 0,
|
||||
transactionDate: DateTime(2000, 1, 1),
|
||||
createdById: 0,
|
||||
approval: StockTransactionApprovalInput(requestedById: 0),
|
||||
),
|
||||
);
|
||||
registerFallbackValue(
|
||||
StockTransactionUpdateInput(transactionStatusId: 0),
|
||||
);
|
||||
registerFallbackValue(StockTransactionListFilter());
|
||||
});
|
||||
|
||||
setUp(() {
|
||||
@@ -70,12 +72,31 @@ void main() {
|
||||
warehouseId: 3,
|
||||
transactionDate: DateTime(2024, 4, 1),
|
||||
createdById: 7,
|
||||
approval: StockTransactionApprovalInput(requestedById: 7),
|
||||
),
|
||||
refreshAfter: false,
|
||||
);
|
||||
|
||||
expect(record.id, equals(transaction.id));
|
||||
expect(controller.records.first.id, equals(transaction.id));
|
||||
expect(controller.approvalDraft?.requestedById, equals(7));
|
||||
});
|
||||
|
||||
test('updateApprovalDraft와 clearApprovalDraft가 초안을 관리한다', () {
|
||||
final draft = StockTransactionApprovalInput(
|
||||
requestedById: 33,
|
||||
approvalStatusId: 4,
|
||||
note: '테스트',
|
||||
);
|
||||
|
||||
controller.updateApprovalDraft(draft);
|
||||
|
||||
expect(controller.approvalDraft?.requestedById, equals(33));
|
||||
expect(controller.approvalDraft?.approvalStatusId, equals(4));
|
||||
|
||||
controller.clearApprovalDraft();
|
||||
|
||||
expect(controller.approvalDraft, isNull);
|
||||
});
|
||||
|
||||
test('completeTransaction은 레코드를 갱신하고 처리 상태를 추적한다', () async {
|
||||
@@ -95,6 +116,7 @@ void main() {
|
||||
warehouseId: 3,
|
||||
transactionDate: DateTime(2024, 4, 1),
|
||||
createdById: 7,
|
||||
approval: StockTransactionApprovalInput(requestedById: 7),
|
||||
),
|
||||
refreshAfter: false,
|
||||
);
|
||||
|
||||
@@ -18,7 +18,9 @@ void main() {
|
||||
});
|
||||
|
||||
setUp(() {
|
||||
registerInventoryTestStubs();
|
||||
registerInventoryTestStubs(
|
||||
const InventoryTestStubConfig(registerProductRepository: true),
|
||||
);
|
||||
});
|
||||
|
||||
tearDown(() async {
|
||||
|
||||
@@ -22,15 +22,6 @@ class _MockTransactionLineRepository extends Mock
|
||||
class _MockTransactionCustomerRepository extends Mock
|
||||
implements TransactionCustomerRepository {}
|
||||
|
||||
class _FakeStockTransactionCreateInput extends Fake
|
||||
implements StockTransactionCreateInput {}
|
||||
|
||||
class _FakeStockTransactionUpdateInput extends Fake
|
||||
implements StockTransactionUpdateInput {}
|
||||
|
||||
class _FakeStockTransactionListFilter extends Fake
|
||||
implements StockTransactionListFilter {}
|
||||
|
||||
void main() {
|
||||
group('RentalController', () {
|
||||
late StockTransactionRepository transactionRepository;
|
||||
@@ -40,9 +31,20 @@ void main() {
|
||||
late RentalController controller;
|
||||
|
||||
setUpAll(() {
|
||||
registerFallbackValue(_FakeStockTransactionCreateInput());
|
||||
registerFallbackValue(_FakeStockTransactionUpdateInput());
|
||||
registerFallbackValue(_FakeStockTransactionListFilter());
|
||||
registerFallbackValue(
|
||||
StockTransactionCreateInput(
|
||||
transactionTypeId: 0,
|
||||
transactionStatusId: 0,
|
||||
warehouseId: 0,
|
||||
transactionDate: DateTime(2000, 1, 1),
|
||||
createdById: 0,
|
||||
approval: StockTransactionApprovalInput(requestedById: 0),
|
||||
),
|
||||
);
|
||||
registerFallbackValue(
|
||||
StockTransactionUpdateInput(transactionStatusId: 0),
|
||||
);
|
||||
registerFallbackValue(StockTransactionListFilter());
|
||||
});
|
||||
|
||||
setUp(() {
|
||||
@@ -71,12 +73,31 @@ void main() {
|
||||
warehouseId: 4,
|
||||
transactionDate: DateTime(2024, 5, 1),
|
||||
createdById: 5,
|
||||
approval: StockTransactionApprovalInput(requestedById: 5),
|
||||
),
|
||||
refreshAfter: false,
|
||||
);
|
||||
|
||||
expect(record.id, equals(transaction.id));
|
||||
expect(controller.records.first.id, equals(transaction.id));
|
||||
expect(controller.approvalDraft?.requestedById, equals(5));
|
||||
});
|
||||
|
||||
test('updateApprovalDraft와 clearApprovalDraft가 초안을 관리한다', () {
|
||||
final approval = StockTransactionApprovalInput(
|
||||
requestedById: 44,
|
||||
approvalStatusId: 9,
|
||||
note: '대여 승인',
|
||||
);
|
||||
|
||||
controller.updateApprovalDraft(approval);
|
||||
|
||||
expect(controller.approvalDraft?.requestedById, equals(44));
|
||||
expect(controller.approvalDraft?.approvalStatusId, equals(9));
|
||||
|
||||
controller.clearApprovalDraft();
|
||||
|
||||
expect(controller.approvalDraft, isNull);
|
||||
});
|
||||
|
||||
test('deleteTransaction은 레코드를 제거하고 처리 상태를 초기화한다', () async {
|
||||
@@ -95,6 +116,7 @@ void main() {
|
||||
warehouseId: 4,
|
||||
transactionDate: DateTime(2024, 5, 1),
|
||||
createdById: 5,
|
||||
approval: StockTransactionApprovalInput(requestedById: 5),
|
||||
),
|
||||
refreshAfter: false,
|
||||
);
|
||||
|
||||
@@ -18,7 +18,9 @@ void main() {
|
||||
});
|
||||
|
||||
setUp(() {
|
||||
registerInventoryTestStubs();
|
||||
registerInventoryTestStubs(
|
||||
const InventoryTestStubConfig(registerProductRepository: true),
|
||||
);
|
||||
});
|
||||
|
||||
tearDown(() async {
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:superport_v2/features/inventory/transactions/data/dtos/stock_transaction_dto.dart';
|
||||
|
||||
void main() {
|
||||
group('StockTransactionDto', () {
|
||||
test('결재 상세 정보를 포함해 파싱한다', () {
|
||||
final dto = StockTransactionDto.fromJson({
|
||||
'id': 9001,
|
||||
'transaction_no': 'TRX-202511100001',
|
||||
'transaction_date': '2025-09-18',
|
||||
'transaction_type': {'id': 1, 'name': '입고'},
|
||||
'transaction_status': {'id': 1, 'name': '초안'},
|
||||
'warehouse': {
|
||||
'id': 1,
|
||||
'warehouse_code': 'WH-001',
|
||||
'warehouse_name': '1센터',
|
||||
},
|
||||
'created_by': {
|
||||
'id': 7,
|
||||
'employee_no': 'E20250001',
|
||||
'employee_name': '김상신',
|
||||
},
|
||||
'lines': [
|
||||
{
|
||||
'id': 12001,
|
||||
'line_no': 1,
|
||||
'product': {
|
||||
'id': 101,
|
||||
'product_code': 'P100',
|
||||
'product_name': '샘플',
|
||||
},
|
||||
'quantity': 10,
|
||||
'unit_price': 1200,
|
||||
},
|
||||
],
|
||||
'customers': [],
|
||||
'approval': {
|
||||
'id': 5001,
|
||||
'approval_no': 'APP-202511100001',
|
||||
'status': {
|
||||
'id': 1,
|
||||
'name': '대기',
|
||||
'is_blocking_next': true,
|
||||
'is_terminal': false,
|
||||
},
|
||||
'current_step': {
|
||||
'id': 7001,
|
||||
'step_order': 1,
|
||||
'status': {
|
||||
'id': 2,
|
||||
'name': '진행중',
|
||||
'is_blocking_next': true,
|
||||
'is_terminal': false,
|
||||
},
|
||||
'approver': {'id': 21, 'employee_no': 'E2025002', 'name': '박검토'},
|
||||
'assigned_at': '2025-09-18T06:05:00Z',
|
||||
},
|
||||
'requester': {'id': 7, 'employee_no': 'E20250001', 'name': '김상신'},
|
||||
'requested_at': '2025-09-18T06:00:00Z',
|
||||
'note': '입고 결재',
|
||||
'template_name': '입고 결재 기본',
|
||||
'steps': [
|
||||
{
|
||||
'id': 7201,
|
||||
'step_order': 1,
|
||||
'status': {
|
||||
'id': 3,
|
||||
'name': '승인',
|
||||
'is_blocking_next': false,
|
||||
'is_terminal': false,
|
||||
},
|
||||
'approver': {'id': 21, 'employee_no': 'E2025002', 'name': '박검토'},
|
||||
'assigned_at': '2025-09-18T06:05:00Z',
|
||||
'decided_at': '2025-09-18T06:10:00Z',
|
||||
},
|
||||
{
|
||||
'id': 7202,
|
||||
'step_order': 2,
|
||||
'status': {
|
||||
'id': 1,
|
||||
'name': '대기',
|
||||
'is_blocking_next': true,
|
||||
'is_terminal': false,
|
||||
},
|
||||
'approver': {'id': 22, 'employee_no': 'E2025003', 'name': '이승인'},
|
||||
'assigned_at': '2025-09-18T06:10:00Z',
|
||||
},
|
||||
],
|
||||
'histories': [
|
||||
{
|
||||
'id': 93001,
|
||||
'action': {'id': 1, 'name': '상신'},
|
||||
'to_status': {
|
||||
'id': 1,
|
||||
'name': '대기',
|
||||
'is_blocking_next': true,
|
||||
'is_terminal': false,
|
||||
},
|
||||
'approver': {'id': 7, 'employee_no': 'E20250001', 'name': '김상신'},
|
||||
'action_at': '2025-09-18T06:00:00Z',
|
||||
},
|
||||
],
|
||||
'created_at': '2025-09-18T06:00:00Z',
|
||||
'updated_at': '2025-09-18T06:05:00Z',
|
||||
},
|
||||
});
|
||||
|
||||
final entity = dto.toEntity();
|
||||
|
||||
expect(entity.approval, isNotNull);
|
||||
final approval = entity.approval!;
|
||||
expect(approval.approvalNo, 'APP-202511100001');
|
||||
expect(approval.status.name, '대기');
|
||||
expect(approval.currentStep?.stepOrder, 1);
|
||||
expect(approval.currentStep?.approver.name, '박검토');
|
||||
expect(approval.steps.length, 2);
|
||||
expect(approval.histories.length, 1);
|
||||
expect(approval.requester.name, '김상신');
|
||||
expect(
|
||||
approval.requestedAt.toUtc().toIso8601String(),
|
||||
'2025-09-18T06:00:00.000Z',
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user