summaryrefslogtreecommitdiff
path: root/lib/techsales-rfq/actions.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/techsales-rfq/actions.ts')
-rw-r--r--lib/techsales-rfq/actions.ts59
1 files changed, 59 insertions, 0 deletions
diff --git a/lib/techsales-rfq/actions.ts b/lib/techsales-rfq/actions.ts
new file mode 100644
index 00000000..9bcb20e5
--- /dev/null
+++ b/lib/techsales-rfq/actions.ts
@@ -0,0 +1,59 @@
+"use server"
+
+import { revalidatePath } from "next/cache"
+import {
+ acceptTechSalesVendorQuotation,
+ rejectTechSalesVendorQuotation
+} from "./service"
+
+// ... existing code ...
+
+/**
+ * 기술영업 벤더 견적 승인 (벤더 선택) Server Action
+ */
+export async function acceptTechSalesVendorQuotationAction(quotationId: number) {
+ try {
+ const result = await acceptTechSalesVendorQuotation(quotationId)
+
+ if (result.success) {
+ // 관련 페이지들 재검증
+ revalidatePath("/evcp/budgetary-tech-sales-ship")
+ revalidatePath("/partners/techsales")
+
+ return { success: true, message: "벤더가 성공적으로 선택되었습니다" }
+ } else {
+ return { success: false, error: result.error }
+ }
+ } catch (error) {
+ console.error("벤더 선택 액션 오류:", error)
+ return {
+ success: false,
+ error: error instanceof Error ? error.message : "벤더 선택에 실패했습니다"
+ }
+ }
+}
+
+/**
+ * 기술영업 벤더 견적 거절 Server Action
+ */
+export async function rejectTechSalesVendorQuotationAction(quotationId: number, rejectionReason?: string) {
+ try {
+ const result = await rejectTechSalesVendorQuotation(quotationId, rejectionReason)
+
+ if (result.success) {
+ // 관련 페이지들 재검증
+ revalidatePath("/evcp/budgetary-tech-sales-ship")
+ revalidatePath("/partners/techsales")
+
+ return { success: true, message: "견적이 성공적으로 거절되었습니다" }
+ } else {
+ return { success: false, error: result.error }
+ }
+ } catch (error) {
+ console.error("견적 거절 액션 오류:", error)
+ return {
+ success: false,
+ error: error instanceof Error ? error.message : "견적 거절에 실패했습니다"
+ }
+ }
+} \ No newline at end of file