summaryrefslogtreecommitdiff
path: root/lib/vendor-regular-registrations/service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vendor-regular-registrations/service.ts')
-rw-r--r--lib/vendor-regular-registrations/service.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/vendor-regular-registrations/service.ts b/lib/vendor-regular-registrations/service.ts
index d64c7b8b..7ec433b4 100644
--- a/lib/vendor-regular-registrations/service.ts
+++ b/lib/vendor-regular-registrations/service.ts
@@ -714,6 +714,8 @@ export async function fetchVendorRegistrationStatus(vendorId: number) {
const investigationFiles = await db
.select({
attachmentId: vendorInvestigationAttachments.id,
+ fileName: vendorInvestigationAttachments.fileName,
+ filePath: vendorInvestigationAttachments.filePath,
createdAt: vendorInvestigationAttachments.createdAt,
})
.from(vendorInvestigationAttachments)
@@ -735,6 +737,8 @@ export async function fetchVendorRegistrationStatus(vendorId: number) {
templateName: basicContractTemplates.templateName,
status: basicContract.status,
createdAt: basicContract.createdAt,
+ filePath: basicContract.filePath,
+ fileName: basicContract.fileName,
})
.from(basicContract)
.leftJoin(basicContractTemplates, eq(basicContract.templateId, basicContractTemplates.id))
@@ -796,6 +800,14 @@ export async function fetchVendorRegistrationStatus(vendorId: number) {
safetyQualification: investigationFiles.length > 0,
}
+ // 문서별 파일 정보 (다운로드용)
+ const documentFiles = {
+ businessRegistration: vendorFiles.filter(f => f.attachmentType === "BUSINESS_REGISTRATION"),
+ creditEvaluation: vendorFiles.filter(f => f.attachmentType === "CREDIT_REPORT"),
+ bankCopy: vendorFiles.filter(f => f.attachmentType === "BANK_ACCOUNT_COPY"),
+ auditResult: investigationFiles,
+ }
+
// 미완성 항목 계산
const missingDocuments = Object.entries(documentStatus)
.filter(([, value]) => !value)
@@ -831,6 +843,7 @@ export async function fetchVendorRegistrationStatus(vendorId: number) {
vendor: vendor[0],
registration: registration[0] || null,
documentStatus,
+ documentFiles, // 문서별 파일 정보 추가
missingDocuments,
businessContacts,
missingContactTypes,