diff options
Diffstat (limited to 'lib/vendor-regular-registrations/approval-actions.ts')
| -rw-r--r-- | lib/vendor-regular-registrations/approval-actions.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/vendor-regular-registrations/approval-actions.ts b/lib/vendor-regular-registrations/approval-actions.ts index 298591e9..b90ef2b6 100644 --- a/lib/vendor-regular-registrations/approval-actions.ts +++ b/lib/vendor-regular-registrations/approval-actions.ts @@ -7,7 +7,7 @@ 'use server'; -import { withApproval } from '@/lib/approval/approval-workflow'; +import { ApprovalSubmissionSaga } from '@/lib/approval'; import { mapRegistrationToTemplateVariables } from './handlers'; import { debugLog, debugError, debugSuccess } from '@/lib/debug-utils'; import type { RegistrationRequestData } from '@/components/vendor-regular-registrations/registration-request-dialog'; @@ -70,9 +70,9 @@ export async function registerVendorWithApproval(data: { variableKeys: Object.keys(variables), }); - // 2. 결재 워크플로우 시작 (템플릿 기반) - debugLog('[VendorRegistrationApproval] withApproval 호출'); - const result = await withApproval( + // 2. 결재 워크플로우 시작 (Saga 패턴) + debugLog('[VendorRegistrationApproval] ApprovalSubmissionSaga 생성'); + const saga = new ApprovalSubmissionSaga( // actionType: 핸들러를 찾을 때 사용할 키 'vendor_regular_registration', @@ -93,6 +93,9 @@ export async function registerVendorWithApproval(data: { } ); + debugLog('[VendorRegistrationApproval] Saga 실행 시작'); + const result = await saga.execute(); + // 3. 결재 상신 성공 시 상태를 pending_approval로 변경 if (result.status === 'pending_approval') { debugLog('[VendorRegistrationApproval] 상태를 pending_approval로 변경'); |
