diff options
Diffstat (limited to 'lib/techsales-rfq/service.ts')
| -rw-r--r-- | lib/techsales-rfq/service.ts | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/lib/techsales-rfq/service.ts b/lib/techsales-rfq/service.ts index 8ce41cba..e52c7a36 100644 --- a/lib/techsales-rfq/service.ts +++ b/lib/techsales-rfq/service.ts @@ -1971,12 +1971,6 @@ export async function processTechSalesRfqAttachments(params: { drmFiles.push({ file, attachmentType, description });
}
}
-
- // RFQ 상태가 "RFQ Sent"이고 DRM 파일이 추가된 경우 재발송 결재 트리거
- if (rfq.status === TECH_SALES_RFQ_STATUSES.RFQ_SENT && drmFiles.length > 0) {
- // 트랜잭션 외부에서 처리하기 위해 에러로 전달
- throw new Error("DRM_FILE_ADDED_TO_SENT_RFQ");
- }
}
});
@@ -1990,20 +1984,19 @@ export async function processTechSalesRfqAttachments(params: { return {
data: results,
error: null,
- message: `${results.uploaded.length}개 업로드, ${results.deleted.length}개 삭제 완료`
+ message: `${results.uploaded.length}개 업로드, ${results.deleted.length}개 삭제 완료`,
+ requiresDrmApproval: rfq.status === TECH_SALES_RFQ_STATUSES.RFQ_SENT && results.uploaded.some(att => att.drmEncrypted),
+ drmAttachments: results.uploaded
+ .filter(att => att.drmEncrypted)
+ .map(att => ({
+ id: att.id,
+ fileName: att.originalFileName || att.fileName,
+ fileSize: att.fileSize,
+ attachmentType: att.attachmentType,
+ })),
};
} catch (err) {
console.error("기술영업 RFQ 첨부파일 일괄 처리 오류:", err);
-
- // DRM 파일 추가로 인한 재발송 결재 필요 에러
- if (err instanceof Error && err.message === "DRM_FILE_ADDED_TO_SENT_RFQ") {
- return {
- data: null,
- error: "DRM_FILE_ADDED_TO_SENT_RFQ",
- rfqId: techSalesRfqId,
- };
- }
-
return { data: null, error: getErrorMessage(err) };
}
}
|
