diff options
| author | joonhoekim <26rote@gmail.com> | 2025-11-10 17:57:27 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-11-10 17:57:27 +0900 |
| commit | 64b16282fea10ed94dc1c4f1b81703c4875d9f7e (patch) | |
| tree | 3bfcc0d1c13424b82e3bda5433c92d928f8cf537 /lib/soap | |
| parent | a8ea14922ded4589005ef44164e25d07409ec215 (diff) | |
(김준회) taxId 필수값에서 제거 (MDG에서 사업자번호(세금번호) 없는 벤더가 들어오기 때문)
Diffstat (limited to 'lib/soap')
| -rw-r--r-- | lib/soap/mdg/mapper/vendor-mapper.ts | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/soap/mdg/mapper/vendor-mapper.ts b/lib/soap/mdg/mapper/vendor-mapper.ts index 1bb542e0..c9824785 100644 --- a/lib/soap/mdg/mapper/vendor-mapper.ts +++ b/lib/soap/mdg/mapper/vendor-mapper.ts @@ -307,7 +307,7 @@ async function fetchMDGVendorData(vndrCodes: string[]): Promise<MDGVendorData[]> * - id: serial (자동) * - vendorName: varchar (필수) * - vendorCode: varchar - * - taxId: varchar (필수) + * - taxId: varchar (nullable - MDG에서 없이 수신될 수 있음) * - address: text * - addressDetail: text * - postalCode: varchar @@ -342,15 +342,6 @@ function mapMDGToVendor(mdgVendorData: MDGVendorData): VendorData | null { return null; } - // taxId가 없으면 처리하지 않음 (vendors 테이블에서 필수) - if (!mdgVendorData.BIZ_PTNR_TX_NO) { - debugError('BIZ_PTNR_TX_NO가 없는 벤더 데이터', { - vndrCode: mdgVendorData.VNDRCD, - reason: '필수 필드 누락: taxId' - }); - return null; - } - // vendorName이 없으면 처리하지 않음 (vendors 테이블에서 필수) if (!mdgVendorData.VNDRNM_1) { debugError('VNDRNM_1이 없는 벤더 데이터', { @@ -360,10 +351,17 @@ function mapMDGToVendor(mdgVendorData: MDGVendorData): VendorData | null { return null; } + // taxId가 없는 경우 경고 로그만 출력 (nullable이므로 처리 계속) + if (!mdgVendorData.BIZ_PTNR_TX_NO) { + debugWarn('BIZ_PTNR_TX_NO가 없는 벤더 데이터 - taxId null로 저장됨', { + vndrCode: mdgVendorData.VNDRCD + }); + } + debugSuccess('필수 필드 검증 통과', { vndrCode: mdgVendorData.VNDRCD, vendorName: mdgVendorData.VNDRNM_1, - taxId: mdgVendorData.BIZ_PTNR_TX_NO + taxId: mdgVendorData.BIZ_PTNR_TX_NO || 'null' }); // 주소 상세 정보 결합 |
